Bug 91498
Summary: | SVG <use> elements not displayed in Chrome (Safari is OK) | ||
---|---|---|---|
Product: | WebKit | Reporter: | Bob Wyttenbach <rw12> |
Component: | SVG | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Major | CC: | pdr, zimmermann |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://www.bobwyttenbach.com/chromeuse.html |
Bob Wyttenbach
Chrome does not display <use> elements in inline svg. The same svg is displayed correctly when linked through an <object> tag.
Here is a simple test case (code below or view it at http://www.bobwyttenbach.com/chromeuse.html):
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Chrome use-tag bug?</title>
</head>
<body>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="200px" height="200px" viewBox="0 0 200 200">
<defs>
<g id="test1">
<circle cx="100" cy="100" r="50" fill="red"/>
</g>
</defs>
<g>
<rect x="0.5" y="0.5" width="199" height="199" stroke="black" fill="none"/>
<use xlink:href="#test1" x="0" y="0"/>
</g>
</svg>
<p>Above is inline svg with a use tag; below is the same svg linked through an object tag. Below is correct.</p>
<object data="chromeuse.svg" width="200" height="200"></object>
</body>
</html>
The red circle does not appear in the inline svg but does appear when the same svg is linked through an object tag. Following someone's suggestion, I wrapped the circle in <symbol> tags (and moved id="test1" into the symbol tag). It made no difference.
Safari, Firefox, Opera, and Internet Explorer 9 all display the inline svg correctly.
Tested with Chrome Version 20.0.1132.57 in both Mac OS 10.7.4 and Windows 7 (in VMWare Fusion). Webkit 536.11. (Safari WebKit 534.57.2 does not have this bug.)
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Philip Rogers
Marking as a duplicate of https://bugs.webkit.org/show_bug.cgi?id=87504
(Again, thank you for reporting this! I've added more information about why this is a duplicate and when a release is being pushed at crbug.com/137666)
*** This bug has been marked as a duplicate of bug 87504 ***