Empty <button>s should collapse; empty <input type="button"> should not collapse
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Feb 2013 21:08:52 +0000 (21:08 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Feb 2013 21:08:52 +0000 (21:08 +0000)
commit9f13a5be35c43137dd543f479e2b3a8760dac01c
treeb926e374da746a3231780b3616da04c8925ce8cc
parente85d9a662990a3d84ab64c4db4a1a8fe9abd3696
Empty <button>s should collapse; empty <input type="button"> should not collapse
https://bugs.webkit.org/show_bug.cgi?id=110654

Patch by Christian Biesinger <cbiesinger@chromium.org> on 2013-02-26
Reviewed by Ojan Vafai.

Source/WebCore:

This patch also fixes other height computation issues with flex boxes
related to scroll bars and hasLineIfEmpty()=true. See below for
details.

Tests: css3/flexbox/button.html
       css3/flexbox/position-absolute-child-with-contenteditable.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::layoutBlock): Add a FIXME to make
border/padding/scrollbar inclusion more consistent with other
renderers.
* rendering/RenderButton.h:
(WebCore::RenderButton::hasLineIfEmpty): We only want a line for
<input type=button|submit|reset>, for consistency with Firefox.

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutBlock): Start out layoutBlock by
setting the logical height to border + padding + scrollbar height to
ensure that we have space for the scrollbar even without children. The
layoutFlexItems change below is not enough because we also need this
when hasLineIfEmpty() is false.
(WebCore::RenderFlexibleBox::layoutFlexItems): Ensure we have a line
when hasLineIfEmpty() is true by calling setLogicalHeight(border+
padding+scrollbar+lineHeight()) if we don't have a flex line.

LayoutTests:

* css3/flexbox/button-expected.png: Added.
* css3/flexbox/button-expected.txt: Added.
* css3/flexbox/button.html: Added.
Test empty buttons, <input type=button>, and buttons with
overflow:scroll;

* css3/flexbox/position-absolute-child-with-contenteditable-expected.html: Added.
* css3/flexbox/position-absolute-child-with-contenteditable.html: Added.
Test flex boxes with hasLineIfEmpty()=true and absolute positioned
children. Uses contenteditable=true to get that effect.

* platform/chromium-linux/css2.1/20110323/replaced-elements-001-expected.png:
* platform/chromium-linux/css2.1/20110323/replaced-elements-001-expected.txt:
* platform/chromium-linux/svg/custom/foreign-object-skew-expected.png:
* platform/chromium-linux/svg/custom/foreign-object-skew-expected.txt:
* platform/chromium-linux/tables/mozilla/bugs/bug92647-2-expected.png:
* platform/chromium-linux/tables/mozilla/bugs/bug92647-2-expected.txt:
Regenerate test cases that use <input type=button>.

* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/TestExpectations:
* platform/win/TestExpectations:
Mark tests for rebaselining.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@144096 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/flexbox/button-expected.png [new file with mode: 0644]
LayoutTests/css3/flexbox/button-expected.txt [new file with mode: 0644]
LayoutTests/css3/flexbox/button.html [new file with mode: 0644]
LayoutTests/css3/flexbox/position-absolute-child-with-contenteditable-expected.html [new file with mode: 0644]
LayoutTests/css3/flexbox/position-absolute-child-with-contenteditable.html [new file with mode: 0644]
LayoutTests/platform/chromium-linux/css2.1/20110323/replaced-elements-001-expected.png
LayoutTests/platform/chromium-linux/css2.1/20110323/replaced-elements-001-expected.txt
LayoutTests/platform/chromium-linux/svg/custom/foreign-object-skew-expected.png
LayoutTests/platform/chromium-linux/svg/custom/foreign-object-skew-expected.txt
LayoutTests/platform/chromium-linux/tables/mozilla/bugs/bug92647-2-expected.png
LayoutTests/platform/chromium-linux/tables/mozilla/bugs/bug92647-2-expected.txt
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/qt/TestExpectations
LayoutTests/platform/win/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderButton.h
Source/WebCore/rendering/RenderFlexibleBox.cpp