[Webkit-unassigned] [Bug 104959] New: Style on dynamically created use element does not get overridden by referenced element style change
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Dec 13 14:44:50 PST 2012
https://bugs.webkit.org/show_bug.cgi?id=104959
Summary: Style on dynamically created use element does not get
overridden by referenced element style change
Product: WebKit
Version: 528+ (Nightly build)
Platform: Unspecified
URL: http://jsfiddle.net/xkgS9/
OS/Version: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: SVG
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: krit at webkit.org
CC: zimmermann at kde.org
Style on dynamically created use element does not get overridden by referenced element style change.
In the test, a 'use' element is created dynamically. The 'use' element references a circle, which did not set the fill property.In the same cycle as the use element creation, the fill color of the circle is set to 'green'. Green should override the fill property of the use element, but doesn't. Adding the setting of fill to a setTimeout solves the problem. Please see reference to test the issue.
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<circle cx="150" cy="150" r="100" id="circle"/>
<g id="g"></g>
<script type="text/ecmascript">
var g = document.getElementById("g"),
c = document.getElementById("circle"),
use = document.createElementNS("http://www.w3.org/2000/svg", "use");
use.setAttributeNS("http://www.w3.org/1999/xlink", "href", "#circle");
use.setAttribute("x", 200);
use.setAttribute("fill", "red");
g.appendChild(use);
// Fill color of circle is set to green, 'use' reference should follow, but doesn't.
c.setAttribute("fill", "green");
<!--setTimeout(function() { c.setAttribute("fill", "green"); },0);-->
</script>
</svg>
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list