Skip to content

[css-display][css-tables-3] Do table captions participate in BFC or TFC? #1189

Closed

Description

@Loirooriol

From CSS Display,

The element generates a principal table wrapper box containing an additionally-generated table box, and establishes a table formatting context.

It's not much clear if what establishes the TFC is the table wrapper box. The sentence sounds like it's the element, but I believe formatting contexts established in the box tree, not the element tree. So probably it's the table wrapper box or the table box.

CSS Tables 3 and CSS 2.1 are more clear:

The table wrapper box establishes a block formatting context.

I think this means that both the table box and the caption participate in a BFC.

However, CSS Display says

table-row-group, table-header-group, table-footer-group, table-row, table-cell, table-column-group, table-column, table-caption
The element is an internal table element, and participates in a table layout context.

Which is it, does the caption participate in a BFC or in a TFC? What establishes the TFC, the table wrapper box or the table box?

Since captions can't exist outside a table wrapper box (they generate an anonymous one if necessary), I think they should participate in a TFC, which would be established by the table wrapper box.

Activity

  1. FremyCompany commented on Apr 16, 2017

    @FremyCompany
    Contributor

    You can't get a float to invade captions in any browser as far as I can remember. So that would be the table wrapper box.

    But then again I still do not believe this wrapper-box mumbo-jumbo has any actual usefulness and the concept should just be removed. That would make both sentences actually valid in this case. The table wrapper box would be equal to the table box and would be a formatting context, and table-caption would participate in that formatting context.

  2. Loirooriol commented on Apr 16, 2017

    @Loirooriol
    ContributorAuthor

    If you can rewrite the CSS Table spec without the table wrapper box oddity, it would be great. Thanks!

  3. fantasai commented on Apr 18, 2017

    @fantasai
    Collaborator

    This is a bug in Display.

  4. FremyCompany commented on Apr 18, 2017

    @FremyCompany
    Contributor

    Only if you commit to the existence of the table wrapper box. No browser behaves like if there was one in this case. And it is not the only example, there is an almost infinite stream of those. The concept is just buggy.

    But, to be fair, in the absence of a resolution to remove the concept, the bug is in CSS Display and in all browsers.

  5. added
    Closed Accepted as Obvious Bugfix
    on May 15, 2017
  6. fantasai commented on May 15, 2017

    @fantasai
    Collaborator

    We've fixed the errors in Display to be consistent with the model in CSS2.1. Please let us know if there is any remaining incorrectness.

  7. Loirooriol commented on May 15, 2017

    @Loirooriol
    ContributorAuthor

    Yes, now it's consistent with CSS 2.1 and CSS tables. But if Fremy is going to change this in CSS tables because it's not consistent with implementations, maybe you could add a note warning about the possible change?

  8. tabatkins commented on May 15, 2017

    @tabatkins
    Member

    When/if he convinces the group this is possible and desirable, we'll change it. In the meantime, @fantasai and I are pretty against it. ^_^

  9. added
    Commenter Satisfied
    and removed on May 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Closed Accepted as Obvious BugfixCommenter SatisfiedTracked in DoCcss-display-3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions