<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>28976</bug_id>
          
          <creation_ts>2009-09-04 09:59:14 -0700</creation_ts>
          <short_desc>element.hasAttribute() fails to return true for nodes imported from XML documents</short_desc>
          <delta_ts>2022-08-02 09:57:59 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc>http://www.robodesign.ro/coding/0063/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mihai Sucan">mihai.sucan</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>cdumez</cc>
    
    <cc>jchaffraix</cc>
    
    <cc>rniwa</cc>
    
    <cc>sam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>144844</commentid>
    <comment_count>0</comment_count>
    <who name="Mihai Sucan">mihai.sucan</who>
    <bug_when>2009-09-04 09:59:14 -0700</bug_when>
    <thetext>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(&apos;someAttributeWithUpperCase&apos;).

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(&apos;someAttributeWithUpperCase&apos;) 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>145263</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-09-07 22:22:47 -0700</bug_when>
    <thetext>Case sensitivity behavior is implemented differently for getAttribute() on one hand, and hasAttribute()/setAttribute()/removeAttribute()/getAttributeNode() on another. Which behavior is &quot;right&quot; may be subject to discussion, but having it different seems clearly wrong.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>145479</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-09-08 12:03:18 -0700</bug_when>
    <thetext>See also: bug 20247 comment 10.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>145515</commentid>
    <comment_count>3</comment_count>
      <attachid>39208</attachid>
    <who name="Sam Weinig">sam</who>
    <bug_when>2009-09-08 13:26:08 -0700</bug_when>
    <thetext>Created attachment 39208
Test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1502836</commentid>
    <comment_count>4</comment_count>
    <who name="Lucas Forschler">lforschler</who>
    <bug_when>2019-02-06 09:02:45 -0800</bug_when>
    <thetext>Mass moving XML DOM bugs to the &quot;DOM&quot; Component.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1888364</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-08-02 04:59:00 -0700</bug_when>
    <thetext>All browsers (Chrome Canary 106, Firefox Nightly 105 and Safari 15.6 on macOS 12.5) are showing &quot;FAILED!&quot; and I am not sure on Web-Spec so appreciate if someone can mark this bug accordingly. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1888412</commentid>
    <comment_count>6</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2022-08-02 09:17:54 -0700</bug_when>
    <thetext>This is config changed now that Firefox&apos;s behavior is aligned with WebKit&apos;s.

imported.hasAttributeNS(null, &apos;camelCase&apos;) returns true.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>39208</attachid>
            <date>2009-09-08 13:26:08 -0700</date>
            <delta_ts>2009-09-08 13:26:08 -0700</delta_ts>
            <desc>Test case</desc>
            <filename>myVersion.html</filename>
            <type>text/html</type>
            <size>836</size>
            <attacher name="Sam Weinig">sam</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8Ym9keT4KICAgIDxwPmltcG9ydE5vZGUoKSArIGhhc0F0
dHJpYnV0ZSgpLjwvcD4KICAgIDxwcmUgaWQ9ImNvbnNvbGUiPjwvcHJlPgogICAgPHNjcmlwdD4K
ICAgICAgICBmdW5jdGlvbiBsb2cobXNnKQogICAgICAgIHsKICAgICAgICAgICAgZG9jdW1lbnQu
Z2V0RWxlbWVudEJ5SWQoJ2NvbnNvbGUnKS5hcHBlbmRDaGlsZChkb2N1bWVudC5jcmVhdGVUZXh0
Tm9kZShtc2cgKyAiXG4iKSk7CiAgICAgICAgfQoKICAgICAgICBpZiAod2luZG93LmxheW91dFRl
c3RDb250cm9sbGVyKQogICAgICAgICAgICBsYXlvdXRUZXN0Q29udHJvbGxlci5kdW1wQXNUZXh0
KCk7CgogICAgICAgIHZhciBuZXdEb2N1bWVudCA9IGRvY3VtZW50LmltcGxlbWVudGF0aW9uLmNy
ZWF0ZURvY3VtZW50KCJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hodG1sIiwgImRpdiIsIG51bGwp
OwogICAgICAgIHZhciBzcGFuID0gbmV3RG9jdW1lbnQuY3JlYXRlRWxlbWVudCgic3BhbiIpOwog
ICAgICAgIHNwYW4uc2V0QXR0cmlidXRlKCJjYW1lbENhc2UiLCAiZGF0YSIpOwogICAgICAgIG5l
d0RvY3VtZW50LmRvY3VtZW50RWxlbWVudC5hcHBlbmRDaGlsZChzcGFuKTsKCiAgICAgICAgdmFy
IGltcG9ydGVkID0gZG9jdW1lbnQuaW1wb3J0Tm9kZShzcGFuLCB0cnVlKTsKCiAgICAgICAgaWYg
KGltcG9ydGVkLmhhc0F0dHJpYnV0ZSgnY2FtZWxDYXNlJykpIHsKICAgICAgICAgICAgbG9nKCdQ
QVNTRUQhJyk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgbG9nKCdGQUlMRUQhJyk7CiAg
ICAgICAgfQogICAgPC9zY3JpcHQ+CjwvYm9keT4KPC9odG1sPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>