Changeset 143683 in webkit
- Timestamp:
- Feb 21, 2013, 7:12:04 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r143681 r143683 1 2013-02-21 Ojan Vafai <ojan@chromium.org> 2 3 Clean up computePreferredLogicalWidths functions in TableLayout subclasses 4 https://bugs.webkit.org/show_bug.cgi?id=110515 5 6 Reviewed by Tony Chang. 7 8 No change in behavior. This is just a cleanup in preparation for other 9 refactoring to this code. 10 11 * rendering/FixedTableLayout.cpp: 12 (WebCore::FixedTableLayout::calcWidthArray): 13 Move a FIXME here from computePreferredLogicalWidths. It makes more sense here. 14 (WebCore::FixedTableLayout::computePreferredLogicalWidths): 15 -Remove outdated or unhelpful comments. 16 -Isolate the fixed width codepath to make it a bit less convoluted. 17 (WebCore::FixedTableLayout::layout): 18 * rendering/FixedTableLayout.h: 19 The argument to calcWidthArray is never used. Remove it. 20 1 21 2013-02-21 Eric Seidel <eric@webkit.org> 2 22 -
trunk/Source/WebCore/rendering/FixedTableLayout.cpp
r140047 r143683 78 78 } 79 79 80 int FixedTableLayout::calcWidthArray( int)80 int FixedTableLayout::calcWidthArray() 81 81 { 82 // FIXME: We might want to wait until we have all of the first row before computing for the first time. 82 83 int usedWidth = 0; 83 84 … … 178 179 void FixedTableLayout::computePreferredLogicalWidths(LayoutUnit& minWidth, LayoutUnit& maxWidth) 179 180 { 180 // FIXME: This entire calculation is incorrect for both minwidth and maxwidth.181 182 // we might want to wait until we have all of the first row before183 // layouting for the first time.184 185 // only need to calculate the minimum width as the sum of the186 // cols/cells with a fixed width.187 //188 // The maximum width is max(minWidth, tableWidth).189 181 int bordersPaddingAndSpacing = m_table->bordersPaddingAndSpacingInRowDirection(); 190 191 int tableLogicalWidth = m_table->style()->logicalWidth().isFixed() ? m_table->style()->logicalWidth().value() - bordersPaddingAndSpacing : 0; 192 int mw = calcWidthArray(tableLogicalWidth) + bordersPaddingAndSpacing; 193 194 minWidth = max(mw, tableLogicalWidth); 195 maxWidth = minWidth; 196 197 // This quirk is very similar to one that exists in RenderBlock::calcBlockPrefWidths(). 198 // Here's the example for this one: 182 minWidth = maxWidth = calcWidthArray() + bordersPaddingAndSpacing; 183 184 Length tableLogicalWidth = m_table->style()->logicalWidth(); 185 if (tableLogicalWidth.isFixed() && tableLogicalWidth.isPositive()) 186 minWidth = maxWidth = max<int>(minWidth, tableLogicalWidth.value() - bordersPaddingAndSpacing); 187 199 188 /* 200 189 <table style="width:100%; background-color:red"><tr><td> … … 221 210 // This means that our preferred logical widths were not recomputed as expected. 222 211 if (nEffCols != m_width.size()) { 223 calcWidthArray( tableLogicalWidth);212 calcWidthArray(); 224 213 // FIXME: Table layout shouldn't modify our table structure (but does due to columns and column-groups). 225 214 nEffCols = m_table->numEffCols(); -
trunk/Source/WebCore/rendering/FixedTableLayout.h
r133779 r143683 39 39 40 40 private: 41 int calcWidthArray( int tableWidth);41 int calcWidthArray(); 42 42 43 43 Vector<Length> m_width;
Note:
See TracChangeset
for help on using the changeset viewer.