Bug 106100 - Nested CSS rules not applied to USE elements referring a DEFS element
Summary: Nested CSS rules not applied to USE elements referring a DEFS element
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-01-04 09:18 PST by Maros Urbanec
Modified: 2022-06-17 21:11 PDT (History)
7 users (show)

See Also:


Attachments
Safari 15.5 matches with Chrome but differs from Firefox (249.24 KB, image/png)
2022-06-17 15:20 PDT, Ahmad Saleem
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maros Urbanec 2013-01-04 09:18:39 PST
Following conditions need to be met:
1. have an SVG element nested in HTML document
2. in the SVG, have a DEFS element, containing any element with id and class
3. in the SVG, have an USE element referring to an element in DEFS
4. have a CSS rule targeting the class of the element in DEFS. CSS rule has to contain HTML parent of the element, such as "svg .myClass" or "body .myClass"

Result:
CSS rule is not applied.

JsFiddle capturing the use case:
http://jsfiddle.net/maros_urbanec/yNg8r/3/
- circle should be red

Once its HTML ancestor is removed from the CSS rule, the rule is applied correctly:
http://jsfiddle.net/maros_urbanec/yNg8r/4/
Comment 1 Ahmad Saleem 2022-06-17 15:20:35 PDT
Created attachment 460314 [details]
Safari 15.5 matches with Chrome but differs from Firefox

I am not able to reproduce this bug in Safari 15.5 on macOS 12.4 based on JSFiddle from Comment 01 (with "svg .myCircle" - CSS tag) and it shows expected result of "red circle". It matches with Chrome Canary 105 as shown in the attached screenshot but as seen, Firefox Nightly does not render it as "red" rather "black".

I am not sure on web-spec and which behavior is accurate but based on expected result, I am not able to reproduce this bug and this can be marked as "RESOLVED INVALID" or "RESOLVED CONFIGURATION CHANGED". In case, if Firefox behavior is ideal then it can be changed to "NEW".

If I am testing incorrectly, please retest accordingly. Thanks!
Comment 2 Radar WebKit Bug Importer 2022-06-17 15:21:08 PDT
<rdar://problem/95417526>
Comment 3 Ryosuke Niwa 2022-06-17 21:11:16 PDT
Yup, config changed.