- Revision
- 149407
- Author
- [email protected]
- Date
- 2013-04-30 15:39:53 -0700 (Tue, 30 Apr 2013)
Log Message
<button> ignores margin-bottom.
https://bugs.webkit.org/show_bug.cgi?id=114940
Reviewed by Beth Dakin.
Source/WebCore:
Make sure that the inner block inside the <button> (flexbox) acts like it
establishes a block formatting context, i.e., it should refuse to collapse
its margins with its children. This causes margins to stay inside the <button>
and be honored, adding to the button's overall height.
Basically we have to remove the restriction that anonymous blocks can't be
BFCs on the bottom margin.
Added fast/forms/content-with-margins-inside-button.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::handleAfterSideOfBlock):
LayoutTests:
* fast/forms/content-with-margins-inside-button-expected.html: Added.
* fast/forms/content-with-margins-inside-button.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (149406 => 149407)
--- trunk/LayoutTests/ChangeLog 2013-04-30 22:29:22 UTC (rev 149406)
+++ trunk/LayoutTests/ChangeLog 2013-04-30 22:39:53 UTC (rev 149407)
@@ -1,3 +1,13 @@
+2013-04-30 David Hyatt <[email protected]>
+
+ <button> ignores margin-bottom.
+ https://bugs.webkit.org/show_bug.cgi?id=114940
+
+ Reviewed by Beth Dakin.
+
+ * fast/forms/content-with-margins-inside-button-expected.html: Added.
+ * fast/forms/content-with-margins-inside-button.html: Added.
+
2013-04-30 Oliver Hunt <[email protected]>
JSC Stack walking logic craches in the face of inlined functions triggering VM re-entry
Modified: trunk/LayoutTests/fast/block/margin-collapse/block-inside-inline/025.html (149406 => 149407)
--- trunk/LayoutTests/fast/block/margin-collapse/block-inside-inline/025.html 2013-04-30 22:29:22 UTC (rev 149406)
+++ trunk/LayoutTests/fast/block/margin-collapse/block-inside-inline/025.html 2013-04-30 22:39:53 UTC (rev 149407)
@@ -24,8 +24,8 @@
<td class="test">
<div class="container">
<div class="float"> </div>
- <span><div class="clear"> </div></span>
- <span><div class="block"> </div></span>
+ <span><div class="clear"> </div>
+ <div class="block"> </div></span>
</div>
</td>
<td class="control">
Added: trunk/LayoutTests/fast/forms/content-with-margins-inside-button-expected.html (0 => 149407)
--- trunk/LayoutTests/fast/forms/content-with-margins-inside-button-expected.html (rev 0)
+++ trunk/LayoutTests/fast/forms/content-with-margins-inside-button-expected.html 2013-04-30 22:39:53 UTC (rev 149407)
@@ -0,0 +1,12 @@
+<style>
+ .inner {
+ width:100px;
+ border: 1px solid;
+ margin-top: 100px;
+ margin-bottom: 100px;
+ }
+
+ .outer { text-align:center; float: left; background-color: #cccccc; border:1px solid black; padding:0; font-family: Times; font-size:16px }
+</style>
+
+<div class="outer"><div class="inner">Content</div></button>
\ No newline at end of file
Added: trunk/LayoutTests/fast/forms/content-with-margins-inside-button.html (0 => 149407)
--- trunk/LayoutTests/fast/forms/content-with-margins-inside-button.html (rev 0)
+++ trunk/LayoutTests/fast/forms/content-with-margins-inside-button.html 2013-04-30 22:39:53 UTC (rev 149407)
@@ -0,0 +1,12 @@
+<style>
+ div {
+ width:100px;
+ border: 1px solid;
+ margin-top: 100px;
+ margin-bottom: 100px;
+ }
+
+ button { float:left; margin:0; background-color: #cccccc; border:1px solid black; padding:0; font-family: Times; font-size:16px }
+</style>
+
+<button><div>Content</div></button>
\ No newline at end of file
Modified: trunk/LayoutTests/platform/mac/fast/block/margin-collapse/block-inside-inline/025-expected.txt (149406 => 149407)
--- trunk/LayoutTests/platform/mac/fast/block/margin-collapse/block-inside-inline/025-expected.txt 2013-04-30 22:29:22 UTC (rev 149406)
+++ trunk/LayoutTests/platform/mac/fast/block/margin-collapse/block-inside-inline/025-expected.txt 2013-04-30 22:39:53 UTC (rev 149407)
@@ -14,14 +14,9 @@
RenderBlock (anonymous) at (0,0) size 128x0
RenderBlock (floating) {DIV} at (0,0) size 64x64 [bgcolor=#00FFFF]
RenderInline {SPAN} at (0,0) size 0x0
- RenderBlock (anonymous) at (0,0) size 128x48
+ RenderBlock (anonymous) at (0,0) size 128x128
RenderBlock {DIV} at (0,48) size 128x0 [bgcolor=#FF0000]
- RenderBlock (anonymous) at (0,48) size 128x0
- RenderInline {SPAN} at (0,0) size 0x0
- RenderText {#text} at (0,0) size 0x0
- RenderInline {SPAN} at (0,0) size 0x0
- RenderBlock (anonymous) at (0,64) size 128x64
- RenderBlock {DIV} at (0,0) size 128x64 [border: (32px solid #FFFF00)]
+ RenderBlock {DIV} at (0,64) size 128x64 [border: (32px solid #FFFF00)]
RenderBlock (anonymous) at (0,128) size 128x0
RenderInline {SPAN} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
Modified: trunk/Source/WebCore/ChangeLog (149406 => 149407)
--- trunk/Source/WebCore/ChangeLog 2013-04-30 22:29:22 UTC (rev 149406)
+++ trunk/Source/WebCore/ChangeLog 2013-04-30 22:39:53 UTC (rev 149407)
@@ -1,3 +1,23 @@
+2013-04-30 David Hyatt <[email protected]>
+
+ <button> ignores margin-bottom.
+ https://bugs.webkit.org/show_bug.cgi?id=114940
+
+ Reviewed by Beth Dakin.
+
+ Make sure that the inner block inside the <button> (flexbox) acts like it
+ establishes a block formatting context, i.e., it should refuse to collapse
+ its margins with its children. This causes margins to stay inside the <button>
+ and be honored, adding to the button's overall height.
+
+ Basically we have to remove the restriction that anonymous blocks can't be
+ BFCs on the bottom margin.
+
+ Added fast/forms/content-with-margins-inside-button.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::handleAfterSideOfBlock):
+
2013-04-30 Andrei Bucur <[email protected]>
Cleanup HTMLOListElement<->RenderListItem bridge
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (149406 => 149407)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2013-04-30 22:29:22 UTC (rev 149406)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2013-04-30 22:39:53 UTC (rev 149407)
@@ -2397,10 +2397,7 @@
marginInfo.setAtAfterSideOfBlock(true);
// If we can't collapse with children then go ahead and add in the bottom margin.
- // Don't do this for ordinary anonymous blocks as only the enclosing box should add in
- // its margin.
if (!marginInfo.discardMargin() && (!marginInfo.canCollapseWithMarginAfter() && !marginInfo.canCollapseWithMarginBefore()
- && (!isAnonymousBlock() || isAnonymousColumnsBlock() || isAnonymousColumnSpanBlock())
&& (!document()->inQuirksMode() || !marginInfo.quirkContainer() || !marginInfo.hasMarginAfterQuirk())))
setLogicalHeight(logicalHeight() + marginInfo.margin());