[Webkit-unassigned] [Bug 33644] New: Aliasing javascript globals to elements with matching name/id is inconsistent with Firefox and slow

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 13 17:57:02 PST 2010


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

           Summary: Aliasing javascript globals to elements with matching
                    name/id is inconsistent with Firefox and slow
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: jamesr at chromium.org
                CC: mjs at apple.com, darin at apple.com, ian at hixie.ch,
                    fishd at chromium.org


This code shows the text 'peekaboo' in WebKit and IE but not in Firefox:

<span id='foo' style='display:none'>peekaboo</span>
<script>
foo.style.display='';
</script>

I think we should consider matching the Firefox behavior here instead of IE. 
The IE behavior is odd and likely undesirable for many web developers as well
as being against the spec.  If changing this is too risky from a compatibility
standpoint, we should match Firefox in standards mode and keep the old behavior
only in quirks mode.

Additionally, it's fairly slow.  Since the logic for whether a global aliases
an element is a bit tricky (an element is aliased if its id matches the
variable name or if the name matches and it is an <img>, <form>, <applet>,
<embed>,  or <object>) we can't rely on a hash lookup getElementById() to
resolve the alias.  Instead, if there is a possible match (meaning any element
with a matching id or name) we do a full DOM walk.  This shows up as a
measurable (but small) amount of time in GMail load, on pages with a different
DOM structure and variable name/element id distribution this could cause quite
a significant delay.

-- 
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