New issue
Advanced search Search tips

Issue 721196 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac , Fuchsia
Pri: 2
Type: Bug-Regression



Sign in to add a comment

SVG external <use> references fail inside another <use> element's shadow DOM

Reported by amelia.b...@gmail.com, May 11 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36

Example URL:
https://codepen.io/AmeliaBR/pen/KmopGy?editors=1000

Steps to reproduce the problem:
1. Create an SVG sprite file (content for re-use).
2. On another file hosted on the same domain, create <use> references to shapes or symbols from the first file.
3. In the second file, use additional <use> elements to re-use content that includes the external <use> references.

What is the expected behavior?
The nested use references should be followed (meaning, the content should be cloned), unless there are security restrictions preventing access to the external file at all.

What went wrong?
In Chrome, the external <use> references are not rendered when they are part of another <use> element's shadow tree.

(Nested <use> references in the same file are rendered no problem. And direct references to the external file are rendered no problem, so long as both files are on the same domain.)

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 58.0.3029.96  Channel: n/a
OS Version: 10.0
Flash Version: Shockwave Flash 25.0 r0

Works in Firefox, Safari, and MS Edge.

I haven't tested whether or not Chrome even tries to fetch the external file if the only references to it are indirect.  (The test file uses both direct and indirect references.)

The uploaded files match the ones used in the embed in the CodePen.  The comments in the symbol file are related to a separate bug (#721167).
 
Chrome-bug-external-use-nested.svg
1.5 KB Download
Chrome-bug-external-use-symbol.svg
1.4 KB Download
PS
Not in that test case, but an external <use> reference to content that itself contains nested <use> references (in the same file) is A-OK.

I haven't tried an external reference to one file that references an additional file.

I'm guessing the problem is that URLs are not being correctly resolved for elements in the Shadow DOM.  Probably related to #721167 in that sense.

Comment 2 by f...@opera.com, May 11 2017

Components: -Blink Blink>SVG
Labels: -OS-Windows
Status: Available (was: Unconfirmed)

Comment 3 by f...@opera.com, May 12 2017

A comment/note on the testcase in passing after having looked at it... There's one (not unlikely) failure mode that I believe could go unnoticed, by the same 'id's (and with equivalent [visual] content) existing both in the local and external resources. (So resolving against the wrong document could, I believe, go unnoticed.)

Comment 4 by f...@opera.com, May 12 2017

Labels: -Type-Bug -Pri-2 Pri-1 Type-Bug-Regression
Labels: ReleaseBlock-Stable BugSource-User PaintTeamTriaged-20170511 M-59 OS-Android OS-Chrome OS-Fuchsia OS-Linux OS-Mac OS-Windows
What did this regress from? i.e. when was it working?

Is M-59 stable too aggressive for a fix? That would require merges once fixed. An alternative is M-60 Beta blocker.

Comment 6 by f...@opera.com, May 12 2017

Owner: f...@opera.com
Status: Started (was: Available)
I think this regression may be old (the assessment was based on the shape of the fix and the fact that it's reported to work in WebKit.) I would suspect c427062580ade2dde463ff0c51f33717099e6c9c, which is >1y old. If that is the case, then M-59 might be too aggressive. The fix is fairly simple (although not the oneliner I initially hoped.)

Comment 8 by f...@opera.com, May 15 2017

Labels: -Pri-1 Pri-2
Status: Fixed (was: Started)
(Dropping pri again because of the guestimated age.)
Labels: Merge-TBD
[Auto-generated comment by a script] We noticed that this issue is targeted for M-59; it appears the fix may have landed after branch point, meaning a merge might be required. Please confirm if a merge is required here - if so add Merge-Request-59 label, otherwise remove Merge-TBD label. Thanks.

Comment 10 by f...@opera.com, May 16 2017

Labels: -Merge-TBD -ReleaseBlock-Stable -M-59 ReleaseBlock-Beta M-60

Sign in to add a comment