Bug 16483 - Clarify why blocks inside of an inline [do|do not] get their own flexbox item
Summary: Clarify why blocks inside of an inline [do|do not] get their own flexbox item
Status: RESOLVED FIXED
Alias: None
Product: CSS
Classification: Unclassified
Component: Flexbox (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Tab Atkins Jr.
QA Contact: public-css-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-22 18:14 UTC by Daniel Holbert
Modified: 2012-04-17 17:22 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Holbert 2012-03-22 18:14:32 UTC
(I just mailed the list about this:
  http://lists.w3.org/Archives/Public/www-style/2012Mar/0528.html
but afterwards I realized it might've been better to file a bug, so I'm doing that as well. Apologies if this is overkill. :))

I believe the flexbox spec is currently inconsistent / unclear on handling
of situations with a block inside an inline, like "anonymous item 7.1" in
Example 2.

That example looks like this:
  <div style="display:flexbox">
    <span id="item7.1">
      text 7.2
      <div id="not-an-item7.3">block</div>
        text 7.4
    </span>
  </div>

The prose at the bottom of the example say that not-an-item7.3 doesn't
form its own flexbox item, because it's contained inside an inline
element.  (technically, the prose says not-an-item6.3 right now, but
that's a typo, which I emailed about separately)

However -- I think that prose disagrees with the normative spec text about
what makes a flexbox item: "boxes that satisfy one of the following
criteria... 1. Immediate block-level children of flexbox")[1].

Note that the normative text refers to _boxes_ there, not _elements_.  And
in the example above, the _box_ for "not-an-item7.3" IS an immediate child
of the flexbox, even if its element is not.

This is according to the inline/block interaction rules in CSS 2.1 section
9.2.1.1 [2]:
[[
"When an inline box contains an in-flow block-level box, the inline box
...[is] broken around the block-level box... The line boxes before the
break and after the break are enclosed in anonymous block boxes, and the
block-level box becomes a sibling of those anonymous boxes
]]

In other words: if we follow CSS2.1 on how blocks behave inside of an
inline, then the box for "not-an-item7.3" becomes an immediate child of
the flexbox, which means the Flexbox spec says it should get its own
flexbox item, contrary to what the example says.

I think this needs clarification in the flexbox spec.  Maybe we need to
use the element hierarchy instead of the box hierarchy for determining
flexbox item eligibility?  I'm not sure if that makes sense.

[1] http://dev.w3.org/csswg/css3-flexbox/#flex-items
[2] http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level