Bug 114940

Summary: <button> ignores child element's margin-bottom
Product: WebKit Reporter: zalan <zalan>
Component: Layout and RenderingAssignee: Dave Hyatt <hyatt>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, commit-queue, esprehn+autocc, hyatt, ojan, simon.fraser
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
test reduction
none
Patch
none
Patch
bdakin: review+
Patch
bdakin: review+
Patch bdakin: review+

zalan
Reported 2013-04-22 01:51:02 PDT
Created attachment 199004 [details] test reduction in the following code: <style> div { width:100px; border: 1px solid; margin-top: 100px; margin-bottom: 100px; } </style> <button><div></div></button> <div>'s margin-bottom is ignored and the button is rendered as if margin-bottom was 0px. We create a very simple subtree for <button> as follows: RenderButton 0x7fd81a033cb8 BUTTON RenderBlock (anonymous) 0x7fd81a051038 RenderBlock 0x7fd81a050e08 DIV http://trac.webkit.org/changeset/143643 changed RenderButton's parent from RenderDeprecatedFlexibleBox to RenderFlexibleBox. Before r143643, both top and bottom margins were ignored. After r143643, now that RenderButton is a flexbox (isFlexibleBox()), the margin collapse code at RenderBlock::collapseMargins() prevents the <div>'s margin to be collapsed and it gets added to the height of the anonymous box. Firefox, Opera and IE10 respect the div's margin-bottom.
Attachments
test reduction (188 bytes, text/html)
2013-04-22 01:51 PDT, zalan
no flags
Patch (1.39 KB, patch)
2013-04-30 12:23 PDT, Dave Hyatt
no flags
Patch (4.82 KB, patch)
2013-04-30 13:16 PDT, Dave Hyatt
bdakin: review+
Patch (3.99 KB, patch)
2013-04-30 13:46 PDT, Dave Hyatt
bdakin: review+
Patch (6.08 KB, patch)
2013-04-30 14:30 PDT, Dave Hyatt
bdakin: review+
zalan
Comment 1 2013-04-22 02:17:12 PDT
Dave Hyatt
Comment 2 2013-04-30 12:23:22 PDT
Dave Hyatt
Comment 3 2013-04-30 13:16:32 PDT
Dave Hyatt
Comment 4 2013-04-30 13:46:19 PDT
Dave Hyatt
Comment 5 2013-04-30 14:16:07 PDT
We start failing fast/block/margin-collapse/block-inside-inline/025.html with this change, so let me study it and see how to fix it.
Dave Hyatt
Comment 6 2013-04-30 14:30:45 PDT
Dave Hyatt
Comment 7 2013-04-30 15:39:18 PDT
Fixed in r149407.
Note You need to log in before you can comment on or make changes to this bug.