You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css-display] Explicitly note display:contents does not affect inheritance #1473
As only the box tree is affected, any semantics based on the document tree, such as selector-matching and event handling, are not affected.
This is kinda obvious: if display: contents can be set to an element via selector-matching, it shouldn't affect selector-matching. And event handling is entirely a DOM thingie.
CSS Cascade says inheritance follows the document tree but that's a blatant lie, e.g. ::first-line intercepts inheritance for some properties, and it is based on the box tree. Therefore, I don't think it's obvious at all that children elements of a display: contents still inherit from it.
So please note style inheritance is not affected by display: contents neither.
Inheritance following the document tree is not a "blatant lie" - it's correct for everything that lives in the tree; ::first-line and ::first-letter are bizarro exceptions that are explicitly called out, because they don't live in the tree properly (that is, if they're included, it's not guaranteed to be a tree anymore, just a DAG).
But we're fine with calling out inheritance in that sentence too.
Inheritance from ::first-line is a mess which eventually should be properly defined in CSS Cascade. Anyways, the edit clarifies the behavior of display: contents, so it's fine, thanks.
Activity
tabatkins commentedon Jul 5, 2017
Inheritance following the document tree is not a "blatant lie" - it's correct for everything that lives in the tree; ::first-line and ::first-letter are bizarro exceptions that are explicitly called out, because they don't live in the tree properly (that is, if they're included, it's not guaranteed to be a tree anymore, just a DAG).
But we're fine with calling out inheritance in that sentence too.
[css-display] 各種更新
Loirooriol commentedon Jul 15, 2017
Inheritance from
::first-lineis a mess which eventually should be properly defined in CSS Cascade. Anyways, the edit clarifies the behavior ofdisplay: contents, so it's fine, thanks.