incorrect flexbox relayout with overflow, padding and absolute positioning
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Jan 2013 01:21:07 +0000 (01:21 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Jan 2013 01:21:07 +0000 (01:21 +0000)
commitd2f9b8bc00f435195428cb6d5823ebec548233bd
tree7031d647791383ef9d86d16466a0e42820f79e57
parentab09a5593388fe2473457969d769fb90259b1de8
incorrect flexbox relayout with overflow, padding and absolute positioning
https://bugs.webkit.org/show_bug.cgi?id=106022

Reviewed by Ojan Vafai.

Source/WebCore:

The problem was we were entering simplified layout, which doesn't apply the stretch
behavior for flex children. That should be fine if we had kept the override size from
the previous layout. So clear the override size during layout rather than after layout.

Not clearing the override size re-triggers bug 98611. Fix this by always forcing a
layout of an image if it has an override size set. The presence of an override size means
we did some special layout that may not be covered by re-computing the logical width and
height.

Test: css3/flexbox/stretch-simplified-layout.html

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutBlock): Don't clear the override size after layout.
(WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes): Clear the override size right before layout.
* rendering/RenderFlexibleBox.h:
(RenderFlexibleBox): Remove clearChildOverrideSizes() since it's not called anymore.
* rendering/RenderImage.cpp:
(WebCore::RenderImage::imageDimensionsChanged): If an override size is present, force a relayout.
Also cleaned up the code a bit to avoid computing the width and height unless we need to.

LayoutTests:

* css3/flexbox/stretch-simplified-layout-expected.txt: Added.
* css3/flexbox/stretch-simplified-layout.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@138770 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/css3/flexbox/stretch-simplified-layout-expected.txt [new file with mode: 0644]
LayoutTests/css3/flexbox/stretch-simplified-layout.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderFlexibleBox.cpp
Source/WebCore/rendering/RenderFlexibleBox.h
Source/WebCore/rendering/RenderImage.cpp