Skip to content
Permalink
Browse files

[LayoutNG] Don't add zero-width floats to the exclusion space.

The only thing such floats should affect is the block position of
subsequent floats (float rule §5 [1] and clearance). They should not
affect the inline position or inline size of subsequent floats or new
formatting contexts.

The spec isn't actually clear here, although the browsers agree on the
above. Submitted w3c/csswg-drafts#2312

[1] https://www.w3.org/TR/CSS22/visuren.html#float-position

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Ia9e724c8a58fcb017f86f26bdf90394f09414f4e
Reviewed-on: https://chromium-review.googlesource.com/919065
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537274}
  • Loading branch information...
mstensho authored and chromium-wpt-export-bot committed Feb 16, 2018
1 parent e7607da commit ae06fa4ce5d170f7f34e979b014315e318344ec4
Showing with 12 additions and 0 deletions.
  1. +12 −0 css/CSS2/floats/zero-width-floats.html
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<title>Zero width floats</title>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://www.w3.org/TR/CSS22/visudet.html#float-width" title="10.3.5 Floating, non-replaced elements">
<link rel="match" href="../../reference/ref-filled-green-200px-square.html">
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div style="margin-left:50px; width:100px;">
<div style="float:left; width:0; height:50px;"></div>
<div style="float:right; clear:left; width:0; height:150px;"></div>
<div style="overflow:hidden; margin:0 -50px; height:100px; background:green;"></div>
</div>
<div style="position:relative; top:-100px; overflow:hidden; clear:both; width:200px; height:100px; background:green;"></div>

0 comments on commit ae06fa4

Please sign in to comment.
You can’t perform that action at this time.