W3C home > Mailing lists > Public > www-style@w3.org > June 2015

[css-containment] "contain:layout" mixed with "display:inline" and block-in-inline

From: Daniel Holbert <dholbert@mozilla.com>
Date: Tue, 9 Jun 2015 13:34:42 -0700
To: www-style@w3.org
Message-ID: <55774DE2.90606@mozilla.com>
What's supposed to happen if I have content like:

  <span style="display:inline;contain: layout">
    aaa
    <div style="display:block">bbb</div>
    ccc
  </span>


In particular: should there be a block-in-inline split, to pull the
<div>'s box out of its inline-level parent element?

(and if not: does that mean we end up with a block whose actual box-tree
parent is "display:inline"?  Wouldn't that break CSS's assumptions about
block-level boxes having block-level parents?)

The spec text about layout containment is:
http://dev.w3.org/csswg/css-containment/#layout-containment

Quoting:
  # 1. When laying out the containing element,
  # it must be treated as having no contents.

(This sounds like no split should happen, because we ignore the div when
layout out the span.)

...and:
 # 2. The element must be a formatting context.

I don't know what this actually is trying to say. At first I thought it
might mean the "display:inline" would end up being block-inside or
something, but then I rediscovered that there is such a thing as an
"inline formatting context". So I don't think (2) really does anything
special for this case.

Perhaps we need "contain" to blockify the display value? (similar to
floats, abspos stuff, and flex/grid-item)

Thanks,
~Daniel
Received on Tuesday, 9 June 2015 20:35:14 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:54 UTC