Flexboxes incorrectly add the scrollbar width to the intrinsic width of fixed-width...
authorojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Jan 2013 20:32:24 +0000 (20:32 +0000)
committerojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Jan 2013 20:32:24 +0000 (20:32 +0000)
commit697d90cf1771946f99c15713546b85ca473283d2
tree8d1b74271cf505697022de9f4a13340a2210080c
parent1f6f376601955a9b02caf8e17314496d297b8f9c
Flexboxes incorrectly add the scrollbar width to the intrinsic width of fixed-width items
https://bugs.webkit.org/show_bug.cgi?id=106591

Reviewed by Levi Weintraub.

Source/WebCore:

The scrollbar width should only be added if the width of the flex item
is not fixed.

Test: fast/css/fixed-width-intrinsic-width-excludes-scrollbars.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computePreferredLogicalWidths):
Use shared helper method. This also happens to fix the vertical
writing-mode case.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::instrinsicScrollbarLogicalWidth):
(WebCore):
* rendering/RenderBox.h:
(RenderBox):
Add a method for determining the scrollbar's contribution to the boxes
intrinsic width.

* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::computePreferredLogicalWidths):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computePreferredLogicalWidths):
Use shared code for determining the scrollbar width and only add the
width when computing the intrinsic widths.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computePreferredLogicalWidths):\
Just adding a FIXME to account for scrollbar width.

LayoutTests:

* fast/css/fixed-width-intrinsic-width-excludes-scrollbars-expected.txt: Added.
* fast/css/fixed-width-intrinsic-width-excludes-scrollbars.html: Added.
* fast/css/positioned-overflow-scroll.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@139351 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css/fixed-width-intrinsic-width-excludes-scrollbars-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/fixed-width-intrinsic-width-excludes-scrollbars.html [new file with mode: 0644]
LayoutTests/fast/css/positioned-overflow-scroll.html
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
Source/WebCore/rendering/RenderFlexibleBox.cpp
Source/WebCore/rendering/RenderGrid.cpp