[Webkit-unassigned] [Bug 114940] New: <button> ignores child element's margin-bottom

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 22 01:52:43 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=114940

           Summary: <button> ignores child element's margin-bottom
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Layout and Rendering
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: zalan at apple.com
                CC: hyatt at apple.com, simon.fraser at apple.com


Created an attachment (id=199004)
 --> (https://bugs.webkit.org/attachment.cgi?id=199004&action=review)
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.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list