Title: [144096] trunk
Revision
144096
Author
[email protected]
Date
2013-02-26 13:08:52 -0800 (Tue, 26 Feb 2013)

Log Message

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 <[email protected]> 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.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (144095 => 144096)


--- trunk/LayoutTests/ChangeLog	2013-02-26 21:07:15 UTC (rev 144095)
+++ trunk/LayoutTests/ChangeLog	2013-02-26 21:08:52 UTC (rev 144096)
@@ -1,3 +1,37 @@
+2013-02-26  Christian Biesinger  <[email protected]>
+
+        Empty <button>s should collapse; empty <input type="button"> should not collapse
+        https://bugs.webkit.org/show_bug.cgi?id=110654
+
+        Reviewed by Ojan Vafai.
+
+        * 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.
+
 2013-02-26  Zan Dobersek  <[email protected]>
 
         Unreviewed gardening.

Added: trunk/LayoutTests/css3/flexbox/button-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/css3/flexbox/button-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/css3/flexbox/button-expected.txt (0 => 144096)


--- trunk/LayoutTests/css3/flexbox/button-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/css3/flexbox/button-expected.txt	2013-02-26 21:08:52 UTC (rev 144096)
@@ -0,0 +1,35 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x254
+  RenderBlock {HTML} at (0,0) size 800x254
+    RenderBody {BODY} at (8,8) size 784x238
+      RenderBlock (anonymous) at (0,0) size 784x40
+        RenderText {#text} at (0,0) size 755x39
+          text run at (0,0) width 379: "Test for empty buttons, which inherit from RenderFlexibleBox. "
+          text run at (379,0) width 376: "Empty <input> buttons should not collapse, which makes them"
+          text run at (0,20) width 431: "different from most flex boxes. Empty <button>s should collapse. Note "
+        RenderInline {A} at (0,0) size 74x19 [color=#0000EE]
+          RenderText {#text} at (431,20) size 74x19
+            text run at (431,20) width 74: "bug 110654"
+        RenderText {#text} at (505,20) size 4x19
+          text run at (505,20) width 4: "."
+      RenderBlock {HR} at (0,48) size 784x2 [border: (1px inset #000000)]
+      RenderBlock (anonymous) at (0,58) size 784x66
+        RenderText {#text} at (0,0) size 76x19
+          text run at (0,0) width 76: "Simple case."
+        RenderBR {BR} at (76,0) size 0x19
+        RenderButton {BUTTON} at (2,32) size 16x6 [bgcolor=#DDDDDD] [border: (2px outset #DDDDDD)]
+        RenderBR {BR} at (20,20) size 0x19
+        RenderButton {INPUT} at (2,42) size 16x22 [bgcolor=#DDDDDD] [border: (2px outset #DDDDDD)]
+        RenderBR {BR} at (20,46) size 0x19
+      RenderBlock {HR} at (0,132) size 784x2 [border: (1px inset #000000)]
+      RenderBlock (anonymous) at (0,142) size 784x96
+        RenderText {#text} at (0,0) size 739x19
+          text run at (0,0) width 739: "Empty <button> and <input type=button> with overflow: scroll;. The presence of the scrollbar should not shrink the button."
+        RenderBR {BR} at (739,0) size 0x19
+        RenderBR {BR} at (35,20) size 0x19
+        RenderBR {BR} at (35,61) size 0x19
+layer at (10,182) size 31x21 clip at (12,184) size 12x2
+  RenderButton {BUTTON} at (2,32) size 31x21 [bgcolor=#DDDDDD] [border: (2px outset #DDDDDD)]
+layer at (10,207) size 31x37 clip at (12,209) size 12x18
+  RenderButton {INPUT} at (2,57) size 31x37 [bgcolor=#DDDDDD] [border: (2px outset #DDDDDD)]

Added: trunk/LayoutTests/css3/flexbox/button.html (0 => 144096)


--- trunk/LayoutTests/css3/flexbox/button.html	                        (rev 0)
+++ trunk/LayoutTests/css3/flexbox/button.html	2013-02-26 21:08:52 UTC (rev 144096)
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="" rel="stylesheet">
+<style>
+    .scroll { overflow: scroll; }
+    .abspos { position: absolute; background-color: pink; }
+    .flexbox { background-color: lightgray; padding: 1px; }
+    .small { height: 3px; }
+</style>
+</head><body>
+Test for empty buttons, which inherit from RenderFlexibleBox.  Empty
+&lt;input&gt; buttons should not collapse, which makes them different from most
+flex boxes. Empty &lt;button&gt;s should collapse. Note <a
+href="" bug 110654</a>.
+<hr>
+Simple case.<br>
+<button></button><br>
+<input type="button"></input><br>
+<hr>
+Empty &lt;button&gt; and &lt;input type=button&gt; with overflow: scroll;.
+The presence of the scrollbar should not shrink the button.<br>
+<button class="scroll"></button><br>
+<input type="button" class="scroll"></input><br>

Added: trunk/LayoutTests/css3/flexbox/position-absolute-child-with-contenteditable-expected.html (0 => 144096)


--- trunk/LayoutTests/css3/flexbox/position-absolute-child-with-contenteditable-expected.html	                        (rev 0)
+++ trunk/LayoutTests/css3/flexbox/position-absolute-child-with-contenteditable-expected.html	2013-02-26 21:08:52 UTC (rev 144096)
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+    .abspos { position: absolute; background-color: pink; }
+    .gray { background-color: lightgray; padding: 1px; }
+    .small { height: 3px; }
+</style>
+</head><body>
+Absolutely positioned element as a child of a flexbox with hasLineIfEmpty()=true.
+Such a flex box should get a line instead of collapsing to just border+padding.
+In other words, the grey area should be (slightly) taller than the pink one.<br>
+<div class="gray" contenteditable="true"><div class="abspos">Content</div></div>
+<hr>
+...but if it does specify a height, we need to respect it.<br>
+<div class="small gray" contenteditable="true"><div class="abspos">Content</div></div>
+

Added: trunk/LayoutTests/css3/flexbox/position-absolute-child-with-contenteditable.html (0 => 144096)


--- trunk/LayoutTests/css3/flexbox/position-absolute-child-with-contenteditable.html	                        (rev 0)
+++ trunk/LayoutTests/css3/flexbox/position-absolute-child-with-contenteditable.html	2013-02-26 21:08:52 UTC (rev 144096)
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="" rel="stylesheet">
+<style>
+    .abspos { position: absolute; background-color: pink; }
+    .flexbox { background-color: lightgray; padding: 1px; }
+    .small { height: 3px; }
+</style>
+</head><body>
+Absolutely positioned element as a child of a flexbox with hasLineIfEmpty()=true.
+Such a flex box should get a line instead of collapsing to just border+padding.
+In other words, the grey area should be (slightly) taller than the pink one.<br>
+<div class="flexbox" contenteditable="true"><div class="abspos">Content</div></div>
+<hr>
+...but if it does specify a height, we need to respect it.<br>
+<div class="flexbox small" contenteditable="true"><div class="abspos">Content</div></div>
+

Modified: trunk/LayoutTests/platform/chromium/TestExpectations (144095 => 144096)


--- trunk/LayoutTests/platform/chromium/TestExpectations	2013-02-26 21:07:15 UTC (rev 144095)
+++ trunk/LayoutTests/platform/chromium/TestExpectations	2013-02-26 21:08:52 UTC (rev 144096)
@@ -4431,3 +4431,9 @@
 webkit.org/b/110876 html5lib/generated/run-tests9-data.html [ Timeout Pass ]
 webkit.org/b/110876 html5lib/generated/run-webkit01-data.html [ Timeout Pass ]
 
+# Need rebaseline
+webkit.org/b/110654 [ Mac Win ] css2.1/20110323/replaced-elements-001.htm [ Failure ]
+webkit.org/b/110654 [ Mac Win ] svg/custom/foreign-object-skew.svg [ Failure ]
+webkit.org/b/110654 [ Mac Win ] tables/mozilla/bugs/bug92647-2.html [ Failure ]
+# New test
+webkit.org/b/110654 [ Mac Win ] css3/flexbox/button.html [ Failure ]

Modified: trunk/LayoutTests/platform/chromium-linux/css2.1/20110323/replaced-elements-001-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/chromium-linux/css2.1/20110323/replaced-elements-001-expected.txt (144095 => 144096)


--- trunk/LayoutTests/platform/chromium-linux/css2.1/20110323/replaced-elements-001-expected.txt	2013-02-26 21:07:15 UTC (rev 144095)
+++ trunk/LayoutTests/platform/chromium-linux/css2.1/20110323/replaced-elements-001-expected.txt	2013-02-26 21:08:52 UTC (rev 144096)
@@ -1,19 +1,19 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
-layer at (0,0) size 800x140
-  RenderBlock {HTML} at (0,0) size 800x140
-    RenderBody {BODY} at (8,16) size 784x108
+layer at (0,0) size 800x172
+  RenderBlock {HTML} at (0,0) size 800x172
+    RenderBody {BODY} at (8,16) size 784x140
       RenderBlock {P} at (0,0) size 784x20
         RenderText {#text} at (0,0) size 569x19
           text run at (0,0) width 569: "Below, there should be 2 orange boxes horizontally centered within their respective green bars."
-      RenderBlock {DIV} at (16,36) size 752x28 [bgcolor=#008000]
+      RenderBlock {DIV} at (16,36) size 752x44 [bgcolor=#008000]
         RenderBlock (anonymous) at (0,0) size 752x20
           RenderText {#text} at (0,0) size 36x19
             text run at (0,0) width 36: "         "
-        RenderButton {INPUT} at (368,22) size 16x6 [bgcolor=#FFA500] [border: (2px outset #DDDDDD)]
-      RenderBlock {FORM} at (0,80) size 784x28
-        RenderBlock {DIV} at (16,0) size 752x28 [bgcolor=#008000]
+        RenderButton {INPUT} at (368,22) size 16x22 [bgcolor=#FFA500] [border: (2px outset #DDDDDD)]
+      RenderBlock {FORM} at (0,96) size 784x44
+        RenderBlock {DIV} at (16,0) size 752x44 [bgcolor=#008000]
           RenderBlock (anonymous) at (0,0) size 752x20
             RenderText {#text} at (0,0) size 36x19
               text run at (0,0) width 36: "         "
-          RenderButton {INPUT} at (368,22) size 16x6 [bgcolor=#FFA500] [border: (2px outset #DDDDDD)]
+          RenderButton {INPUT} at (368,22) size 16x22 [bgcolor=#FFA500] [border: (2px outset #DDDDDD)]

Modified: trunk/LayoutTests/platform/chromium-linux/svg/custom/foreign-object-skew-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/chromium-linux/svg/custom/foreign-object-skew-expected.txt (144095 => 144096)


--- trunk/LayoutTests/platform/chromium-linux/svg/custom/foreign-object-skew-expected.txt	2013-02-26 21:07:15 UTC (rev 144095)
+++ trunk/LayoutTests/platform/chromium-linux/svg/custom/foreign-object-skew-expected.txt	2013-02-26 21:08:52 UTC (rev 144096)
@@ -6,11 +6,11 @@
       RenderBlock {xhtml:div} at (0,0) size 580x20
         RenderText {#text} at (0,0) size 74x19
           text run at (0,0) width 74: "This is a test"
-      RenderBlock (anonymous) at (0,20) size 580x40
+      RenderBlock (anonymous) at (0,20) size 580x46
         RenderInline {xhtml:a} at (0,0) size 62x19 [color=#0000EE]
           RenderText {#text} at (0,0) size 62x19
             text run at (0,0) width 62: "and a link."
         RenderBR {xhtml:br} at (62,0) size 0x19
-        RenderButton {xhtml:input} at (2,32) size 16x6 [bgcolor=#DDDDDD] [border: (2px outset #DDDDDD)]
+        RenderButton {xhtml:input} at (2,22) size 16x22 [bgcolor=#DDDDDD] [border: (2px outset #DDDDDD)]
         RenderText {#text} at (0,0) size 0x0
     RenderSVGRect {rect} at (9,9) size 582x382 [stroke={[type=SOLID] [color=#008000]}] [x=10.00] [y=10.00] [width=580.00] [height=380.00]

Modified: trunk/LayoutTests/platform/chromium-linux/tables/mozilla/bugs/bug92647-2-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/chromium-linux/tables/mozilla/bugs/bug92647-2-expected.txt (144095 => 144096)


--- trunk/LayoutTests/platform/chromium-linux/tables/mozilla/bugs/bug92647-2-expected.txt	2013-02-26 21:07:15 UTC (rev 144095)
+++ trunk/LayoutTests/platform/chromium-linux/tables/mozilla/bugs/bug92647-2-expected.txt	2013-02-26 21:08:52 UTC (rev 144096)
@@ -3,14 +3,14 @@
 layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
-      RenderTable {TABLE} at (0,0) size 52x30 [border: (1px outset #808080)]
-        RenderTableSection {TBODY} at (1,1) size 50x28
-          RenderTableRow {TR} at (0,2) size 50x24
-            RenderTableCell {TD} at (2,2) size 46x24 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
-              RenderTable {TABLE} at (2,2) size 42x20 [border: (1px outset #808080)]
-                RenderTableSection {TBODY} at (1,1) size 40x18
-                  RenderTableRow {TR} at (0,2) size 40x14
-                    RenderTableCell {TD} at (2,7) size 4x4 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
-                    RenderTableCell {TD} at (8,2) size 24x14 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
-                      RenderButton {INPUT} at (4,4) size 16x6 [bgcolor=#DDDDDD] [border: (2px outset #DDDDDD)]
-                    RenderTableCell {TD} at (34,7) size 4x4 [border: (1px inset #808080)] [r=0 c=2 rs=1 cs=1]
+      RenderTable {TABLE} at (0,0) size 52x46 [border: (1px outset #808080)]
+        RenderTableSection {TBODY} at (1,1) size 50x44
+          RenderTableRow {TR} at (0,2) size 50x40
+            RenderTableCell {TD} at (2,2) size 46x40 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
+              RenderTable {TABLE} at (2,2) size 42x36 [border: (1px outset #808080)]
+                RenderTableSection {TBODY} at (1,1) size 40x34
+                  RenderTableRow {TR} at (0,2) size 40x30
+                    RenderTableCell {TD} at (2,15) size 4x4 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
+                    RenderTableCell {TD} at (8,2) size 24x30 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
+                      RenderButton {INPUT} at (4,4) size 16x22 [bgcolor=#DDDDDD] [border: (2px outset #DDDDDD)]
+                    RenderTableCell {TD} at (34,15) size 4x4 [border: (1px inset #808080)] [r=0 c=2 rs=1 cs=1]

Modified: trunk/LayoutTests/platform/efl/TestExpectations (144095 => 144096)


--- trunk/LayoutTests/platform/efl/TestExpectations	2013-02-26 21:07:15 UTC (rev 144095)
+++ trunk/LayoutTests/platform/efl/TestExpectations	2013-02-26 21:08:52 UTC (rev 144096)
@@ -1869,3 +1869,10 @@
 webkit.org/b/110694 html5lib/generated/run-domjs-unsafe-data.html [ Failure ]
 webkit.org/b/110694 html5lib/generated/run-pending-spec-changes-plain-text-unsafe-data.html [ Failure ]
 webkit.org/b/110694 html5lib/generated/run-plain-text-unsafe-data.html [ Failure ]
+
+# Need rebaseline
+webkit.org/b/110654 css2.1/20110323/replaced-elements-001.htm [ Failure ]
+webkit.org/b/110654 svg/custom/foreign-object-skew.svg [ Failure ]
+webkit.org/b/110654 tables/mozilla/bugs/bug92647-2.html [ Failure ]
+# New test
+webkit.org/b/110654 css3/flexbox/button.html [ Failure ]

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (144095 => 144096)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2013-02-26 21:07:15 UTC (rev 144095)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2013-02-26 21:08:52 UTC (rev 144096)
@@ -1413,6 +1413,13 @@
 webkit.org/b/110694 html5lib/generated/run-pending-spec-changes-plain-text-unsafe-data.html [ Failure ]
 webkit.org/b/110694 html5lib/generated/run-plain-text-unsafe-data.html [ Failure ]
 
+# Need rebaseline
+webkit.org/b/110654 css2.1/20110323/replaced-elements-001.htm [ Failure ]
+webkit.org/b/110654 svg/custom/foreign-object-skew.svg [ Failure ]
+webkit.org/b/110654 tables/mozilla/bugs/bug92647-2.html [ Failure ]
+# New test
+webkit.org/b/110654 css3/flexbox/button.html [ Failure ]
+
 #////////////////////////////////////////////////////////////////////////////////////////
 # End of Tests failing
 #////////////////////////////////////////////////////////////////////////////////////////

Modified: trunk/LayoutTests/platform/mac/TestExpectations (144095 => 144096)


--- trunk/LayoutTests/platform/mac/TestExpectations	2013-02-26 21:07:15 UTC (rev 144095)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2013-02-26 21:08:52 UTC (rev 144096)
@@ -1437,3 +1437,10 @@
 webkit.org/b/110554 http/tests/security/feed-urls-from-remote.html [ Failure ]
 webkit.org/b/110555 fast/canvas/canvas-currentPath.html [ Failure ]
 webkit.org/b/110555 fast/canvas/canvas-path-constructors.html [ Failure ]
+
+# Need rebaseline
+webkit.org/b/110654 css2.1/20110323/replaced-elements-001.htm [ Failure ]
+webkit.org/b/110654 svg/custom/foreign-object-skew.svg [ Failure ]
+webkit.org/b/110654 tables/mozilla/bugs/bug92647-2.html [ Failure ]
+# New test
+webkit.org/b/110654 css3/flexbox/button.html [ Failure ]

Modified: trunk/LayoutTests/platform/qt/TestExpectations (144095 => 144096)


--- trunk/LayoutTests/platform/qt/TestExpectations	2013-02-26 21:07:15 UTC (rev 144095)
+++ trunk/LayoutTests/platform/qt/TestExpectations	2013-02-26 21:08:52 UTC (rev 144096)
@@ -2673,3 +2673,10 @@
 
 # [Qt] newly added svg/as-background-image/svg-transformed-background.html fails
 webkit.org/b/110442 svg/as-background-image/svg-transformed-background.html [ Skip ]
+
+# Need rebaseline
+webkit.org/b/110654 css2.1/20110323/replaced-elements-001.htm [ Failure ]
+webkit.org/b/110654 svg/custom/foreign-object-skew.svg [ Failure ]
+webkit.org/b/110654 tables/mozilla/bugs/bug92647-2.html [ Failure ]
+# New test
+webkit.org/b/110654 css3/flexbox/button.html [ Failure ]

Modified: trunk/LayoutTests/platform/win/TestExpectations (144095 => 144096)


--- trunk/LayoutTests/platform/win/TestExpectations	2013-02-26 21:07:15 UTC (rev 144095)
+++ trunk/LayoutTests/platform/win/TestExpectations	2013-02-26 21:08:52 UTC (rev 144096)
@@ -2646,3 +2646,10 @@
 webkit.org/b/109994 fast/forms/select-baseline.html [ Failure ]
 webkit.org/b/109994 svg/custom/foreign-object-skew.svg [ Failure ]
 webkit.org/b/109994 tables/mozilla/bugs/bug92647-2.html [ Failure ]
+
+# Need rebaseline
+webkit.org/b/110654 css2.1/20110323/replaced-elements-001.htm [ Failure ]
+webkit.org/b/110654 svg/custom/foreign-object-skew.svg [ Failure ]
+webkit.org/b/110654 tables/mozilla/bugs/bug92647-2.html [ Failure ]
+# New test
+webkit.org/b/110654 css3/flexbox/button.html [ Failure ]

Modified: trunk/Source/WebCore/ChangeLog (144095 => 144096)


--- trunk/Source/WebCore/ChangeLog	2013-02-26 21:07:15 UTC (rev 144095)
+++ trunk/Source/WebCore/ChangeLog	2013-02-26 21:08:52 UTC (rev 144096)
@@ -1,3 +1,35 @@
+2013-02-26  Christian Biesinger  <[email protected]>
+
+        Empty <button>s should collapse; empty <input type="button"> should not collapse
+        https://bugs.webkit.org/show_bug.cgi?id=110654
+
+        Reviewed by Ojan Vafai.
+
+        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.
+
 2013-02-26  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r143941.

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (144095 => 144096)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2013-02-26 21:07:15 UTC (rev 144095)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2013-02-26 21:08:52 UTC (rev 144096)
@@ -1520,6 +1520,8 @@
     clearFloats();
 
     LayoutUnit previousHeight = logicalHeight();
+    // FIXME: should this start out as borderAndPaddingLogicalHeight() + scrollbarLogicalHeight(),
+    // for consistency with other render classes?
     setLogicalHeight(0);
 
     bool pageLogicalHeightChanged = false;

Modified: trunk/Source/WebCore/rendering/RenderButton.h (144095 => 144096)


--- trunk/Source/WebCore/rendering/RenderButton.h	2013-02-26 21:07:15 UTC (rev 144095)
+++ trunk/Source/WebCore/rendering/RenderButton.h	2013-02-26 21:08:52 UTC (rev 144096)
@@ -61,7 +61,7 @@
     virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
 
-    virtual bool hasLineIfEmpty() const { return true; }
+    virtual bool hasLineIfEmpty() const { return node() && node()->toInputElement(); }
 
     virtual bool requiresForcedStyleRecalcPropagation() const { return true; }
 

Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp (144095 => 144096)


--- trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2013-02-26 21:07:15 UTC (rev 144095)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2013-02-26 21:08:52 UTC (rev 144096)
@@ -308,7 +308,7 @@
         relayoutChildren = true;
 
     LayoutUnit previousHeight = logicalHeight();
-    setLogicalHeight(0);
+    setLogicalHeight(borderAndPaddingLogicalHeight() + scrollbarLogicalHeight());
 
     LayoutStateMaintainer statePusher(view(), this, locationOffset(), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
 
@@ -727,6 +727,17 @@
 
         layoutAndPlaceChildren(crossAxisOffset, orderedChildren, childSizes, availableFreeSpace, relayoutChildren, lineContexts);
     }
+    if (hasLineIfEmpty()) {
+        // Even if computeNextFlexLine returns true, the flexbox might not have
+        // a line because all our children might be out of flow positioned.
+        // Instead of just checking if we have a line, make sure the flexbox
+        // has at least a line's worth of height to cover this case.
+        LayoutUnit minHeight = borderAndPaddingLogicalHeight()
+            + lineHeight(true, isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes)
+            + scrollbarLogicalHeight();
+        if (height() < minHeight)
+            setLogicalHeight(minHeight);
+    }
 }
 
 LayoutUnit RenderFlexibleBox::autoMarginOffsetInMainAxis(const OrderedFlexItemList& children, LayoutUnit& availableFreeSpace)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to