wpt / css / CSS2 / floats / float-after-block-with-collapsed-margin-inside-inline.html

Status: PASS | Duration: 6ms | Subtests: 1/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi

/css/CSS2/floats/float-after-block-with-collapsed-margin-inside-inline.html

<!DOCTYPE html>
<title>CSS Test: A float after a block which collapses its top margin with its grandparent, where the parent is an inline box</title>
<link rel="author" href="mailto:obrufau@igalia.com" title="Oriol Brufau">
<link rel="help" href="https://www.w3.org/TR/CSS22/visuren.html#floats">
<link rel="help" href="https://www.w3.org/TR/CSS22/box.html#collapsing-margins">
<link rel="help" href="https://www.w3.org/TR/CSS22/visuren.html#anonymous-block-level">
<link rel="help" href="https://www.w3.org/TR/CSS22/visuren.html#inline-formatting">
<link rel="help" href="https://github.com/servo/servo/issues/41734">
<link rel="match" href="../../reference/ref-filled-green-200px-square.html">

<style>
span > div {
  width: 200px;
  height: 100px;
  background: green;
}
</style>

<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>

<div style="overflow: hidden">
  <!-- This is just to avoid collapsing margins with the <p>. -->
</div>

<div style="width: 200px; height: 200px; margin-top: -100px; background: red">
  <span>
    <div style="margin-top: 100px"></div>
    <div style="float: left"></div>
  </span>
</div>

/css/reference/ref-filled-green-200px-square.html

<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Reftest Reference</title>
<link rel="author" title="Javier Fernandez Garcia-Boente" href="jfernandez@igalia.com" />
<style>
div {
  background-color: green;
  height: 200px;
  width: 200px;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div></div>