Changeset 129975 in webkit
- Timestamp:
- Sep 29, 2012 3:22:22 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r129958 r129975 1 2012-09-29 Kenneth Rohde Christiansen <kenneth@webkit.org> 2 3 Scroll offset of flex items lost during relayout 4 https://bugs.webkit.org/show_bug.cgi?id=97706 5 6 Reviewed by Tony Chang. 7 8 Add a new test for testing that flex items scroll offsets are 9 not lost during relayout. 10 11 * css3/flexbox/overflow-keep-scrollpos-expected.txt: Added. 12 * css3/flexbox/overflow-keep-scrollpos.html: Added. 13 * css3/flexbox/child-overflow.html: Fix minor errors. 14 1 15 2012-09-28 Emil A Eklund <eae@chromium.org> 2 16 -
trunk/LayoutTests/css3/flexbox/child-overflow.html
r122508 r129975 78 78 "<div class='" + containerClass + "'>" + 79 79 "<div class='" + flexboxClass + "'>" + 80 "<div style='-webkit-flex: 0 1 auto ; -webkit-flex: 0 1 auto'><div></div></div>" +80 "<div style='-webkit-flex: 0 1 auto'><div></div></div>" + 81 81 "</div>" + 82 82 "</div> "; … … 84 84 document.body.innerHTML += "<br>"; 85 85 }); 86 87 86 </script> 88 </body>89 87 </html> -
trunk/Source/WebCore/ChangeLog
r129974 r129975 1 2012-09-29 Kenneth Rohde Christiansen <kenneth@webkit.org> 2 3 Scroll offset of flex items lost during relayout 4 https://bugs.webkit.org/show_bug.cgi?id=97706 5 6 Reviewed by Tony Chang. 7 8 Test: fast/flexbox/overflow-keep-scrollpos.html 9 10 Flex box does a second pass layout of the flex children. 11 12 We layout the child without scrollbars (to get the size 13 used for flexing), then we relayout the child at its final size. 14 15 We must not apply the scroll position during the first pass, 16 as it will be clamped to 0 (no scrolling possible). 17 18 * rendering/RenderBlock.h: 19 (RenderBlock): 20 21 Make updateScrollInfoAfterLayout public 22 23 * rendering/RenderFlexibleBox.cpp: 24 (WebCore::RenderFlexibleBox::layoutBlock): 25 26 Delay applying scroll info until we clamp the size of the child 27 and get scrollbars back again. For this to work we use 28 RenderBlock::updateScrollInfoAfterLayout instead of the non-guarded 29 RenderLayer::updateScrollInfoAfterLayout. 30 31 * rendering/RenderBlock.cpp: 32 (WebCore::RenderBlock::updateScrollInfoAfterLayout): 33 34 Add workaround for now to keep passing css3/flexbox/child-overflow.html 35 36 Basically do not postpone applying scroll changes for RenderBlocks 37 with opposite writing mode, as they need to have their content 38 overflow in the right direction. 39 1 40 2012-09-29 Dimitri Glazkov <dglazkov@chromium.org> 2 41 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r129787 r129975 1356 1356 { 1357 1357 if (hasOverflowClip()) { 1358 if (style()->isFlippedBlocksWritingMode()) { 1359 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=97937 1360 // Workaround for now. We cannot delay the scroll info for overflow 1361 // for items with opposite writing directions, as the contents needs 1362 // to overflow in that direction 1363 layer()->updateScrollInfoAfterLayout(); 1364 return; 1365 } 1366 1358 1367 if (gDelayUpdateScrollInfo) 1359 1368 gDelayedUpdateScrollInfoSet->add(this); -
trunk/Source/WebCore/rendering/RenderBlock.h
r129787 r129975 461 461 static void finishDelayUpdateScrollInfo(); 462 462 463 void updateScrollInfoAfterLayout(); 464 463 465 virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle); 464 466 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); … … 858 860 859 861 bool expandsToEncloseOverhangingFloats() const; 860 861 void updateScrollInfoAfterLayout();862 862 863 863 void splitBlocks(RenderBlock* fromBlock, RenderBlock* toBlock, RenderBlock* middleBlock, -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r129914 r129975 259 259 m_overflow.clear(); 260 260 261 RenderBlock::startDelayUpdateScrollInfo(); 262 261 263 WTF::Vector<LineContext> lineContexts; 262 264 OrderHashSet orderValues; … … 269 271 repositionLogicalHeightDependentFlexItems(*m_orderIterator, lineContexts, oldClientAfterEdge); 270 272 273 RenderBlock::finishDelayUpdateScrollInfo(); 274 271 275 if (size() != previousSize) 272 276 relayoutChildren = true; … … 284 288 // Update our scroll information if we're overflow:auto/scroll/hidden now that we know if 285 289 // we overflow or not. 286 if (hasOverflowClip()) 287 layer()->updateScrollInfoAfterLayout(); 290 updateScrollInfoAfterLayout(); 288 291 289 292 repainter.repaintAfterLayout();
Note: See TracChangeset
for help on using the changeset viewer.