New issue
Advanced search Search tips
Starred by 1 user

Issue metadata

Status: Available
Owner: ----
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Compat

Sign in to add a comment

Issue 806289: Blink incorrectly disregards "width" and "height" attributes on SVG <symbol> element

Reported by, Jan 26 2018 Project Member

Issue description

Chrome Version: (copy from chrome://version)
OS: (e.g. Win7, OSX 10.9.5, etc...)

What steps will reproduce the problem?
(1) Visit

What is the expected result?
 Small purple rectangle and square. (Each 20px tall.)

What happens instead?
 The square is huge.

Please use labels and text to provide additional information.
Per SVG2, the square (really, the <use>-generated <svg> element that gets filled with a 100%-sized purple rect) should take its width/height attributes from the <symbol> element that it cloned.  That <symbol> element has width=20 height=20, so its <svg> clone should as well.

The rectangle (the first purple thing in the testcase) works correctly because it explicitly overrides the width and height by setting those attributes on the use element itself. But if they're unset on <use>, then we should use the ones from the <symbol>.

Blink's behavior here would be correct per SVG 1.1:

...but it's incorrect per SVG 2:

The specific commit in the SVG 2 spec repo is here:
That commit added x,y,width,height to <symbol>, and added prose saying they should have the same effect on clones-of-<symbol> as they have on an <svg> element.

Firefox gives "Expected Results" here.

Comment 1 by, Jan 26 2018

Chrome Version: Google Chrome	65.0.3325.18 (Official Build) dev (64-bit)
My OS: Ubuntu 17.10

Comment 2 by, Jan 26 2018

Labels: -Pri-3 Pri-2
Status: Available (was: Untriaged)

Comment 3 by, Jan 26 2018

I filed WebKit/Edge bugs as well, for the record:

(I'm also attaching the testcase just in case the jsfiddle disappears.)
880 bytes View Download

Comment 4 by, Jan 26 2018

Thanks very much.

Comment 5 by, Jan 30 2018

Labels: -Type-Bug Type-Compat
So there's a potential compat issue hiding here (I gathered from reading the external correspondence...) Fairly limited but still.

Comment 6 by, Jan 30 2018

Yeah, this bug report originated in a issue (where the author was originally depending on the Chrome behavior here & hence Firefox was getting a broken rendering -- but they've since fixed their site to not depend on any particular behavior):

Comment 7 by, Feb 1 2018

Labels: Hotlist-Interop

Comment 8 by, Feb 1

Project Member
Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit - Your friendly Sheriffbot

Comment 9 by, Feb 1

Status: Available (was: Untriaged)

Sign in to add a comment