[Webkit-unassigned] [Bug 183087] New: Safari not handling undefined global variables with same name as element Id correctly.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Feb 23 10:20:05 PST 2018


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

            Bug ID: 183087
           Summary: Safari not handling undefined global variables with
                    same name as element Id correctly.
           Product: WebKit
           Version: Safari 11
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: HTML DOM
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: tylerdah77 at gmail.com
                CC: cdumez at apple.com

I believe this to be a bug. 

If I have '<div id="someElement"></div>' in my DOM, a 'global' variable called someElement is created, this is OK, as it is fairly standard behavior.

Now, if I declare a global variable: 'var someElement;' This should now overshadow any global made with the element Id to make naming collisions with variables and elements not an issue. In Chrome, IE, Edge, FireFox, and Opera, my 'someElement' variable is 'undefined', as we would expect.

In Safari... 'someElement' is actually equal to '<div id="someElement"></div>' instead of 'undefined'. This is not expected behavior and seems to be a bug when every other browser correctly handles this.

-- 
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/20180223/1e858d9a/attachment-0001.html>


More information about the webkit-unassigned mailing list