Skip to content

[css-display] Use "computes to" instead of "behaves as" for display: contents on unusual elements. #2755

Closed
@emilio

Description

@emilio

https://drafts.csswg.org/css-display/#unbox says:

display: contents behaves as display: none.

Which means that the computed value of display should still be contents. This adds unnecessary complexity, and this is not how all engines implementing this section right work.

In particular, it requires a mapping from element to "is really display contents", or something of the sort. Firefox used to have that, but it caused a lot of performance issues for no gain, so I removed it in https://bugzilla.mozilla.org/show_bug.cgi?id=1303605.

(Note that I removed that mapping earlier without realizing the correctness issue it introduced, https://bugzilla.mozilla.org/show_bug.cgi?id=1453702, which I fixed computing to none instead of contents, which also aligns with Blink and WebKit).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions