Skip to content

UA stylesheet seems to require title as display: none but browsers do display: inline #828

Open

Description

@domenic

https://svgwg.org/svg2-draft/styling.html#UAStyleSheet says

defs,
clipPath, mask, marker,
desc, title, metadata,
pattern, linearGradient, radialGradient,
script, style,
symbol {
  display: none !important;
}

(in the SVG namespace). However, browsers do not appear to respect this: http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=8961

At least one web developer seems to expect inline, not none: jsdom/jsdom#3064

It's possible I'm reading the spec wrong?

Activity

  1. heycam commented on Mar 1, 2021

    @heycam
    Contributor

    I think the intention of that rule in UA style sheet is to formalize the fact that these elements never render, and to make it clear that e.g. you can't add style="display: inline" to a defs and make it render. Despite this, there is the definition of never-rendered elements, which should also prevent them from rendering.

    There's precedent in the HTML spec for having UA style sheet rules make certain elements be display:none, though it looks like most of them aren't also !important, and would actually render if made display:inline.

  2. domenic commented on Mar 1, 2021

    @domenic
    Author

    Thanks, that makes sense. Do you know if any browsers in the working group plan to actually implement this UA stylesheet, or would it be best to remove it and just use never-rendered?

  3. heycam commented on Mar 1, 2021

    @heycam
    Contributor

    Since nobody implements that right now, and it's not super important, we should probably just remove it.

  4. karlcow commented on Mar 3, 2026

    @karlcow
    Member

    Gecko, WebKit do not have an SVG css.
    We can probably remove it from the spec.

    https://w3c.github.io/svgwg/svg2-draft/styling.html#UAStyleSheet

  5. karlcow commented on Mar 5, 2026

    @karlcow
    Member

    There is a SVG css
    https://searchfox.org/wubkat/source/Source/WebCore/css/svg.css
    which is different than this one. Thanks @nikolaszimmermann

  6. goldenboy777 commented on Mar 5, 2026

    @goldenboy777
    Contributor

    SVG css on the Chromium, which also doesnt contain the above style, anyway
    https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/css/svg.css?q=svg.css

  7. karlcow commented on Mar 5, 2026

    @karlcow
    Member
  8. karlcow commented on Mar 5, 2026

    @karlcow
    Member

    https://www.w3.org/2026/03/05-svg-minutes.html#c364
    RESOLUTION: Drop display: inline AND display: none from SVG 2 in the UA stylesheet as requirement

  9. dirkschulze commented on Mar 11, 2026

    @dirkschulze
    Contributor

    RESOLUTION: Drop display: inline AND display: none from SVG 2 in the UA stylesheet as requirement
    https://www.w3.org/2026/03/05-svg-minutes.html

  10. karlcow commented on Mar 11, 2026

    @karlcow
    Member

    @dirkschulze there is a PR for review for this one.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions