RESOLVED INVALID 12229
setAttributeNS(null,"fill","red") not working for polygons
https://bugs.webkit.org/show_bug.cgi?id=12229
Summary setAttributeNS(null,"fill","red") not working for polygons
Russell Gum
Reported 2007-01-12 12:35:19 PST
function changeColor(evt, id) { var SVGDoc = evt.getTarget().getOwnerDocument(); var state = SVGDoc.getElementById(id); var style = state.getStyle(); evt.target.setAttributeNS(null,"fill","red"); } works for rectangles and circles but not for polygons <rect id="myBlueRect" width="100" height="50" x="1500" y="1000" fill="blue" onclick="changeColor(evt, 'myBlueRect')"/> works <polygon id="F02" class="S40F02" style="fill: white" stroke="blue" stroke-width="2" onmouseover="changeColor(evt, 'S40F02')" points=" 687.0,958.0 786.0,958.0 813.0,1030.0 714.0,1030.0 " /> does not work
Attachments
Rob Buis
Comment 1 2007-01-12 13:37:37 PST
Hi, Actually this is the expected behaviour, I checked with Opera and FF. What happens is that for the rect the presentation attribute is overwritten on click, which is fine. For the polygon however two different style entities are used. On the polygon the inline style is set and the presentation attribute fill is again set (onmouseover). But here the inline style always wins, so the fill is unchanged. Cheers, Rob.
Darin Adler
Comment 2 2014-04-24 16:44:51 PDT
Moving all JavaScriptGlue bugs to JavaScriptCore. The JavaScriptGlue framework itself is long gone. And most of the more recent bugs put in this component were put there by people who thought this was for some other aspect of “JavaScript glue” and have nothing to do with the actual original reason for the existence of this component, which was an OS-X-only framework named JavaScriptGlue.
Note You need to log in before you can comment on or make changes to this bug.