[Webkit-unassigned] [Bug 28976] New: element.hasAttribute() fails to return true for imported nodes

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 4 09:59:13 PDT 2009


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

           Summary: element.hasAttribute() fails to return true for
                    imported nodes
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
               URL: http://www.robodesign.ro/coding/0063/
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: HTML DOM
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: mihai.sucan at gmail.com


The element.hasAttribute() fails to return true for imported nodes when the
attribute includes upper case characters.

Steps to reproduce:

1. Have two DOM documents, say DocA and DocB.
2. Import from DocA into DocB an element node which has at least one child
element node.
3. Retrieve a reference to one of the child element nodes you imported.
4. Try element.hasAttribute('someAttributeWithUpperCase').

Expected result: the element.hasAttribute() method must return true if the
attribute is set for the element node.

Actual result: the element.hasAttribute() method returns false, even if the
attribute is set for the said element node. What is more curious is that the
element.getAttribute('someAttributeWithUpperCase') method works fine, and the
attribute value is properly returned.

It should be noted that if the attribute has no upper case letter, then the
hasAttribute() method works as expected. Additionally, the importNode() step is
crucial to exposing the bug. If you try hasAttribute() with pre-existing
document elements which have attributes with upper case names, it all works
fine.

The URL points to a minimal test case which loads an XHTML document with
XMLHttpRequest and imports the element node into the main document, and then
tries the element.hasAttribute() method. The test case fails in Webkit (tested
with Google Chrome 2 on Windows, Safari 4 on Windows, Chromium 4 development
daily build on Linux). The test case does not fail in Opera 9.6, Opera 10,
Firefox 3.0, Firefox 3.5 and Konqueror 4.1.

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