Changeset 203836 in webkit
- Timestamp:
- Jul 28, 2016 1:54:03 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r203833 r203836 1 2016-07-28 Chris Dumez <cdumez@apple.com> 2 3 2 first parameters to input.setSelectionRange() should be mandatory 4 https://bugs.webkit.org/show_bug.cgi?id=160310 5 6 Reviewed by Alex Christensen. 7 8 Update existing test 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 1 13 2016-07-28 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt
r203833 r203836 29 29 PASS nonNumericPolicy('document.images.item(x)') is 'any type allowed (but not omitted)' 30 30 PASS nonNumericPolicy('document.createElement("input").setSelectionRange(x, 0)') is 'any type allowed' 31 PASS nonNumericPolicy('document.createElement("input").setSelectionRange(0, x)') is 'any type allowed '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 33 PASS nonNumericPolicy('createHTMLOptionsCollection().remove(x)') is 'any type allowed' -
trunk/LayoutTests/fast/dom/script-tests/non-numeric-values-numeric-parameters.js
r203833 r203836 241 241 242 242 shouldBe("nonNumericPolicy('document.createElement(\"input\").setSelectionRange(x, 0)')", "'any type allowed'"); 243 shouldBe("nonNumericPolicy('document.createElement(\"input\").setSelectionRange(0, x)')", "'any type allowed '");243 shouldBe("nonNumericPolicy('document.createElement(\"input\").setSelectionRange(0, x)')", "'any type allowed (but not omitted)'"); 244 244 245 245 // HTMLOptionsCollection -
trunk/LayoutTests/imported/w3c/ChangeLog
r203833 r203836 1 2016-07-28 Chris Dumez <cdumez@apple.com> 2 3 2 first parameters to input.setSelectionRange() should be mandatory 4 https://bugs.webkit.org/show_bug.cgi?id=160310 5 6 Reviewed by Alex Christensen. 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-07-28 Chris Dumez <cdumez@apple.com> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt
r203833 r203836 2777 2777 PASS HTMLInputElement interface: operation setRangeText(DOMString) 2778 2778 PASS HTMLInputElement interface: operation setRangeText(DOMString,unsigned long,unsigned long,SelectionMode) 2779 FAIL HTMLInputElement interface: operation setSelectionRange(unsigned long,unsigned long,DOMString) assert_equals: property has wrong .length expected 2 but got 0 2779 PASS HTMLInputElement interface: operation setSelectionRange(unsigned long,unsigned long,DOMString) 2780 2780 PASS HTMLInputElement interface: attribute align 2781 2781 PASS HTMLInputElement interface: attribute useMap … … 2843 2843 PASS HTMLInputElement interface: calling setRangeText(DOMString,unsigned long,unsigned long,SelectionMode) on document.createElement("input") with too few arguments must throw TypeError 2844 2844 PASS HTMLInputElement interface: document.createElement("input") must inherit property "setSelectionRange" with the proper type (55) 2845 FAIL HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on document.createElement("input") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 2846 fn.apply(obj, args); 2847 }" did not throw 2845 PASS HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on document.createElement("input") with too few arguments must throw TypeError 2848 2846 PASS HTMLInputElement interface: document.createElement("input") must inherit property "align" with the proper type (56) 2849 2847 PASS HTMLInputElement interface: document.createElement("input") must inherit property "useMap" with the proper type (57) … … 2911 2909 PASS HTMLInputElement interface: calling setRangeText(DOMString,unsigned long,unsigned long,SelectionMode) on createInput("text") with too few arguments must throw TypeError 2912 2910 PASS HTMLInputElement interface: createInput("text") must inherit property "setSelectionRange" with the proper type (55) 2913 FAIL HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on createInput("text") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 2914 fn.apply(obj, args); 2915 }" did not throw 2911 PASS HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on createInput("text") with too few arguments must throw TypeError 2916 2912 PASS HTMLInputElement interface: createInput("text") must inherit property "align" with the proper type (56) 2917 2913 PASS HTMLInputElement interface: createInput("text") must inherit property "useMap" with the proper type (57) … … 3045 3041 PASS HTMLInputElement interface: calling setRangeText(DOMString,unsigned long,unsigned long,SelectionMode) on createInput("search") with too few arguments must throw TypeError 3046 3042 PASS HTMLInputElement interface: createInput("search") must inherit property "setSelectionRange" with the proper type (55) 3047 FAIL HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on createInput("search") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 3048 fn.apply(obj, args); 3049 }" did not throw 3043 PASS HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on createInput("search") with too few arguments must throw TypeError 3050 3044 PASS HTMLInputElement interface: createInput("search") must inherit property "align" with the proper type (56) 3051 3045 PASS HTMLInputElement interface: createInput("search") must inherit property "useMap" with the proper type (57) … … 3113 3107 PASS HTMLInputElement interface: calling setRangeText(DOMString,unsigned long,unsigned long,SelectionMode) on createInput("tel") with too few arguments must throw TypeError 3114 3108 PASS HTMLInputElement interface: createInput("tel") must inherit property "setSelectionRange" with the proper type (55) 3115 FAIL HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on createInput("tel") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 3116 fn.apply(obj, args); 3117 }" did not throw 3109 PASS HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on createInput("tel") with too few arguments must throw TypeError 3118 3110 PASS HTMLInputElement interface: createInput("tel") must inherit property "align" with the proper type (56) 3119 3111 PASS HTMLInputElement interface: createInput("tel") must inherit property "useMap" with the proper type (57) … … 3181 3173 PASS HTMLInputElement interface: calling setRangeText(DOMString,unsigned long,unsigned long,SelectionMode) on createInput("url") with too few arguments must throw TypeError 3182 3174 PASS HTMLInputElement interface: createInput("url") must inherit property "setSelectionRange" with the proper type (55) 3183 FAIL HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on createInput("url") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 3184 fn.apply(obj, args); 3185 }" did not throw 3175 PASS HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on createInput("url") with too few arguments must throw TypeError 3186 3176 PASS HTMLInputElement interface: createInput("url") must inherit property "align" with the proper type (56) 3187 3177 PASS HTMLInputElement interface: createInput("url") must inherit property "useMap" with the proper type (57) … … 3249 3239 PASS HTMLInputElement interface: calling setRangeText(DOMString,unsigned long,unsigned long,SelectionMode) on createInput("email") with too few arguments must throw TypeError 3250 3240 PASS HTMLInputElement interface: createInput("email") must inherit property "setSelectionRange" with the proper type (55) 3251 FAIL HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on createInput("email") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 3252 fn.apply(obj, args); 3253 }" did not throw 3241 PASS HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on createInput("email") with too few arguments must throw TypeError 3254 3242 PASS HTMLInputElement interface: createInput("email") must inherit property "align" with the proper type (56) 3255 3243 PASS HTMLInputElement interface: createInput("email") must inherit property "useMap" with the proper type (57) … … 3317 3305 PASS HTMLInputElement interface: calling setRangeText(DOMString,unsigned long,unsigned long,SelectionMode) on createInput("password") with too few arguments must throw TypeError 3318 3306 PASS HTMLInputElement interface: createInput("password") must inherit property "setSelectionRange" with the proper type (55) 3319 FAIL HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on createInput("password") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 3320 fn.apply(obj, args); 3321 }" did not throw 3307 PASS HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on createInput("password") with too few arguments must throw TypeError 3322 3308 PASS HTMLInputElement interface: createInput("password") must inherit property "align" with the proper type (56) 3323 3309 PASS HTMLInputElement interface: createInput("password") must inherit property "useMap" with the proper type (57) … … 3385 3371 PASS HTMLInputElement interface: calling setRangeText(DOMString,unsigned long,unsigned long,SelectionMode) on createInput("date") with too few arguments must throw TypeError 3386 3372 PASS HTMLInputElement interface: createInput("date") must inherit property "setSelectionRange" with the proper type (55) 3387 FAIL HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on createInput("date") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 3388 fn.apply(obj, args); 3389 }" did not throw 3373 PASS HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on createInput("date") with too few arguments must throw TypeError 3390 3374 PASS HTMLInputElement interface: createInput("date") must inherit property "align" with the proper type (56) 3391 3375 PASS HTMLInputElement interface: createInput("date") must inherit property "useMap" with the proper type (57) … … 3453 3437 PASS HTMLInputElement interface: calling setRangeText(DOMString,unsigned long,unsigned long,SelectionMode) on createInput("month") with too few arguments must throw TypeError 3454 3438 PASS HTMLInputElement interface: createInput("month") must inherit property "setSelectionRange" with the proper type (55) 3455 FAIL HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on createInput("month") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 3456 fn.apply(obj, args); 3457 }" did not throw 3439 PASS HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on createInput("month") with too few arguments must throw TypeError 3458 3440 PASS HTMLInputElement interface: createInput("month") must inherit property "align" with the proper type (56) 3459 3441 PASS HTMLInputElement interface: createInput("month") must inherit property "useMap" with the proper type (57) … … 3521 3503 PASS HTMLInputElement interface: calling setRangeText(DOMString,unsigned long,unsigned long,SelectionMode) on createInput("week") with too few arguments must throw TypeError 3522 3504 PASS HTMLInputElement interface: createInput("week") must inherit property "setSelectionRange" with the proper type (55) 3523 FAIL HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on createInput("week") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 3524 fn.apply(obj, args); 3525 }" did not throw 3505 PASS HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on createInput("week") with too few arguments must throw TypeError 3526 3506 PASS HTMLInputElement interface: createInput("week") must inherit property "align" with the proper type (56) 3527 3507 PASS HTMLInputElement interface: createInput("week") must inherit property "useMap" with the proper type (57) … … 3589 3569 PASS HTMLInputElement interface: calling setRangeText(DOMString,unsigned long,unsigned long,SelectionMode) on createInput("time") with too few arguments must throw TypeError 3590 3570 PASS HTMLInputElement interface: createInput("time") must inherit property "setSelectionRange" with the proper type (55) 3591 FAIL HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on createInput("time") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 3592 fn.apply(obj, args); 3593 }" did not throw 3571 PASS HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on createInput("time") with too few arguments must throw TypeError 3594 3572 PASS HTMLInputElement interface: createInput("time") must inherit property "align" with the proper type (56) 3595 3573 PASS HTMLInputElement interface: createInput("time") must inherit property "useMap" with the proper type (57) … … 3657 3635 PASS HTMLInputElement interface: calling setRangeText(DOMString,unsigned long,unsigned long,SelectionMode) on createInput("datetime-local") with too few arguments must throw TypeError 3658 3636 PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "setSelectionRange" with the proper type (55) 3659 FAIL HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on createInput("datetime-local") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 3660 fn.apply(obj, args); 3661 }" did not throw 3637 PASS HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on createInput("datetime-local") with too few arguments must throw TypeError 3662 3638 PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "align" with the proper type (56) 3663 3639 PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "useMap" with the proper type (57) … … 3725 3701 PASS HTMLInputElement interface: calling setRangeText(DOMString,unsigned long,unsigned long,SelectionMode) on createInput("number") with too few arguments must throw TypeError 3726 3702 PASS HTMLInputElement interface: createInput("number") must inherit property "setSelectionRange" with the proper type (55) 3727 FAIL HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on createInput("number") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 3728 fn.apply(obj, args); 3729 }" did not throw 3703 PASS HTMLInputElement interface: calling setSelectionRange(unsigned long,unsigned long,DOMString) on createInput("number") with too few arguments must throw TypeError 3730 3704 PASS HTMLInputElement interface: createInput("number") must inherit property "align" with the proper type (56) 3731 3705 PASS HTMLInputElement interface: createInput("number") must inherit property "useMap" with the proper type (57) -
trunk/Source/WebCore/ChangeLog
r203835 r203836 1 2016-07-28 Chris Dumez <cdumez@apple.com> 2 3 2 first parameters to input.setSelectionRange() should be mandatory 4 https://bugs.webkit.org/show_bug.cgi?id=160310 5 6 Reviewed by Alex Christensen. 7 8 2 first parameters to input.setSelectionRange() should be mandatory: 9 - https://html.spec.whatwg.org/multipage/forms.html#htmlinputelement 10 11 Calling this method without the 2 first parameters makes little 12 sense. 13 14 Firefox agrees with the specification, Chrome does not. 15 16 No new tests, rebaselined existing test. 17 18 * bindings/js/JSHTMLInputElementCustom.cpp: 19 (WebCore::JSHTMLInputElement::setSelectionRange): 20 * html/HTMLInputElement.idl: 21 1 22 2016-07-28 Anders Carlsson <andersca@apple.com> 2 23 -
trunk/Source/WebCore/bindings/js/JSHTMLInputElementCustom.cpp
r191887 r203836 92 92 JSValue JSHTMLInputElement::setSelectionRange(ExecState& state) 93 93 { 94 if (UNLIKELY(state.argumentCount() < 2)) 95 return state.vm().throwException(&state, createNotEnoughArgumentsError(&state)); 96 94 97 HTMLInputElement& input = wrapped(); 95 98 if (!input.canHaveSelection()) 96 99 return throwTypeError(&state); 97 100 98 int start = state. argument(0).toInt32(&state);99 int end = state. argument(1).toInt32(&state);100 String direction = state.argument(2).to String(&state)->value(&state);101 int start = state.uncheckedArgument(0).toInt32(&state); 102 int end = state.uncheckedArgument(1).toInt32(&state); 103 String direction = state.argument(2).toWTFString(&state); 101 104 102 105 input.setSelectionRange(start, end, direction); -
trunk/Source/WebCore/html/HTMLInputElement.idl
r203427 r203836 97 97 [Custom] void setSelectionRange(long start, long end); 98 98 #else 99 [Custom] void setSelectionRange(optional long start, 100 optional long end, 101 optional DOMString direction); 99 [Custom] void setSelectionRange(long start, long end, optional DOMString direction); 102 100 #endif 103 101 -
trunk/Source/WebInspectorUI/ChangeLog
r203833 r203836 1 2016-07-28 Chris Dumez <cdumez@apple.com> 2 3 2 first parameters to input.setSelectionRange() should be mandatory 4 https://bugs.webkit.org/show_bug.cgi?id=160310 5 6 Reviewed by Alex Christensen. 7 8 Update WebInspector accordingly. 9 10 * UserInterface/Models/NativeFunctionParameters.js: 11 1 12 2016-07-28 Chris Dumez <cdumez@apple.com> 2 13 -
trunk/Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js
r203833 r203836 910 910 setCustomValidity: "error", 911 911 setRangeText: "replacement", 912 setSelectionRange: " [start], [end], [direction]",912 setSelectionRange: "start, end, [direction]", 913 913 stepDown: "[n]", 914 914 stepUp: "[n]",
Note: See TracChangeset
for help on using the changeset viewer.