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