[Webkit-unassigned] [Bug 18080] wrong layout as style overflow:hidden doesn't affect webkit

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Oct 19 21:40:06 PDT 2011


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


Tab Atkins <tabatkins at google.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
                 CC|                            |tabatkins at google.com
     Ever Confirmed|0                           |1




--- Comment #3 from Tab Atkins <tabatkins at google.com>  2011-10-19 21:40:06 PST ---
Yup, we're wrong here.  We're allowing margins to collapse through a BFC established with "overflow:hidden", which is a violation of the spec.

Here's a test case:

<!DOCTYPE html>
<div id=error></div>
<div id=a>
  <div id=should-be-bfc></div>
  <div id=b></div>
</div>
<style>
#a {
  height: 40px;
  margin-top: 20px;
}

#b {
  height: 20px;
  margin-top: 20px;
  background: green;
}

#should-be-bfc {
  overflow: hidden;
}

#error {
  height: 20px;
  width: 100%;
  background: red;
  position: absolute;
  top: 40px;
  z-index: -1;
}

body { margin: 0; }
</style>

If you change the "overflow:hidden" to "display:table" (another way to establish a BFC), you see the correct behavior (the red is hidden, because the green block is pushed further down by its margins).

-- 
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