[Webkit-unassigned] [Bug 197162] New: margin-top is ignored on elements with zero-height (and clear set) if they appear after floating elements
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Apr 22 09:47:48 PDT 2019
https://bugs.webkit.org/show_bug.cgi?id=197162
Bug ID: 197162
Summary: margin-top is ignored on elements with zero-height
(and clear set) if they appear after floating elements
Product: WebKit
Version: Safari 12
Hardware: Macintosh
OS: macOS 10.14
Status: NEW
Severity: Normal
Priority: P2
Component: Layout and Rendering
Assignee: webkit-unassigned at lists.webkit.org
Reporter: bya at 180g.co
CC: bfulgham at webkit.org, simon.fraser at apple.com,
zalan at apple.com
Created attachment 367944
--> https://bugs.webkit.org/attachment.cgi?id=367944&action=review
The html that exhibits the bug
If you have elements that have a height of 0 but with margin-top and clear specified, then the margin-top will be ignored for all elements that appear after a floating element. It's worth reiterating that this happens whenever a zero-height element appears – even if one appears quite a bit later in the page, and far away from a floating element.
I've included a simple html file that illustrates this behavior. As attached, the file includes a "spacer" div with "clear: both" specified. In the html, the spacer appears between each paragraph. When rendered in Safari, the spacer appears between each paragraph before the floating element, but completely disappears after. Though I've reported that this bug is in Safari 12, it also manifests in Safari Technology Preview.
In Chrome, the page renders as we'd expect (space appears between each paragraph, always).
If you comment out the "clear:both" then the space between the paragraphs appears in Safari. That means we lose the clear behavior, of course.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190422/fd793fde/attachment.html>
More information about the webkit-unassigned
mailing list