Bug 217207 - CSS 'all' shorthand makes SVG child elements forget various HTML attributes
Summary: CSS 'all' shorthand makes SVG child elements forget various HTML attributes
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-10-02 03:19 PDT by bugmenot
Modified: 2020-10-04 02:41 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bugmenot 2020-10-02 03:19:41 PDT
Steps to reproduce:

    1. In HTML, create an inline SVG
    2. In CSS, select the children of the SVG
    3. Set the all shorthand to one of the global values (inherit, initial, unset)

Expected results:

The SVG children elements are visible and drawn as specified by their HTML attributes.

Actual results:

Multiple SVG children elements don't show up or are not drawn as specified by their HTML attributes (color, fill, stroke, etc.).

Reduced test case: https://jsfiddle.net/1c2t7o8n/
Comment 1 bugmenot 2020-10-02 03:24:09 PDT
Similar bugs in Chrome and Firefox. Additionally in Chrome, the <path> element is not visible.

https://bugs.chromium.org/p/chromium/issues/detail?id=1134543
https://bugzilla.mozilla.org/show_bug.cgi?id=1668770
Comment 2 Radar WebKit Bug Importer 2020-10-03 10:01:26 PDT
<rdar://problem/69916890>
Comment 3 bugmenot 2020-10-04 02:41:58 PDT
Works as intended as per SVG specification:

"The presentation attributes thus will participate in the CSS2 cascade as if they were replaced by corresponding CSS style rules placed at the start of the author style sheet with a specificity of zero. In general, this means that the presentation attributes have lower priority than other CSS style rules specified in author style sheets or ‘style’ attributes."

https://www.w3.org/TR/SVG11/styling.html