- Revision
- 203547
- Author
- [email protected]
- Date
- 2016-07-21 19:42:27 -0700 (Thu, 21 Jul 2016)
Log Message
Make parameters to Element.getElementsBy*() operations mandatory
https://bugs.webkit.org/show_bug.cgi?id=160060
Reviewed by Darin Adler.
LayoutTests/imported/w3c:
Rebaseline several W3C tests now that more checks are passing.
* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/html/dom/interfaces-expected.txt:
Source/WebCore:
Make parameters to Element.getElementsBy*() operations mandatory to
match the specification:
- https://dom.spec.whatwg.org/#interface-element
Firefox and Chrome agree with the specification so the compatibility
risk should be low.
It makes very little sense to call these operations without parameter,
especially considering WebKit uses the string "undefined" if the
parameter is omitted.
No new tests, rebaselined existing tests.
* dom/Element.idl:
LayoutTests:
Drop cases that were calling the operation without parameter.
* fast/dom/getElementsByClassName/dumpHTMLCollection-expected.txt:
* fast/dom/getElementsByClassName/dumpHTMLCollection.html:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (203546 => 203547)
--- trunk/LayoutTests/ChangeLog 2016-07-22 02:21:23 UTC (rev 203546)
+++ trunk/LayoutTests/ChangeLog 2016-07-22 02:42:27 UTC (rev 203547)
@@ -1,5 +1,17 @@
2016-07-21 Chris Dumez <[email protected]>
+ Make parameters to Element.getElementsBy*() operations mandatory
+ https://bugs.webkit.org/show_bug.cgi?id=160060
+
+ Reviewed by Darin Adler.
+
+ Drop cases that were calling the operation without parameter.
+
+ * fast/dom/getElementsByClassName/dumpHTMLCollection-expected.txt:
+ * fast/dom/getElementsByClassName/dumpHTMLCollection.html:
+
+2016-07-21 Chris Dumez <[email protected]>
+
Make parameters mandatory for attribute-related API on Element
https://bugs.webkit.org/show_bug.cgi?id=160059
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (203546 => 203547)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2016-07-22 02:21:23 UTC (rev 203546)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2016-07-22 02:42:27 UTC (rev 203547)
@@ -1,5 +1,17 @@
2016-07-21 Chris Dumez <[email protected]>
+ Make parameters to Element.getElementsBy*() operations mandatory
+ https://bugs.webkit.org/show_bug.cgi?id=160060
+
+ Reviewed by Darin Adler.
+
+ Rebaseline several W3C tests now that more checks are passing.
+
+ * web-platform-tests/dom/interfaces-expected.txt:
+ * web-platform-tests/html/dom/interfaces-expected.txt:
+
+2016-07-21 Chris Dumez <[email protected]>
+
Make parameters mandatory for attribute-related API on Element
https://bugs.webkit.org/show_bug.cgi?id=160059
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt (203546 => 203547)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt 2016-07-22 02:21:23 UTC (rev 203546)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt 2016-07-22 02:42:27 UTC (rev 203547)
@@ -849,9 +849,9 @@
PASS Element interface: operation closest(DOMString)
PASS Element interface: operation matches(DOMString)
PASS Element interface: operation webkitMatchesSelector(DOMString)
-FAIL Element interface: operation getElementsByTagName(DOMString) assert_equals: property has wrong .length expected 1 but got 0
-FAIL Element interface: operation getElementsByTagNameNS(DOMString,DOMString) assert_equals: property has wrong .length expected 2 but got 0
-FAIL Element interface: operation getElementsByClassName(DOMString) assert_equals: property has wrong .length expected 1 but got 0
+PASS Element interface: operation getElementsByTagName(DOMString)
+PASS Element interface: operation getElementsByTagNameNS(DOMString,DOMString)
+PASS Element interface: operation getElementsByClassName(DOMString)
FAIL Element interface: operation insertAdjacentElement(DOMString,Element) assert_own_property: interface prototype object missing non-static operation expected property "insertAdjacentElement" missing
FAIL Element interface: operation insertAdjacentText(DOMString,DOMString) assert_own_property: interface prototype object missing non-static operation expected property "insertAdjacentText" missing
PASS Element interface: attribute children
@@ -918,17 +918,11 @@
PASS Element interface: element must inherit property "webkitMatchesSelector" with the proper type (28)
PASS Element interface: calling webkitMatchesSelector(DOMString) on element with too few arguments must throw TypeError
PASS Element interface: element must inherit property "getElementsByTagName" with the proper type (29)
-FAIL Element interface: calling getElementsByTagName(DOMString) on element with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
- fn.apply(obj, args);
- }" did not throw
+PASS Element interface: calling getElementsByTagName(DOMString) on element with too few arguments must throw TypeError
PASS Element interface: element must inherit property "getElementsByTagNameNS" with the proper type (30)
-FAIL Element interface: calling getElementsByTagNameNS(DOMString,DOMString) on element with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
- fn.apply(obj, args);
- }" did not throw
+PASS Element interface: calling getElementsByTagNameNS(DOMString,DOMString) on element with too few arguments must throw TypeError
PASS Element interface: element must inherit property "getElementsByClassName" with the proper type (31)
-FAIL Element interface: calling getElementsByClassName(DOMString) on element with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
- fn.apply(obj, args);
- }" did not throw
+PASS Element interface: calling getElementsByClassName(DOMString) on element with too few arguments must throw TypeError
FAIL Element interface: element must inherit property "insertAdjacentElement" with the proper type (32) assert_inherits: property "insertAdjacentElement" not found in prototype chain
FAIL Element interface: calling insertAdjacentElement(DOMString,Element) on element with too few arguments must throw TypeError assert_inherits: property "insertAdjacentElement" not found in prototype chain
FAIL Element interface: element must inherit property "insertAdjacentText" with the proper type (33) assert_inherits: property "insertAdjacentText" not found in prototype chain
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt (203546 => 203547)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt 2016-07-22 02:21:23 UTC (rev 203546)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt 2016-07-22 02:42:27 UTC (rev 203547)
@@ -1271,17 +1271,11 @@
PASS Element interface: document.createElement("noscript") must inherit property "matches" with the proper type (24)
PASS Element interface: calling matches(DOMString) on document.createElement("noscript") with too few arguments must throw TypeError
PASS Element interface: document.createElement("noscript") must inherit property "getElementsByTagName" with the proper type (25)
-FAIL Element interface: calling getElementsByTagName(DOMString) on document.createElement("noscript") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
- fn.apply(obj, args);
- }" did not throw
+PASS Element interface: calling getElementsByTagName(DOMString) on document.createElement("noscript") with too few arguments must throw TypeError
PASS Element interface: document.createElement("noscript") must inherit property "getElementsByTagNameNS" with the proper type (26)
-FAIL Element interface: calling getElementsByTagNameNS(DOMString,DOMString) on document.createElement("noscript") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
- fn.apply(obj, args);
- }" did not throw
+PASS Element interface: calling getElementsByTagNameNS(DOMString,DOMString) on document.createElement("noscript") with too few arguments must throw TypeError
PASS Element interface: document.createElement("noscript") must inherit property "getElementsByClassName" with the proper type (27)
-FAIL Element interface: calling getElementsByClassName(DOMString) on document.createElement("noscript") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
- fn.apply(obj, args);
- }" did not throw
+PASS Element interface: calling getElementsByClassName(DOMString) on document.createElement("noscript") with too few arguments must throw TypeError
PASS Element interface: document.createElement("noscript") must inherit property "children" with the proper type (28)
PASS Element interface: document.createElement("noscript") must inherit property "firstElementChild" with the proper type (29)
PASS Element interface: document.createElement("noscript") must inherit property "lastElementChild" with the proper type (30)
Modified: trunk/Source/WebCore/ChangeLog (203546 => 203547)
--- trunk/Source/WebCore/ChangeLog 2016-07-22 02:21:23 UTC (rev 203546)
+++ trunk/Source/WebCore/ChangeLog 2016-07-22 02:42:27 UTC (rev 203547)
@@ -1,5 +1,27 @@
2016-07-21 Chris Dumez <[email protected]>
+ Make parameters to Element.getElementsBy*() operations mandatory
+ https://bugs.webkit.org/show_bug.cgi?id=160060
+
+ Reviewed by Darin Adler.
+
+ Make parameters to Element.getElementsBy*() operations mandatory to
+ match the specification:
+ - https://dom.spec.whatwg.org/#interface-element
+
+ Firefox and Chrome agree with the specification so the compatibility
+ risk should be low.
+
+ It makes very little sense to call these operations without parameter,
+ especially considering WebKit uses the string "undefined" if the
+ parameter is omitted.
+
+ No new tests, rebaselined existing tests.
+
+ * dom/Element.idl:
+
+2016-07-21 Chris Dumez <[email protected]>
+
Make parameters mandatory for attribute-related API on Element
https://bugs.webkit.org/show_bug.cgi?id=160059
Modified: trunk/Source/WebCore/dom/Element.idl (203546 => 203547)
--- trunk/Source/WebCore/dom/Element.idl 2016-07-22 02:21:23 UTC (rev 203546)
+++ trunk/Source/WebCore/dom/Element.idl 2016-07-22 02:42:27 UTC (rev 203547)
@@ -42,10 +42,9 @@
[RaisesException, InvokesCustomElementLifecycleCallbacks] Attr removeAttributeNode(Attr oldAttr);
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- [ImplementedAs=getElementsByTagNameForObjC] NodeList getElementsByTagName(optional DOMString name);
+ [ImplementedAs=getElementsByTagNameForObjC] NodeList getElementsByTagName(DOMString name);
#else
- // FIXME: Using "undefined" as default parameter value is wrong.
- HTMLCollection getElementsByTagName(optional DOMString name = "undefined");
+ HTMLCollection getElementsByTagName(DOMString name);
#endif
#if !defined(LANGUAGE_OBJECTIVE_C)
@@ -65,10 +64,9 @@
[ObjCLegacyUnnamedParameters, InvokesCustomElementLifecycleCallbacks] void removeAttributeNS(DOMString? namespaceURI, DOMString localName);
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- [ObjCLegacyUnnamedParameters, ImplementedAs=getElementsByTagNameNSForObjC] NodeList getElementsByTagNameNS(optional DOMString namespaceURI, optional DOMString localName);
+ [ObjCLegacyUnnamedParameters, ImplementedAs=getElementsByTagNameNSForObjC] NodeList getElementsByTagNameNS(DOMString? namespaceURI, DOMString localName);
#else
- // FIXME: Using "undefined" as default parameter value is wrong.
- HTMLCollection getElementsByTagNameNS(optional DOMString? namespaceURI = null, optional DOMString localName = "undefined");
+ HTMLCollection getElementsByTagNameNS(DOMString? namespaceURI, DOMString localName);
#endif
[ObjCLegacyUnnamedParameters] Attr? getAttributeNodeNS(DOMString? namespaceURI, DOMString localName);
@@ -128,10 +126,9 @@
// HTML 5
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- [ImplementedAs=getElementsByClassNameForObjC] NodeList getElementsByClassName(optional DOMString name);
+ [ImplementedAs=getElementsByClassNameForObjC] NodeList getElementsByClassName(DOMString name);
#else
- // FIXME: Using "undefined" as default parameter value is wrong.
- HTMLCollection getElementsByClassName(optional DOMString name = "undefined");
+ HTMLCollection getElementsByClassName(DOMString name);
#endif
[TreatNullAs=EmptyString, SetterRaisesException] attribute DOMString innerHTML;
[TreatNullAs=EmptyString, SetterRaisesException] attribute DOMString outerHTML;