Changeset 167597 in webkit
- Timestamp:
- Apr 21, 2014 11:07:15 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r167593 r167597 1 2014-04-21 David Hyatt <hyatt@apple.com> 2 3 [New Multicolumn] Pagination mode messed up with non-inline axis and reversed direction. 4 https://bugs.webkit.org/show_bug.cgi?id=131811 5 6 Reviewed by Dean Jackson. 7 8 * fast/multicol/newmulticol/compare-with-old-impl/BottomToTop-tb-expected.html: Added. 9 * fast/multicol/newmulticol/compare-with-old-impl/BottomToTop-tb.html: Added. 10 1 11 2014-04-21 Alexey Proskuryakov <ap@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r167596 r167597 1 2014-04-21 David Hyatt <hyatt@apple.com> 2 3 [New Multicolumn] Pagination mode messed up with non-inline axis and reversed direction. 4 https://bugs.webkit.org/show_bug.cgi?id=131811 5 6 Reviewed by Dean Jackson. 7 8 Added fast/multicol/newmulticol/compare-with-old-impl/BottomToTop-tb.html 9 10 With block axis pagination mode, it is possible to set a column height that is not the same 11 as the available fill height for a block. The new multi-column code had the assumption that 12 the column height was the same as the amount of fill room you had available. This is not 13 the case. 14 15 To correct the issue, I added a member variable to RenderMultiColumnSet that stores the 16 available column height as a separate variable from the computed column height. This allows 17 the pagination API to specify a different column height that is not the same as the view's 18 content height. 19 20 Even though it isn't involved in the solution, I also patched pageOrViewLogicalHeight on 21 RenderView to work with the new column code as well. 22 23 To address the layout test failures (that caused the previous rollout), I made sure to 24 initialize m_availableHeight to 0 when m_computedColumnHeight also gets reset to 0. 25 26 The assertion is not something I could reproduce on any machine, but I can see the problem. 27 I patched Page's pageCount method to not have column code directly in Page.cpp, 28 and to make a new pageCount() method on RenderView that Page calls 29 into. This method is now patched to handle the new column code as well as the old. I have 30 no real way of testing this method though, since I can't reproduce the assertion that the 31 bots were experiencing. 32 33 * page/Page.cpp: 34 (WebCore::Page::pageCount): 35 * rendering/RenderMultiColumnSet.cpp: 36 (WebCore::RenderMultiColumnSet::RenderMultiColumnSet): 37 (WebCore::RenderMultiColumnSet::setAndConstrainColumnHeight): 38 (WebCore::RenderMultiColumnSet::prepareForLayout): 39 (WebCore::RenderMultiColumnSet::computeLogicalHeight): 40 * rendering/RenderMultiColumnSet.h: 41 * rendering/RenderView.cpp: 42 (WebCore::RenderView::pageOrViewLogicalHeight): 43 (WebCore::RenderView::pageCount): 44 * rendering/RenderView.h: 45 1 46 2014-04-18 Dean Jackson <dino@apple.com> 2 47 -
trunk/Source/WebCore/page/Page.cpp
r167523 r167597 859 859 860 860 RenderView* contentRenderer = mainFrame().contentRenderer(); 861 return contentRenderer ? contentRenderer-> columnCount(contentRenderer->columnInfo()) : 0;861 return contentRenderer ? contentRenderer->pageCount() : 0; 862 862 } 863 863 -
trunk/Source/WebCore/rendering/RenderMultiColumnSet.cpp
r167483 r167597 27 27 #include "RenderMultiColumnSet.h" 28 28 29 #include "FrameView.h" 29 30 #include "PaintInfo.h" 30 31 #include "RenderLayer.h" 31 32 #include "RenderMultiColumnFlowThread.h" 32 33 #include "RenderMultiColumnSpannerPlaceholder.h" 34 #include "RenderView.h" 33 35 34 36 namespace WebCore { … … 39 41 , m_computedColumnWidth(0) 40 42 , m_computedColumnHeight(0) 43 , m_availableColumnHeight(0) 41 44 , m_maxColumnHeight(RenderFlowThread::maxLogicalHeight()) 42 45 , m_minSpaceShortage(RenderFlowThread::maxLogicalHeight()) … … 152 155 if (m_computedColumnHeight > m_maxColumnHeight) 153 156 m_computedColumnHeight = m_maxColumnHeight; 157 158 // FIXME: The available column height is not the same as the constrained height specified 159 // by the pagination API. The column set in this case is allowed to be bigger than the 160 // height of a single column. We cache available column height in order to use it 161 // in computeLogicalHeight later. This is pretty gross, and maybe there's a better way 162 // to formalize the idea of clamped column heights without having a view dependency 163 // here. 164 m_availableColumnHeight = m_computedColumnHeight; 165 if (multiColumnFlowThread() && !multiColumnFlowThread()->progressionIsInline() && parent()->isRenderView()) { 166 int pageLength = view().frameView().pagination().pageLength; 167 if (pageLength) 168 m_computedColumnHeight = pageLength; 169 } 154 170 // FIXME: the height may also be affected by the enclosing pagination context, if any. 155 171 } … … 328 344 m_maxColumnHeight = calculateMaxColumnHeight(); 329 345 if (requiresBalancing()) { 330 if (initial) 346 if (initial) { 331 347 m_computedColumnHeight = 0; 348 m_availableColumnHeight = 0; 349 } 332 350 } else 333 351 setAndConstrainColumnHeight(heightAdjustedForSetOffset(multiColumnFlowThread()->columnHeightAvailable())); … … 397 415 void RenderMultiColumnSet::computeLogicalHeight(LayoutUnit, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const 398 416 { 399 computedValues.m_extent = m_ computedColumnHeight;417 computedValues.m_extent = m_availableColumnHeight; 400 418 computedValues.m_position = logicalTop; 401 419 } -
trunk/Source/WebCore/rendering/RenderMultiColumnSet.h
r167483 r167597 179 179 LayoutUnit m_computedColumnWidth; // Used column width (the resulting 'W' from the pseudo-algorithm in the multicol spec) 180 180 LayoutUnit m_computedColumnHeight; 181 LayoutUnit m_availableColumnHeight; 181 182 182 183 // The following variables are used when balancing the column set. -
trunk/Source/WebCore/rendering/RenderView.cpp
r167538 r167597 296 296 return pageLogicalHeight(); 297 297 298 if ( hasColumns() && !style().hasInlineColumnAxis()) {298 if ((hasColumns() || multiColumnFlowThread()) && !style().hasInlineColumnAxis()) { 299 299 if (int pageLength = frameView().pagination().pageLength) 300 300 return pageLength; … … 1258 1258 } 1259 1259 1260 unsigned RenderView::pageCount() const 1261 { 1262 const Pagination& pagination = frameView().frame().page()->pagination(); 1263 if (pagination.mode == Pagination::Unpaginated) 1264 return 0; 1265 1266 if (hasColumns()) 1267 return columnCount(columnInfo()); 1268 if (multiColumnFlowThread()) 1269 return multiColumnFlowThread()->columnCount(); 1270 1271 return 0; 1272 } 1273 1260 1274 } // namespace WebCore -
trunk/Source/WebCore/rendering/RenderView.h
r167444 r167597 161 161 unsigned pageNumberForBlockProgressionOffset(int offset) const; 162 162 163 unsigned pageCount() const; 164 163 165 // FIXME: These functions are deprecated. No code should be added that uses these. 164 166 int bestTruncatedAt() const { return m_legacyPrinting.m_bestTruncatedAt; }
Note: See TracChangeset
for help on using the changeset viewer.