diff options
| author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-05-20 09:56:07 +0000 |
|---|---|---|
| committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-05-20 09:56:07 +0000 |
| commit | 41386e9cb918eed93b3f13648cbef387e371e451 (patch) | |
| tree | a97f9d7bd1d9d091833286085f72da9d83fd0606 /Source/WebCore/rendering/RenderTable.h | |
| parent | e15dd966d523731101f70ccf768bba12435a0208 (diff) | |
| download | WebKitGtk-tarball-41386e9cb918eed93b3f13648cbef387e371e451.tar.gz | |
webkitgtk-2.4.9webkitgtk-2.4.9
Diffstat (limited to 'Source/WebCore/rendering/RenderTable.h')
| -rw-r--r-- | Source/WebCore/rendering/RenderTable.h | 76 |
1 files changed, 22 insertions, 54 deletions
diff --git a/Source/WebCore/rendering/RenderTable.h b/Source/WebCore/rendering/RenderTable.h index 49a0eb8cd..166c7cb8b 100644 --- a/Source/WebCore/rendering/RenderTable.h +++ b/Source/WebCore/rendering/RenderTable.h @@ -4,7 +4,7 @@ * (C) 1998 Waldo Bastian (bastian@kde.org) * (C) 1999 Lars Knoll (knoll@kde.org) * (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2003, 2004, 2005, 2006, 2009, 2010, 2014 Apple Inc. All rights reserved. + * Copyright (C) 2003, 2004, 2005, 2006, 2009, 2010 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -28,8 +28,6 @@ #include "CSSPropertyNames.h" #include "CollapsedBorderValue.h" #include "RenderBlock.h" -#include <memory> -#include <wtf/HashMap.h> #include <wtf/Vector.h> namespace WebCore { @@ -44,8 +42,8 @@ enum SkipEmptySectionsValue { DoNotSkipEmptySections, SkipEmptySections }; class RenderTable : public RenderBlock { public: - RenderTable(Element&, Ref<RenderStyle>&&); - RenderTable(Document&, Ref<RenderStyle>&&); + RenderTable(Element&, PassRef<RenderStyle>); + RenderTable(Document&, PassRef<RenderStyle>); virtual ~RenderTable(); // Per CSS 3 writing-mode: "The first and second values of the 'border-spacing' property represent spacing between columns @@ -55,33 +53,33 @@ public: bool collapseBorders() const { return style().borderCollapse(); } - virtual LayoutUnit borderStart() const override { return m_borderStart; } - virtual LayoutUnit borderEnd() const override { return m_borderEnd; } - virtual LayoutUnit borderBefore() const override; - virtual LayoutUnit borderAfter() const override; + virtual int borderStart() const override { return m_borderStart; } + virtual int borderEnd() const override { return m_borderEnd; } + virtual int borderBefore() const override; + virtual int borderAfter() const override; - virtual LayoutUnit borderLeft() const override + virtual int borderLeft() const override { if (style().isHorizontalWritingMode()) return style().isLeftToRightDirection() ? borderStart() : borderEnd(); return style().isFlippedBlocksWritingMode() ? borderAfter() : borderBefore(); } - virtual LayoutUnit borderRight() const override + virtual int borderRight() const override { if (style().isHorizontalWritingMode()) return style().isLeftToRightDirection() ? borderEnd() : borderStart(); return style().isFlippedBlocksWritingMode() ? borderBefore() : borderAfter(); } - virtual LayoutUnit borderTop() const override + virtual int borderTop() const override { if (style().isHorizontalWritingMode()) return style().isFlippedBlocksWritingMode() ? borderAfter() : borderBefore(); return style().isLeftToRightDirection() ? borderStart() : borderEnd(); } - virtual LayoutUnit borderBottom() const override + virtual int borderBottom() const override { if (style().isHorizontalWritingMode()) return style().isFlippedBlocksWritingMode() ? borderBefore() : borderAfter(); @@ -174,9 +172,6 @@ public: unsigned colToEffCol(unsigned column) const { - if (!m_hasCellColspanThatDeterminesTableWidth) - return column; - unsigned effColumn = 0; unsigned numColumns = numEffCols(); for (unsigned c = 0; effColumn < numColumns && c + m_columns[effColumn].span - 1 < column; ++effColumn) @@ -186,9 +181,6 @@ public: unsigned effColToCol(unsigned effCol) const { - if (!m_hasCellColspanThatDeterminesTableWidth) - return effCol; - unsigned c = 0; for (unsigned i = 0; i < effCol; i++) c += m_columns[i].span; @@ -198,7 +190,7 @@ public: LayoutUnit borderSpacingInRowDirection() const { if (unsigned effectiveColumnCount = numEffCols()) - return (effectiveColumnCount + 1) * hBorderSpacing(); + return static_cast<LayoutUnit>(effectiveColumnCount + 1) * hBorderSpacing(); return 0; } @@ -242,9 +234,11 @@ public: RenderTableCell* cellAfter(const RenderTableCell*) const; typedef Vector<CollapsedBorderValue> CollapsedBorderValues; - bool collapsedBordersAreValid() const { return m_collapsedBordersValid; } - void invalidateCollapsedBorders(); - void collapsedEmptyBorderIsPresent() { m_collapsedEmptyBorderIsPresent = true; } + void invalidateCollapsedBorders() + { + m_collapsedBordersValid = false; + m_collapsedBorders.clear(); + } const CollapsedBorderValue* currentBorderValue() const { return m_currentBorder; } bool hasSections() const { return m_head || m_foot || m_firstBody; } @@ -269,13 +263,6 @@ public: void addColumn(const RenderTableCol*); void removeColumn(const RenderTableCol*); - LayoutUnit offsetTopForColumn(const RenderTableCol&) const; - LayoutUnit offsetLeftForColumn(const RenderTableCol&) const; - LayoutUnit offsetWidthForColumn(const RenderTableCol&) const; - LayoutUnit offsetHeightForColumn(const RenderTableCol&) const; - - virtual void markForPaginationRelayoutIfNeeded() override final; - protected: virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override final; virtual void simplifiedNormalFlowLayout() override final; @@ -297,16 +284,14 @@ private: virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override; virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const override final; - virtual Optional<int> firstLineBaseline() const override; - virtual Optional<int> inlineBlockBaseline(LineDirectionMode) const override final; + virtual int firstLineBaseline() const override; + virtual int inlineBlockBaseline(LineDirectionMode) const override final; RenderTableCol* slowColElement(unsigned col, bool* startEdge, bool* endEdge) const; void updateColumnCache() const; void invalidateCachedColumns(); - void invalidateCachedColumnOffsets(); - virtual RenderBlock* firstLineBlock() const override final; virtual void updateFirstLetter() override final; @@ -333,43 +318,26 @@ private: mutable Vector<RenderTableCaption*> m_captions; mutable Vector<RenderTableCol*> m_columnRenderers; - unsigned effectiveIndexOfColumn(const RenderTableCol&) const; - typedef HashMap<const RenderTableCol*, unsigned> EffectiveColumnIndexMap; - mutable EffectiveColumnIndexMap m_effectiveColumnIndexMap; - mutable RenderTableSection* m_head; mutable RenderTableSection* m_foot; mutable RenderTableSection* m_firstBody; - std::unique_ptr<TableLayout> m_tableLayout; + OwnPtr<TableLayout> m_tableLayout; CollapsedBorderValues m_collapsedBorders; const CollapsedBorderValue* m_currentBorder; bool m_collapsedBordersValid : 1; - bool m_collapsedEmptyBorderIsPresent : 1; mutable bool m_hasColElements : 1; mutable bool m_needsSectionRecalc : 1; bool m_columnLogicalWidthChanged : 1; mutable bool m_columnRenderersValid: 1; - mutable bool m_hasCellColspanThatDeterminesTableWidth : 1; - - bool hasCellColspanThatDeterminesTableWidth() const - { - for (unsigned c = 0; c < numEffCols(); c++) { - if (m_columns[c].span > 1) - return true; - } - return false; - } short m_hSpacing; short m_vSpacing; int m_borderStart; int m_borderEnd; - mutable LayoutUnit m_columnOffsetTop; - mutable LayoutUnit m_columnOffsetHeight; }; inline RenderTableSection* RenderTable::topSection() const @@ -382,8 +350,8 @@ inline RenderTableSection* RenderTable::topSection() const return m_foot; } -} // namespace WebCore +RENDER_OBJECT_TYPE_CASTS(RenderTable, isTable()) -SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderTable, isTable()) +} // namespace WebCore #endif // RenderTable_h |
