[Webkit-unassigned] [Bug 138779] New: Using document.appendChild to create a new element with ID attribute creates a property / global variable on window

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Nov 16 11:18:20 PST 2014


https://bugs.webkit.org/show_bug.cgi?id=138779

            Bug ID: 138779
           Summary: Using document.appendChild to create a new element
                    with ID attribute creates a property / global variable
                    on window
    Classification: Unclassified
           Product: WebKit
           Version: 528+ (Nightly build)
          Hardware: Macintosh
                OS: Mac OS X 10.10
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: HTML DOM
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: seibzhen at gmail.com

Created attachment 241682
  --> https://bugs.webkit.org/attachment.cgi?id=241682&action=review
a web page with the steps used on the bug report

It seems that when using the DOM API to create new nodes on a webpage and specifying an ID attribute, a global variable / property on window object is created with the same name as the specified ID.

In the example attached, I am getting a reference to a paragraph in the body of the page. After that, I am creating a new div node and setting its id attribute to 'test_variable'.

In the next lines, I am appending it into the paragraph node reference I had gotten earlier using appendChild(). After that code is run, a new property on window is created, window.test_variable, having the reference to a HTMLDivElementConstructor.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20141116/7aecf1b8/attachment-0002.html>


More information about the webkit-unassigned mailing list