Skip to content

[css-display] should display:contents on SVG textPath compute to none? #3302

Closed
@heycam

Description

@heycam

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

I found #2118 which resulted in display: contents being allowed on <textPath>.

In the note, the rationale for computing display:contents to none for particular SVG elements is explained as preventing display:contents from working on elements that change the "context" for their children. But what should happen with:

<text>
  <textPath style="display: contents">
    <textPath>should I render?</textPath>
  </textPath>
</text>

Normally, a <textPath> that is not a direct child of a <text>, ignoring <a>, should not render (I believe -- filed w3c/svgwg#580 to clarify that).

Similarly:

<text>
  <tspan style="display: contents">
    <textPath>should I render?</textPath>
  </tspan>
</text>

Here, <tspan> does affect the context for its children, since it causes <textPath>s to no longer work. But does that mean we should really make display: contents compute to none for <tspan> too? That seems a bit restrictive.

/cc @emilio @lilles @AmeliaBR

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