Element.getAttributeNS() should return null if the attribute does not exist
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Sep 2015 21:39:02 +0000 (21:39 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Sep 2015 21:39:02 +0000 (21:39 +0000)
commit89a9879eb06097a0736ff8e4668bea401eb596d8
tree0b849c7d676424244dff058122677698214d2baa
parenteda13dc36e1e0c86987f8b579df82696654bb9fb
Element.getAttributeNS() should return null if the attribute does not exist
https://bugs.webkit.org/show_bug.cgi?id=149180
<rdar://problem/22561011>

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline several W3C DOM tests now that more checks are passing.

* web-platform-tests/dom/nodes/attributes-expected.txt:
* web-platform-tests/dom/nodes/case-expected.txt:

Source/WebCore:

Element.getAttributeNS() should return null if the attribute does not
exist, similarly to what Element.getAttribute() does:
- https://dom.spec.whatwg.org/#element (both return a nullable DOMString).
- https://dom.spec.whatwg.org/#dom-element-getattributens (step 2)

Firefox and Chrome match the specification. However, WebKit was returning
an empty string for getAttributeNS() and null for getAttribute(). This
patch aligns WebKit's behavior with the specification and other browsers.

No new tests, already covered by existing tests.

* dom/Element.idl:

LayoutTests:

Rebaseline / update existing tests now that our behavior has changed.

* fast/dom/Element/attribute-uppercase-expected.txt:
* fast/dom/Element/mozilla-dom-base-tests/test_bug1075702-expected.txt:
* fast/dom/Element/mozilla-dom-base-tests/test_bug1075702.html:
* fast/dom/Element/setAttributeNode-overriding-lowercase-values-1-expected.txt:
* fast/dom/Element/setAttributeNode-overriding-lowercase-values-2-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189825 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/Element/attribute-uppercase-expected.txt
LayoutTests/fast/dom/Element/mozilla-dom-base-tests/test_bug1075702-expected.txt
LayoutTests/fast/dom/Element/mozilla-dom-base-tests/test_bug1075702.html
LayoutTests/fast/dom/Element/setAttributeNode-overriding-lowercase-values-1-expected.txt
LayoutTests/fast/dom/Element/setAttributeNode-overriding-lowercase-values-2-expected.txt
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/dom/nodes/attributes-expected.txt
LayoutTests/imported/w3c/web-platform-tests/dom/nodes/case-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/dom/Element.idl