Closed Bug 1185140 Opened 8 years ago Closed 7 years ago

Change handling of internal table types inside of a flex container


(Core :: Layout, defect)

Not set



Tracking Status
firefox42 --- affected
firefox47 --- fixed


(Reporter: dholbert, Assigned: MatsPalmgren_bugz)


(Blocks 2 open bugs)



(3 files)

Quoting :
The spec currently requires that we do box fixup before determining
flex items:
This was discussed originally in this thread:

Chrome doesn't follow the spec in this case--it turns table cells into
flex items. Which, as I had pointed out [2], has the nice ability to
create a fallback rendering. The argument for not changing it was that
nobody cares. [3]

However, at least some people do care: see e.g. slide 39, which despite
the fact that it would result in layouts that only work properly in
Chrome, uses this technique:

Should we change the spec to make internal table display types just
turn themselves into flex items, instead of triggering anonymous box



If the CSSWG ends up resolving to change this, I *think* all we'd need to do is remove the opt-out for the various table display types here:
The CSSWG did indeed resolve to change this.
Quoting minutes from IRC at :
# [11:07] <dael> fantasai: Last one, if you have a flex container and you put two table cells in it, they won't become flex items independantly. They'll wrap in an anon table and that will be flex. Chrome has impl so that each item is flex.
# [11:07] <dael> dbaron: They do anon box after?
# [11:08] <dael> fantasai: Not at all.
# [11:08] <dael> dbaron: So it turns the table cells into blocks.
# [11:17] <dael> RESOLVED: Just blockify the children of flex and grid containers. Don't do anon box fixup
I can take a look at this since the code is shared with Grid,
and the Grid spec (now) has the exact same note:
Assignee: nobody → mats
This code intentionally prevents blockification of these display types.
So simply removing that should work.
Attachment #8726056 - Flags: review?(dholbert)
I wrote fairly exhaustive test for Grid for various display types and it
seems to work fine.
I'm marking a few flexbox tests as failing for now - I'll file a follow-up bug
on fixing these.  It's probably better if you take that one.
Comment on attachment 8726056 [details] [diff] [review]
[css-grid][flexbox] Make grid/flex item blockification happen before creating table pseudos, per the latest specs.

Review of attachment 8726056 [details] [diff] [review]:

Looks good, thanks!

I expect this will cause some flexbox tests (which test for this removed behavior) to fail -- particularly these ones from :

Those tests will need some tweaking/simplifying as part of this patch. Unless you're already making those tweaks, I'll aim to take care of that during the next ~day, and I'll post a "part 2" patch here with those test-tweaks.
Attachment #8726056 - Flags: review?(dholbert) → review+
Depends on: 1253354
I filed a follow-up bug 1253354 to fix the Flexbox reftests.
Flags: in-testsuite+
Blocks: css-grid
You need to log in before you can comment on or make changes to this bug.