Changeset 140047 in webkit
- Timestamp:
- Jan 17, 2013, 2:41:14 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r140045 r140047 1 2013-01-17 Ojan Vafai <ojan@chromium.org> 2 3 Table layout does not need to explicitly call computePreferredLogicalWidths 4 https://bugs.webkit.org/show_bug.cgi?id=106931 5 6 Reviewed by Julien Chaffraix. 7 8 Code shouldn't need to explicitly call computePreferredLogicalWidths. 9 It should only get called as a by-product of calling minPreferredLogicalWidth 10 or maxPreferredLogicalWidth. 11 12 Instead, make it clear that the calling code is just trying to clear 13 preferred width dirty bits. 14 15 * rendering/AutoTableLayout.cpp: 16 (WebCore::AutoTableLayout::recalcColumn): 17 The computePreferredLogicalWidths call on the table cell is redundant 18 with the minPreferredLogicalWidth call on the next line. 19 20 * rendering/FixedTableLayout.cpp: 21 (WebCore::FixedTableLayout::calcWidthArray): 22 We only need to clear the dirty bit here. Table cells don't use 23 their preferred widths in fixed table layout calculations. 24 25 * rendering/RenderTableCell.h: 26 * rendering/RenderTableCol.cpp: 27 (WebCore::RenderTableCol::clearPreferredLogicalWidthsDirtyBits): 28 * rendering/RenderTableCol.h: 29 1 30 2013-01-17 Julien Chaffraix <jchaffraix@webkit.org> 2 31 -
trunk/Source/WebCore/rendering/AutoTableLayout.cpp
r133037 r140047 51 51 52 52 for (RenderObject* child = m_table->children()->firstChild(); child; child = child->nextSibling()) { 53 if (child->isRenderTableCol()) 54 toRenderTableCol(child)->computePreferredLogicalWidths(); 55 else if (child->isTableSection()) { 53 if (child->isRenderTableCol()){ 54 // RenderTableCols don't have the concept of preferred logical width, but we need to clear their dirty bits 55 // so that if we call setPreferredWidthsDirty(true) on a col or one of its descendants, we'll mark it's 56 // ancestors as dirty. 57 toRenderTableCol(child)->clearPreferredLogicalWidthsDirtyBits(); 58 } else if (child->isTableSection()) { 56 59 RenderTableSection* section = toRenderTableSection(child); 57 60 unsigned numRows = section->numRows(); … … 73 76 74 77 if (cell->colSpan() == 1) { 75 if (cell->preferredLogicalWidthsDirty())76 cell->computePreferredLogicalWidths();77 78 columnLayout.minLogicalWidth = max<int>(cell->minPreferredLogicalWidth(), columnLayout.minLogicalWidth); 78 79 if (cell->maxPreferredLogicalWidth() > columnLayout.maxLogicalWidth) { -
trunk/Source/WebCore/rendering/FixedTableLayout.cpp
r134017 r140047 89 89 unsigned currentEffectiveColumn = 0; 90 90 for (RenderTableCol* col = m_table->firstColumn(); col; col = col->nextColumn()) { 91 col->computePreferredLogicalWidths(); 91 // RenderTableCols don't have the concept of preferred logical width, but we need to clear their dirty bits 92 // so that if we call setPreferredWidthsDirty(true) on a col or one of its descendants, we'll mark it's 93 // ancestors as dirty. 94 col->clearPreferredLogicalWidthsDirtyBits(); 92 95 93 96 // Width specified by column-groups that have column child does not affect column width in fixed layout tables … … 139 142 140 143 RenderTableCell* cell = toRenderTableCell(child); 141 if (cell->preferredLogicalWidthsDirty())142 cell->computePreferredLogicalWidths();143 144 144 145 Length logicalWidth = cell->styleOrColLogicalWidth(); 145 146 unsigned span = cell->colSpan(); 146 147 int fixedBorderBoxLogicalWidth = 0; 148 // FIXME: Support other length types. If the width is non-auto, it should probably just use 149 // RenderBox::computeLogicalWidthInRegionUsing to compute the width. 147 150 if (logicalWidth.isFixed() && logicalWidth.isPositive()) { 148 151 fixedBorderBoxLogicalWidth = cell->adjustBorderBoxLogicalWidthForBoxSizing(logicalWidth.value()); … … 162 165 ++currentColumn; 163 166 } 167 168 // FixedTableLayout doesn't use min/maxPreferredLogicalWidths, but we need to clear the 169 // dirty bit on the cell so that we'll correctly mark its ancestors dirty 170 // in case we later call setPreferredLogicalWidthsDirty(true) on it later. 171 if (cell->preferredLogicalWidthsDirty()) 172 cell->setPreferredLogicalWidthsDirty(false); 164 173 } 165 174 -
trunk/Source/WebCore/rendering/RenderTableCell.h
r140039 r140047 103 103 } 104 104 105 virtual void computePreferredLogicalWidths();106 105 107 106 void setCellLogicalWidth(int constrainedLogicalWidth); … … 208 207 protected: 209 208 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); 209 virtual void computePreferredLogicalWidths(); 210 210 211 211 private: -
trunk/Source/WebCore/rendering/RenderTableCol.cpp
r140039 r140047 116 116 } 117 117 118 void RenderTableCol::c omputePreferredLogicalWidths()118 void RenderTableCol::clearPreferredLogicalWidthsDirtyBits() 119 119 { 120 120 setPreferredLogicalWidthsDirty(false); -
trunk/Source/WebCore/rendering/RenderTableCol.h
r140039 r140047 44 44 RenderObjectChildList* children() { return &m_children; } 45 45 46 v irtual void computePreferredLogicalWidths();46 void clearPreferredLogicalWidthsDirtyBits(); 47 47 48 48 unsigned span() const { return m_span; } … … 86 86 virtual bool isRenderTableCol() const OVERRIDE { return true; } 87 87 virtual void updateFromElement(); 88 virtual void computePreferredLogicalWidths() OVERRIDE { ASSERT_NOT_REACHED(); } 88 89 89 90 virtual void insertedIntoTree() OVERRIDE;
Note:
See TracChangeset
for help on using the changeset viewer.