Skip to content

[css-display] [css-text-decor] Propagation of text-decoration with display:contents #1136

Closed
@Loirooriol

Description

@Loirooriol

From CSS Text Decoration,

the decorations are propagated to all in-flow children.

From CSS Display, display: contents means

The element itself does not generate any boxes, but its children and pseudo-elements still generate boxes as normal.

Then, if a decoration is specified in an element which does not generate boxes, does the decoration propagate to the descendants which generate boxes?

display: contents does not affect inheritance, but text decorations are special because they propagate using a mechanism different than inheritance. I'm not sure if it is an element-tree thing, and thus the decoration should still propagate, or if it's a box-tree thing, and thus it shouldn't.

Example: https://jsfiddle.net/203oz4jr/

<div>Foo</div>
div {
  display: contents;
  text-decoration: underline;
}

Should Foo be underlined? It's underlined on Chrome, but not on Firefox.

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