Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (204114 => 204115)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2016-08-04 05:11:26 UTC (rev 204114)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2016-08-04 05:26:58 UTC (rev 204115)
@@ -1,5 +1,17 @@
2016-08-03 Chris Dumez <[email protected]>
+ Object.getOwnPropertyNames() on NamedNodeMap fails to return named properties
+ https://bugs.webkit.org/show_bug.cgi?id=160517
+
+ Reviewed by Alex Christensen.
+
+ Rebaseline several W3C tests now that more checks are passing.
+
+ * web-platform-tests/dom/collections/namednodemap-supported-property-names-expected.txt:
+ * web-platform-tests/dom/nodes/attributes-expected.txt:
+
+2016-08-03 Chris Dumez <[email protected]>
+
Drop DocumentType.internalSubset attribute
https://bugs.webkit.org/show_bug.cgi?id=160530
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/collections/namednodemap-supported-property-names-expected.txt (204114 => 204115)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/collections/namednodemap-supported-property-names-expected.txt 2016-08-04 05:11:26 UTC (rev 204114)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/collections/namednodemap-supported-property-names-expected.txt 2016-08-04 05:26:58 UTC (rev 204115)
@@ -1,6 +1,6 @@
-FAIL Object.getOwnPropertyNames on NamedNodeMap assert_array_equals: lengths differ, expected 4 got 2
-FAIL Object.getOwnPropertyNames on NamedNodeMap of input assert_array_equals: lengths differ, expected 8 got 4
-FAIL Object.getOwnPropertyNames on NamedNodeMap after attribute removal assert_array_equals: lengths differ, expected 6 got 3
+PASS Object.getOwnPropertyNames on NamedNodeMap
+PASS Object.getOwnPropertyNames on NamedNodeMap of input
+PASS Object.getOwnPropertyNames on NamedNodeMap after attribute removal
Simple
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/attributes-expected.txt (204114 => 204115)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/attributes-expected.txt 2016-08-04 05:11:26 UTC (rev 204114)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/attributes-expected.txt 2016-08-04 05:26:58 UTC (rev 204115)
@@ -49,11 +49,11 @@
PASS setAttributeNode, if it fires mutation events, should fire one with the new node when resetting an existing attribute (outer shell)
PASS setAttributeNode called with an Attr that has the same name as an existing one should not change attribute order
PASS getAttributeNames tests
-FAIL Own property correctness with basic attributes assert_array_equals: lengths differ, expected 4 got 2
-FAIL Own property correctness with non-namespaced attribute before same-name namespaced one assert_array_equals: lengths differ, expected 5 got 3
-FAIL Own property correctness with namespaced attribute before same-name non-namespaced one assert_array_equals: lengths differ, expected 5 got 3
-FAIL Own property correctness with two namespaced attributes with the same name-with-prefix assert_array_equals: lengths differ, expected 5 got 3
-FAIL Own property names should only include all-lowercase qualified names for an HTML element in an HTML document assert_array_equals: lengths differ, expected 8 got 6
-FAIL Own property names should include all qualified names for a non-HTML element in an HTML document assert_array_equals: lengths differ, expected 12 got 6
-FAIL Own property names should include all qualified names for an HTML element in a non-HTML document assert_array_equals: lengths differ, expected 12 got 6
+PASS Own property correctness with basic attributes
+PASS Own property correctness with non-namespaced attribute before same-name namespaced one
+PASS Own property correctness with namespaced attribute before same-name non-namespaced one
+PASS Own property correctness with two namespaced attributes with the same name-with-prefix
+PASS Own property names should only include all-lowercase qualified names for an HTML element in an HTML document
+PASS Own property names should include all qualified names for a non-HTML element in an HTML document
+PASS Own property names should include all qualified names for an HTML element in a non-HTML document
Modified: trunk/Source/WebCore/ChangeLog (204114 => 204115)
--- trunk/Source/WebCore/ChangeLog 2016-08-04 05:11:26 UTC (rev 204114)
+++ trunk/Source/WebCore/ChangeLog 2016-08-04 05:26:58 UTC (rev 204115)
@@ -1,5 +1,22 @@
2016-08-03 Chris Dumez <[email protected]>
+ Object.getOwnPropertyNames() on NamedNodeMap fails to return named properties
+ https://bugs.webkit.org/show_bug.cgi?id=160517
+
+ Reviewed by Alex Christensen.
+
+ Object.getOwnPropertyNames() on NamedNodeMap should return named
+ properties' names as per:
+ - https://dom.spec.whatwg.org/#dom-namednodemap-item
+
+ No new tests, rebaselined existing tests.
+
+ * dom/NamedNodeMap.cpp:
+ (WebCore::NamedNodeMap::supportedPropertyNames):
+ * dom/NamedNodeMap.h:
+
+2016-08-03 Chris Dumez <[email protected]>
+
Drop DocumentType.internalSubset attribute
https://bugs.webkit.org/show_bug.cgi?id=160530
Modified: trunk/Source/WebCore/dom/NamedNodeMap.cpp (204114 => 204115)
--- trunk/Source/WebCore/dom/NamedNodeMap.cpp 2016-08-04 05:11:26 UTC (rev 204114)
+++ trunk/Source/WebCore/dom/NamedNodeMap.cpp 2016-08-04 05:26:58 UTC (rev 204115)
@@ -28,6 +28,8 @@
#include "Attr.h"
#include "Element.h"
#include "ExceptionCode.h"
+#include "HTMLDocument.h"
+#include "HTMLElement.h"
namespace WebCore {
@@ -63,10 +65,15 @@
return m_element.detachAttribute(index);
}
-Vector<AtomicString> NamedNodeMap::supportedPropertyNames()
+Vector<String> NamedNodeMap::supportedPropertyNames()
{
- // FIXME: Should be implemented.
- return Vector<AtomicString>();
+ Vector<String> names = m_element.getAttributeNames();
+ if (is<HTMLElement>(m_element) && is<HTMLDocument>(m_element.document())) {
+ names.removeAllMatching([](String& name) {
+ return name.convertToASCIILowercase() != name;
+ });
+ }
+ return names;
}
RefPtr<Attr> NamedNodeMap::removeNamedItemNS(const AtomicString& namespaceURI, const AtomicString& localName, ExceptionCode& ec)
Modified: trunk/Source/WebCore/dom/NamedNodeMap.h (204114 => 204115)
--- trunk/Source/WebCore/dom/NamedNodeMap.h 2016-08-04 05:11:26 UTC (rev 204114)
+++ trunk/Source/WebCore/dom/NamedNodeMap.h 2016-08-04 05:26:58 UTC (rev 204115)
@@ -53,7 +53,7 @@
RefPtr<Attr> getNamedItem(const AtomicString&) const;
RefPtr<Attr> removeNamedItem(const AtomicString& name, ExceptionCode&);
- Vector<AtomicString> supportedPropertyNames();
+ Vector<String> supportedPropertyNames();
RefPtr<Attr> getNamedItemNS(const AtomicString& namespaceURI, const AtomicString& localName) const;
RefPtr<Attr> removeNamedItemNS(const AtomicString& namespaceURI, const AtomicString& localName, ExceptionCode&);