Positioned, replaced elements with intrinsic width keywords compute the wrong width
authorojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Feb 2013 01:07:56 +0000 (01:07 +0000)
committerojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Feb 2013 01:07:56 +0000 (01:07 +0000)
commitd9604164bc706f0c7aa2422127057644d925faa2
tree5ac9bbdd1ccd3169847cf088b3a3fac3aa83fd74
parent3f81d9099c3e77ba39bb2e818cb33f02fba63307
Positioned, replaced elements with intrinsic width keywords compute the wrong width
https://bugs.webkit.org/show_bug.cgi?id=110393

Reviewed by Emil A Eklund.

Source/WebCore:

Test: fast/css-intrinsic-dimensions/intrinsic-sized-replaced-absolutes.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeReplacedLogicalWidthUsing):
Add the intrinsic size keywords to the switch. Confusingly, we have to
subtract the border and padding since the callers expect the content width.

* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::computeReplacedLogicalWidth):
Don't do the intrinsic ratio calculation if the width is an
intrinsic width keyword, as per, http://dev.w3.org/csswg/css3-sizing/#replaced-intrinsic.

(WebCore::RenderReplaced::computeIntrinsicLogicalWidths):
(WebCore::RenderReplaced::computePreferredLogicalWidths):
The old code was trying to apply the intrinsic ratio calculation to
the intrinsic width, which is wrong per spec.

LayoutTests:

* fast/css-intrinsic-dimensions/intrinsic-sized-replaced-absolutes-expected.txt: Added.
* fast/css-intrinsic-dimensions/intrinsic-sized-replaced-absolutes.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@143539 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-replaced-absolutes-expected.txt [new file with mode: 0644]
LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-replaced-absolutes.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderReplaced.cpp