Changeset 204063 in webkit
- Timestamp:
- Aug 2, 2016 7:56:05 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r204062 r204063 1 2016-08-02 Chris Dumez <cdumez@apple.com> 2 3 Drop custom bindings code for HTMLOptionsCollection.remove() 4 https://bugs.webkit.org/show_bug.cgi?id=160475 5 6 Reviewed by Darin Adler. 7 8 Update existing tests to reflect behavior change. 9 10 * fast/dom/non-numeric-values-numeric-parameters-expected.txt: 11 * fast/dom/script-tests/non-numeric-values-numeric-parameters.js: 12 * js/dom/select-options-remove-expected.txt: 13 * js/resources/select-options-remove.js: 14 1 15 2016-08-02 Nan Wang <n_wang@apple.com> 2 16 -
trunk/LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt
r203840 r204063 31 31 PASS nonNumericPolicy('document.createElement("input").setSelectionRange(0, x)') is 'any type allowed (but not omitted)' 32 32 PASS nonNumericPolicy('createHTMLOptionsCollection().add(document.createElement("option"), x)') is 'any type allowed' 33 PASS nonNumericPolicy('createHTMLOptionsCollection().remove(x)') is 'any type allowed '33 PASS nonNumericPolicy('createHTMLOptionsCollection().remove(x)') is 'any type allowed (but not omitted)' 34 34 PASS nonNumericPolicy('createHTMLSelectElement().remove(x)') is 'any type allowed' 35 35 PASS nonNumericPolicy('createHTMLSelectElement().item(x)') is 'any type allowed (but not omitted)' -
trunk/LayoutTests/fast/dom/script-tests/non-numeric-values-numeric-parameters.js
r203840 r204063 246 246 247 247 shouldBe("nonNumericPolicy('createHTMLOptionsCollection().add(document.createElement(\"option\"), x)')", "'any type allowed'"); 248 shouldBe("nonNumericPolicy('createHTMLOptionsCollection().remove(x)')", "'any type allowed '");248 shouldBe("nonNumericPolicy('createHTMLOptionsCollection().remove(x)')", "'any type allowed (but not omitted)'"); 249 249 250 250 // HTMLSelectElement -
trunk/LayoutTests/imported/w3c/ChangeLog
r204048 r204063 1 2016-08-02 Chris Dumez <cdumez@apple.com> 2 3 Drop custom bindings code for HTMLOptionsCollection.remove() 4 https://bugs.webkit.org/show_bug.cgi?id=160475 5 6 Reviewed by Darin Adler. 7 8 Rebaseline W3C test now that more checks are passing. 9 10 * web-platform-tests/html/dom/interfaces-expected.txt: 11 1 12 2016-08-02 Chris Dumez <cdumez@apple.com> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt
r203935 r204063 929 929 PASS HTMLOptionsCollection interface: attribute length 930 930 PASS HTMLOptionsCollection interface: operation add([object Object],[object Object],[object Object],[object Object]) 931 FAIL HTMLOptionsCollection interface: operation remove(long) assert_equals: property has wrong .length expected 1 but got 0 931 PASS HTMLOptionsCollection interface: operation remove(long) 932 932 PASS HTMLOptionsCollection interface: attribute selectedIndex 933 933 FAIL HTMLOptionsCollection must be primary interface of document.createElement("select").options assert_equals: wrong typeof object expected "function" but got "object" -
trunk/LayoutTests/js/dom/select-options-remove-expected.txt
r156869 r204063 50 50 51 51 1.10 Remove no args from empty Options 52 PASS select1.options.remove() is undefined52 PASS select1.options.remove() threw exception TypeError: Not enough arguments. 53 53 PASS select1.options.length is 0 54 54 PASS select1.selectedIndex is -1 … … 144 144 PASS select2.options[0].value is 'K' 145 145 146 2.11 Remove no argsfrom non-empty Options147 PASS select2.options.remove( ) is undefined146 2.11 Remove index 0 from non-empty Options 147 PASS select2.options.remove(0) is undefined 148 148 PASS select2.options.length is 5 149 149 PASS select2.selectedIndex is 3 -
trunk/LayoutTests/js/resources/select-options-remove.js
r156869 r204063 68 68 69 69 debug("1.10 Remove no args from empty Options"); 70 should Be("select1.options.remove()", "undefined");70 shouldThrowErrorName("select1.options.remove()", "TypeError"); 71 71 shouldBe("select1.options.length", "0"); 72 72 shouldBe("select1.selectedIndex", "-1"); … … 194 194 debug(""); 195 195 196 debug("2.11 Remove no argsfrom non-empty Options");197 shouldBe("select2.options.remove( )", "undefined");196 debug("2.11 Remove index 0 from non-empty Options"); 197 shouldBe("select2.options.remove(0)", "undefined"); 198 198 shouldBe("select2.options.length", "5"); 199 199 shouldBe("select2.selectedIndex", "3"); -
trunk/Source/WebCore/ChangeLog
r204062 r204063 1 2016-08-02 Chris Dumez <cdumez@apple.com> 2 3 Drop custom bindings code for HTMLOptionsCollection.remove() 4 https://bugs.webkit.org/show_bug.cgi?id=160475 5 6 Reviewed by Darin Adler. 7 8 Drop custom bindings code for HTMLOptionsCollection.remove() and use 9 overloading instead. The overload that take an HTMLOptionElement is 10 WebKit-specific and should probably be dropped at some point: 11 - https://html.spec.whatwg.org/multipage/infrastructure.html#htmloptionscollection 12 13 This patch also fixes several bugs: 14 - The parameter is now mandatory. This is consistent with the 15 specification, Firefox and Chrome. 16 - HTMLOptionsCollection.prototype.remove.length is now 1 instead of 0. 17 18 No new tests, rebaselined existing tests. 19 20 * bindings/js/JSHTMLOptionsCollectionCustom.cpp: 21 (WebCore::JSHTMLOptionsCollection::remove): Deleted. 22 * html/HTMLOptionsCollection.idl: 23 1 24 2016-08-02 Nan Wang <n_wang@apple.com> 2 25 -
trunk/Source/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp
r200775 r204063 71 71 } 72 72 73 JSValue JSHTMLOptionsCollection::remove(ExecState& state)74 {75 // The argument can be an HTMLOptionElement or an index.76 JSValue argument = state.argument(0);77 if (HTMLOptionElement* option = JSHTMLOptionElement::toWrapped(argument))78 wrapped().remove(*option);79 else80 wrapped().remove(argument.toInt32(&state));81 return jsUndefined();82 73 } 83 84 } -
trunk/Source/WebCore/html/HTMLOptionsCollection.idl
r204028 r204063 43 43 [RaisesException] void add(HTMLOptionElement option, unsigned long index); 44 44 #endif 45 [Custom] void remove(optional unsigned long index); 45 46 void remove(long index); 47 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT 48 // FIXME: This overload is not in the specification and has been dropped in Blink. 49 void remove(HTMLOptionElement option); 50 #endif 46 51 47 52 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
Note: See TracChangeset
for help on using the changeset viewer.