[Webkit-unassigned] [Bug 22211] Accessing DOM elements directly, without using getElementById() from inside javascripts

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 12 13:18:13 PST 2008


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





------- Comment #5 from sam at webkit.org  2008-11-12 13:18 PDT -------
This is not a quirks issue, but is due to this bit of code in
JSDOMWindowBase::getOwnPropertySlot

    // Allow shortcuts like 'Image1' instead of document.images.Image1
    Document* document = impl()->frame()->document();
    if (document && document->isHTMLDocument()) {
        AtomicStringImpl* atomicPropertyName =
AtomicString::find(propertyName);
        if (atomicPropertyName &&
(static_cast<HTMLDocument*>(document)->hasNamedItem(atomicPropertyName) ||
document->hasElementWithId(atomicPropertyName))) {
            slot.setCustom(this, namedItemGetter);
            return true;
        }
    }

Presumably, the isHTMLDocument is return false for document in question.  The
reason this works in Chromium is because they have their own bindings to JS. 
In order to provide a cohesive product from this project, we really should try
and stay bug for bug compatible.  Though I am not sure this is actually a bug
quite yet.


-- 
Configure bugmail: https://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