Change overrideSizes to be content-box instead of border-box
authorojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Jun 2012 18:32:10 +0000 (18:32 +0000)
committerojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Jun 2012 18:32:10 +0000 (18:32 +0000)
commita56b0d68959dc205aed880dc8234946fc19c5631
treec5966767f3de28db7528d726702efa7a9b900847
parent3f617d4d9637476d90fd20418f1bca510d5780e8
Change overrideSizes to be content-box instead of border-box
https://bugs.webkit.org/show_bug.cgi?id=88116

Reviewed by Tony Chang.

Source/WebCore:

Previously, the code used border-box everywhere except for one place
where it used content-box when setting the override size. Conversely,
it subtracted the borderAndPaddingSize everywhere it grabbed the override
size except for one.

Instead, make the override size override the content-box size.
Converging on using the border-box size would be tricky given RenderTableCell's
tricky management of intrinsic padding.

There is no behavior change except in RenderBox::availableLogicalHeightUsing,
which fixes a table test.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::setOverrideLogicalContentHeight):
(WebCore::RenderBox::setOverrideLogicalContentWidth):
(WebCore::RenderBox::overrideLogicalContentWidth):
(WebCore::RenderBox::overrideLogicalContentHeight):
(WebCore::RenderBox::computeLogicalWidthInRegion):
(WebCore::RenderBox::computeLogicalHeight):
(WebCore::RenderBox::computePercentageLogicalHeight):
(WebCore::RenderBox::availableLogicalHeightUsing):
We were incorrectly subtracting the borderAndPaddingLogicalWidth instead
of the borderAndPaddingLogicalHeight.

* rendering/RenderBox.h:
(RenderBox):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
(WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
(WebCore::RenderDeprecatedFlexibleBox::allowedChildFlex):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeAvailableFreeSpace):
(WebCore::RenderFlexibleBox::setLogicalOverrideSize):
(WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::setOverrideHeightFromRowHeight):

LayoutTests:

* fast/table/padding-height-and-override-height-expected.txt:
* fast/table/padding-height-and-override-height.html:
Tests the change in RenderBox::availableLogicalHeightUsing to correctly subtract the
borderAndPaddingLogicalHeight instead of the borderAndPaddingLogicalWidth.
* platform/chromium-linux/tables/mozilla/bugs/bug131020-expected.png:
* platform/chromium-win/tables/mozilla/bugs/bug131020-expected.txt:
The new results are more correct. The table cell had 2px too much padding-top and padding-bottom before.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@119507 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/table/padding-height-and-override-height-expected.txt [new file with mode: 0644]
LayoutTests/fast/table/padding-height-and-override-height.html [new file with mode: 0644]
LayoutTests/platform/chromium-linux/tables/mozilla/bugs/bug131020-expected.png
LayoutTests/platform/chromium-win/tables/mozilla/bugs/bug131020-expected.txt
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/qt/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
Source/WebCore/rendering/RenderFlexibleBox.cpp
Source/WebCore/rendering/RenderTableCell.cpp
Source/WebCore/rendering/RenderTableCell.h
Source/WebCore/rendering/RenderTableSection.cpp