image not displayed in flexbox
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Oct 2012 01:52:21 +0000 (01:52 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Oct 2012 01:52:21 +0000 (01:52 +0000)
commit8b4afd69def4e9996c20f7c7ef8758ecfb255937
treedde8bc2d78a0dc5fd10e6b756984d544a6a6f1d4
parentf3e5f75c8943781eb1a5d4312a5d783cfced5ef1
image not displayed in flexbox
https://bugs.webkit.org/show_bug.cgi?id=98611

Reviewed by Ojan Vafai.

Source/WebCore:

Flexbox will override the width of a child and when stretching, will override the height of the child.
When this happens, when an image loads, it checks to see if it's width/height has
changed, and if so, does a relayout.  The overridden width/height was preventing this
relayout from happening.

To fix, we clear all the override sizes when we're done laying out the flex children.

Test: css3/flexbox/relayout-image-load.html

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutBlock): Clear child override sizes.
(WebCore::RenderFlexibleBox::clearChildOverrideSizes):
(WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes): No longer need to clear the override size
here since it should have already been cleared.
* rendering/RenderFlexibleBox.h:

LayoutTests:

Load an image after flexbox layout has happened.

* css3/flexbox/relayout-image-load-expected.txt: Added.
* css3/flexbox/relayout-image-load.html: Added.
* platform/chromium/TestExpectations: Remove css3/flexbox/flexitem-stretch-image.html
since it should no longer be flaky.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130714 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/css3/flexbox/relayout-image-load-expected.txt [new file with mode: 0644]
LayoutTests/css3/flexbox/relayout-image-load.html [new file with mode: 0644]
LayoutTests/platform/chromium/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderFlexibleBox.cpp
Source/WebCore/rendering/RenderFlexibleBox.h