Fix cross-direction stretch for replaced elements in column flexbox
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Aug 2012 23:41:09 +0000 (23:41 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Aug 2012 23:41:09 +0000 (23:41 +0000)
commitb2a39ecdaf67d33d496ee4beeb30b72aba4d3894
treec123808e401f93b9f8f0107c57abc4da4c117ddc
parent76b1c1b9cd657a6d9e46d3b392a725f5c688924a
Fix cross-direction stretch for replaced elements in column flexbox
https://bugs.webkit.org/show_bug.cgi?id=94604

Patch by Shezan Baig <shezbaig.wk@gmail.com> on 2012-08-23
Reviewed by Ojan Vafai.

Source/WebCore:

Moved the logic that constrains logical width by MinSize and MaxSize to
a new helper function called constrainLogicalWidthInRegionByMinMax.
This helper function is used from both computeLogicalWidthInRegion and
RenderFlexibleBox::applyStretchAlignmentToChild.

RenderFlexibleBox no longer checks for isMultiline when stretching
elements in a column flexbox. Instead, we now constrain the available
width by the child's min-width and max-width, and set the override
width only if that constrained width is different from the child's
current logicalWidth.

No new tests. The existing css3/flexbox/flexitem.html test was extended
to exercise the new code.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::constrainLogicalWidthInRegionByMinMax): New helper
method to constrain logical width by min-width and max-width.
(WebCore):
(WebCore::RenderBox::computeLogicalWidthInRegion): Changed to use the
new constrainLogicalWidthInRegionByMinMax helper method.
* rendering/RenderBox.h:
(RenderBox):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::applyStretchAlignmentToChild): Changed to
use constrainLogicalWidthInRegionByMinMax to determine the override
width for the child.

LayoutTests:

Fixed failing test cases. Add tests for min/max width/height.

* css3/flexbox/flexitem-expected.txt:
* css3/flexbox/flexitem.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@126503 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/css3/flexbox/flexitem-expected.txt
LayoutTests/css3/flexbox/flexitem.html
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderFlexibleBox.cpp