[Webkit-unassigned] [Bug 18512] New: getPresentationAttribute returns a shared object

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 15 08:33:36 PDT 2008


http://bugs.webkit.org/show_bug.cgi?id=18512

           Summary: getPresentationAttribute returns a shared object
           Product: WebKit
           Version: 526+ (Nightly build)
          Platform: PC
        OS/Version: Windows XP
            Status: UNCONFIRMED
          Severity: Major
          Priority: P2
         Component: SVG
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: myrdred at gmail.com


Suppose you've got the following SVG:

  <rect id="firstrect"  x="100" y="100" width="100" height="100" fill="red" />
  <rect id="secondrect" x="100" y="250" width="100" height="100" fill="red" />

The "fill='red'" in both objects will be mapped to the same attribute. Calling
getPresentationAttribute('fill') on either rectangle will return this shared
attribute reference. Modifying the returned presentation attribute will modify
both rectangles. Even more fun, the change is permanent until WebKit is
restarted. So executing this code:

    function onLoad()
    {
        var rect = document.getElementById("firstrect");
        var fill = rect.getPresentationAttribute("fill");
        fill.setRGBColor("green");
    }

...means that every SVG object that's loaded from then on with the attribute
fill="red" will be drawn as green.

Verified on Windows XP with the latest service packs installed, but I've no
reason to think the bug is platform-specific.


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list