Scroll offset of flex items lost during relayout
https://bugs.webkit.org/show_bug.cgi?id=97706
Reviewed by Tony Chang.
Source/WebCore:
Test: fast/flexbox/overflow-keep-scrollpos.html
Flex box does a second pass layout of the flex children.
We layout the child without scrollbars (to get the size
used for flexing), then we relayout the child at its final size.
We must not apply the scroll position during the first pass,
as it will be clamped to 0 (no scrolling possible).
* rendering/RenderBlock.h:
(RenderBlock):
Make updateScrollInfoAfterLayout public
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutBlock):
Delay applying scroll info until we clamp the size of the child
and get scrollbars back again. For this to work we use
RenderBlock::updateScrollInfoAfterLayout instead of the non-guarded
RenderLayer::updateScrollInfoAfterLayout.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::updateScrollInfoAfterLayout):
Add workaround for now to keep passing css3/flexbox/child-overflow.html
Basically do not postpone applying scroll changes for RenderBlocks
with opposite writing mode, as they need to have their content
overflow in the right direction.
LayoutTests:
Add a new test for testing that flex items scroll offsets are
not lost during relayout.
* css3/flexbox/overflow-keep-scrollpos-expected.txt: Added.
* css3/flexbox/overflow-keep-scrollpos.html: Added.
* css3/flexbox/child-overflow.html: Fix minor errors.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk/LayoutTests@129975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
4 files changed