Changeset 289465 in webkit
- Timestamp:
- Feb 9, 2022 2:37:47 AM (5 months ago)
- Location:
- trunk
- Files:
-
- 24 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/forms/date/date-stepup-stepdown-expected.txt (modified) (2 diffs)
-
LayoutTests/fast/forms/date/date-stepup-stepdown.html (modified) (2 diffs)
-
LayoutTests/fast/forms/datetimelocal/datetimelocal-stepup-stepdown-expected.txt (modified) (2 diffs)
-
LayoutTests/fast/forms/datetimelocal/datetimelocal-stepup-stepdown.html (modified) (2 diffs)
-
LayoutTests/fast/forms/month/month-stepup-stepdown-expected.txt (modified) (2 diffs)
-
LayoutTests/fast/forms/month/month-stepup-stepdown.html (modified) (2 diffs)
-
LayoutTests/fast/forms/number/number-stepup-stepdown-expected.txt (modified) (2 diffs)
-
LayoutTests/fast/forms/number/number-stepup-stepdown.html (modified) (2 diffs)
-
LayoutTests/fast/forms/range/range-stepup-stepdown-expected.txt (modified) (1 diff)
-
LayoutTests/fast/forms/range/range-stepup-stepdown.html (modified) (1 diff)
-
LayoutTests/fast/forms/time/time-stepup-stepdown-expected.txt (modified) (2 diffs)
-
LayoutTests/fast/forms/time/time-stepup-stepdown.html (modified) (2 diffs)
-
LayoutTests/fast/forms/week/week-stepup-stepdown-expected.txt (modified) (2 diffs)
-
LayoutTests/fast/forms/week/week-stepup-stepdown.html (modified) (2 diffs)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/range-expected.txt (modified) (1 diff)
-
LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/time-expected.txt (modified) (1 diff)
-
LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/time-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/time-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/InputType.cpp (modified) (1 diff)
-
Source/WebCore/html/StepRange.cpp (modified) (1 diff)
-
Source/WebCore/html/StepRange.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r289464 r289465 1 2022-02-09 Ziran Sun <zsun@igalia.com> 2 3 [Forms] Improving applyStep() to be in line with specs 4 https://bugs.webkit.org/show_bug.cgi?id=236134 5 6 Reviewed by Chris Dumez. 7 8 Update test expectations. 9 * fast/forms/date/date-stepup-stepdown-expected.txt: 10 * fast/forms/date/date-stepup-stepdown.html: 11 * fast/forms/datetimelocal/datetimelocal-stepup-stepdown-expected.txt: 12 * fast/forms/datetimelocal/datetimelocal-stepup-stepdown.html: 13 * fast/forms/month/month-stepup-stepdown-expected.txt: 14 * fast/forms/month/month-stepup-stepdown.html: 15 * fast/forms/number/number-stepup-stepdown-expected.txt: 16 * fast/forms/number/number-stepup-stepdown.html: 17 * fast/forms/range/range-stepup-stepdown-expected.txt: 18 * fast/forms/range/range-stepup-stepdown.html: 19 * fast/forms/time/time-stepup-stepdown-expected.txt: 20 * fast/forms/time/time-stepup-stepdown.html: 21 * fast/forms/week/week-stepup-stepdown-expected.txt: 22 * fast/forms/week/week-stepup-stepdown.html: 23 * platform/gtk/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/time-expected.txt: 24 * platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/time-expected.txt: 25 * platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/time-expected.txt: 26 1 27 2022-02-09 Diego Pino Garcia <dpino@igalia.com> 2 28 -
trunk/LayoutTests/fast/forms/date/date-stepup-stepdown-expected.txt
r289075 r289465 5 5 6 6 Invalid value 7 PASS stepUp("", null, null) threw exception InvalidStateError: The object is in an invalid state..8 PASS stepDown("", null, null) threw exception InvalidStateError: The object is in an invalid state..7 PASS stepUp("", null, null) is "1970-01-02" 8 PASS stepDown("", null, null) is "1969-12-31" 9 9 Non-number arguments 10 10 PASS stepUp("2010-02-10", null, null, "0") is "2010-02-10" … … 26 26 Overflow/underflow 27 27 PASS stepUp("2010-02-10", "3.40282346e+38", null) is "2010-02-10" 28 PASS stepDown("2010-02-10", "3.40282346e+38", null) is " 2010-02-10"28 PASS stepDown("2010-02-10", "3.40282346e+38", null) is "1970-01-01" 29 29 PASS stepUp("2010-02-10", "1", "2010-02-10") is "2010-02-10" 30 30 PASS stepDown("2010-02-10", "1", "2010-02-10") is "2010-02-10" -
trunk/LayoutTests/fast/forms/date/date-stepup-stepdown.html
r289075 r289465 39 39 input.type = 'date'; 40 40 debug('Invalid value'); 41 should ThrowErrorName('stepUp("", null, null)', "InvalidStateError");42 should ThrowErrorName('stepDown("", null, null)', "InvalidStateError");41 shouldBe('stepUp("", null, null)', '"1970-01-02"'); 42 shouldBe('stepDown("", null, null)', '"1969-12-31"'); 43 43 debug('Non-number arguments'); 44 44 shouldBe('stepUp("2010-02-10", null, null, "0")', '"2010-02-10"'); … … 60 60 debug('Overflow/underflow'); 61 61 shouldBe('stepUp("2010-02-10", "3.40282346e+38", null)', '"2010-02-10"'); 62 shouldBe('stepDown("2010-02-10", "3.40282346e+38", null)', '" 2010-02-10"');62 shouldBe('stepDown("2010-02-10", "3.40282346e+38", null)', '"1970-01-01"'); 63 63 shouldBe('stepUp("2010-02-10", "1", "2010-02-10")', '"2010-02-10"'); 64 64 shouldBe('stepDown("2010-02-10", "1", "2010-02-10")', '"2010-02-10"'); -
trunk/LayoutTests/fast/forms/datetimelocal/datetimelocal-stepup-stepdown-expected.txt
r289075 r289465 5 5 6 6 Invalid value 7 PASS stepUp("", null, null) threw exception InvalidStateError: The object is in an invalid state..8 PASS stepDown("", null, null) threw exception InvalidStateError: The object is in an invalid state..7 PASS stepUp("", null, null) is "1970-01-01T00:01" 8 PASS stepDown("", null, null) is "1969-12-31T23:59" 9 9 Non-number arguments 10 10 PASS stepUp("2010-02-10T20:13", null, null, "0") is "2010-02-10T20:13" … … 26 26 Overflow/underflow 27 27 PASS stepUp("2010-02-10T20:13", "3.40282346e+38", null) is "2010-02-10T20:13" 28 PASS stepDown("2010-02-10T20:13", "3.40282346e+38", null) is " 2010-02-10T20:13"28 PASS stepDown("2010-02-10T20:13", "3.40282346e+38", null) is "1970-01-01T00:00" 29 29 PASS stepUp("2010-02-10T20:13", "1", "2010-02-10T20:13") is "2010-02-10T20:13" 30 30 PASS stepDown("2010-02-10T20:13", "1", "2010-02-10T20:13") is "2010-02-10T20:13" -
trunk/LayoutTests/fast/forms/datetimelocal/datetimelocal-stepup-stepdown.html
r289075 r289465 39 39 input.type = 'datetime-local'; 40 40 debug('Invalid value'); 41 should ThrowErrorName('stepUp("", null, null)', "InvalidStateError");42 should ThrowErrorName('stepDown("", null, null)', "InvalidStateError");41 shouldBe('stepUp("", null, null)', '"1970-01-01T00:01"'); 42 shouldBe('stepDown("", null, null)', '"1969-12-31T23:59"'); 43 43 debug('Non-number arguments'); 44 44 shouldBe('stepUp("2010-02-10T20:13", null, null, "0")', '"2010-02-10T20:13"'); … … 60 60 debug('Overflow/underflow'); 61 61 shouldBe('stepUp("2010-02-10T20:13", "3.40282346e+38", null)', '"2010-02-10T20:13"'); 62 shouldBe('stepDown("2010-02-10T20:13", "3.40282346e+38", null)', '" 2010-02-10T20:13"');62 shouldBe('stepDown("2010-02-10T20:13", "3.40282346e+38", null)', '"1970-01-01T00:00"'); 63 63 shouldBe('stepUp("2010-02-10T20:13", "1", "2010-02-10T20:13")', '"2010-02-10T20:13"'); 64 64 shouldBe('stepDown("2010-02-10T20:13", "1", "2010-02-10T20:13")', '"2010-02-10T20:13"'); -
trunk/LayoutTests/fast/forms/month/month-stepup-stepdown-expected.txt
r289075 r289465 5 5 6 6 Invalid value 7 PASS stepUp("", null, null) threw exception InvalidStateError: The object is in an invalid state..8 PASS stepDown("", null, null) threw exception InvalidStateError: The object is in an invalid state..7 PASS stepUp("", null, null) is "1970-02" 8 PASS stepDown("", null, null) is "1969-12" 9 9 Non-number arguments 10 10 PASS stepUp("2010-02", null, null, "0") is "2010-02" … … 26 26 Overflow/underflow 27 27 PASS stepUp("2010-02", "3.40282346e+38", null) is "2010-02" 28 PASS stepDown("2010-02", "3.40282346e+38", null) is " 2010-02"28 PASS stepDown("2010-02", "3.40282346e+38", null) is "1970-01" 29 29 PASS stepUp("2010-02", "1", "2010-02") is "2010-02" 30 30 PASS stepDown("2010-02", "1", "2010-02") is "2010-02" -
trunk/LayoutTests/fast/forms/month/month-stepup-stepdown.html
r289075 r289465 39 39 input.type = 'month'; 40 40 debug('Invalid value'); 41 should ThrowErrorName('stepUp("", null, null)', "InvalidStateError");42 should ThrowErrorName('stepDown("", null, null)', "InvalidStateError");41 shouldBe('stepUp("", null, null)', '"1970-02"'); 42 shouldBe('stepDown("", null, null)', '"1969-12"'); 43 43 debug('Non-number arguments'); 44 44 shouldBe('stepUp("2010-02", null, null, "0")', '"2010-02"'); … … 60 60 debug('Overflow/underflow'); 61 61 shouldBe('stepUp("2010-02", "3.40282346e+38", null)', '"2010-02"'); 62 shouldBe('stepDown("2010-02", "3.40282346e+38", null)', '" 2010-02"');62 shouldBe('stepDown("2010-02", "3.40282346e+38", null)', '"1970-01"'); 63 63 shouldBe('stepUp("2010-02", "1", "2010-02")', '"2010-02"'); 64 64 shouldBe('stepDown("2010-02", "1", "2010-02")', '"2010-02"'); -
trunk/LayoutTests/fast/forms/number/number-stepup-stepdown-expected.txt
r289075 r289465 7 7 8 8 Invalid value 9 PASS stepUp("", null, null) threw exception InvalidStateError: The object is in an invalid state..10 PASS stepDown("", null, null) threw exception InvalidStateError: The object is in an invalid state..9 PASS stepUp("", null, null) is "1" 10 PASS stepDown("", null, null) is "-1" 11 11 12 12 Non-number arguments … … 143 143 PASS stepDown("1", "1", "0") is "0" 144 144 PASS stepDown("0", "1", "0") is "0" 145 PASS stepDown("1", "1", "0", 2) is " 1"146 PASS input.value is " 1"147 PASS stepDown("1", "3.40282346e+38", "", 2) is " 1"145 PASS stepDown("1", "1", "0", 2) is "0" 146 PASS input.value is "0" 147 PASS stepDown("1", "3.40282346e+38", "", 2) is "-3.40282346e+38" 148 148 PASS stepUp("-1", "1", "0") is "0" 149 149 PASS stepUp("0", "1", "0") is "0" 150 PASS stepUp("-1", "1", "0", 2) is " -1"151 PASS input.value is " -1"152 PASS stepUp("1", "3.40282346e+38", "", 2) is " 1"150 PASS stepUp("-1", "1", "0", 2) is "0" 151 PASS input.value is "0" 152 PASS stepUp("1", "3.40282346e+38", "", 2) is "3.40282346e+38" 153 153 154 154 stepDown()/stepUp() for stepMismatch values -
trunk/LayoutTests/fast/forms/number/number-stepup-stepdown.html
r289075 r289465 58 58 debug(''); 59 59 debug('Invalid value'); 60 should ThrowErrorName('stepUp("", null, null)', "InvalidStateError");61 should ThrowErrorName('stepDown("", null, null)', "InvalidStateError");60 shouldBe('stepUp("", null, null)', '"1"'); 61 shouldBe('stepDown("", null, null)', '"-1"'); 62 62 63 63 debug(''); … … 222 222 shouldBe('stepDown("1", "1", "0")', '"0"'); 223 223 shouldBe('stepDown("0", "1", "0")', '"0"'); 224 shouldBe('stepDown("1", "1", "0", 2)', '" 1"');225 shouldBe('input.value', '" 1"');226 shouldBe('stepDown("1", "3.40282346e+38", "", 2)', '" 1"');224 shouldBe('stepDown("1", "1", "0", 2)', '"0"'); 225 shouldBe('input.value', '"0"'); 226 shouldBe('stepDown("1", "3.40282346e+38", "", 2)', '"-3.40282346e+38"'); 227 227 shouldBe('stepUp("-1", "1", "0")', '"0"'); 228 228 shouldBe('stepUp("0", "1", "0")', '"0"'); 229 shouldBe('stepUp("-1", "1", "0", 2)', '" -1"');230 shouldBe('input.value', '" -1"');231 shouldBe('stepUp("1", "3.40282346e+38", "", 2)', '" 1"');229 shouldBe('stepUp("-1", "1", "0", 2)', '"0"'); 230 shouldBe('input.value', '"0"'); 231 shouldBe('stepUp("1", "3.40282346e+38", "", 2)', '"3.40282346e+38"'); 232 232 233 233 debug(''); -
trunk/LayoutTests/fast/forms/range/range-stepup-stepdown-expected.txt
r289075 r289465 142 142 PASS stepUpExplicitBounds(null, "100", "1", "100") is "100" 143 143 PASS input.value is "100" 144 PASS stepUpExplicitBounds(null, "100", "1", "99", "2") is " 99"145 PASS input.value is " 99"144 PASS stepUpExplicitBounds(null, "100", "1", "99", "2") is "100" 145 PASS input.value is "100" 146 146 PASS stepDownExplicitBounds("0", null, "1", "1") is "0" 147 147 PASS stepDownExplicitBounds("0", null, "1", "0") is "0" 148 148 PASS input.value is "0" 149 PASS stepDownExplicitBounds("0", null, "1", "1", "2") is " 1"150 PASS input.value is " 1"149 PASS stepDownExplicitBounds("0", null, "1", "1", "2") is "0" 150 PASS input.value is "0" 151 151 PASS stepDownExplicitBounds(null, null, "3.40282346e+38", "1", "2") is "0" 152 152 PASS stepUpExplicitBounds(-100, 0, 1, -1) is "0" 153 153 PASS stepUpExplicitBounds(null, 0, 1, 0) is "0" 154 PASS stepUpExplicitBounds(-100, 0, 1, -1, 2) is " -1"155 PASS input.value is " -1"154 PASS stepUpExplicitBounds(-100, 0, 1, -1, 2) is "0" 155 PASS input.value is "0" 156 156 PASS stepUpExplicitBounds(null, null, "3.40282346e+38", "1", "2") is "0" 157 157 -
trunk/LayoutTests/fast/forms/range/range-stepup-stepdown.html
r289075 r289465 232 232 shouldBe('stepUpExplicitBounds(null, "100", "1", "100")', '"100"'); 233 233 shouldBe('input.value', '"100"'); 234 shouldBe('stepUpExplicitBounds(null, "100", "1", "99", "2")', '" 99"');235 shouldBe('input.value', '" 99"');234 shouldBe('stepUpExplicitBounds(null, "100", "1", "99", "2")', '"100"'); 235 shouldBe('input.value', '"100"'); 236 236 shouldBe('stepDownExplicitBounds("0", null, "1", "1")', '"0"'); 237 237 shouldBe('stepDownExplicitBounds("0", null, "1", "0")', '"0"'); 238 238 shouldBe('input.value', '"0"'); 239 shouldBe('stepDownExplicitBounds("0", null, "1", "1", "2")', '" 1"');240 shouldBe('input.value', '" 1"');239 shouldBe('stepDownExplicitBounds("0", null, "1", "1", "2")', '"0"'); 240 shouldBe('input.value', '"0"'); 241 241 shouldBe('stepDownExplicitBounds(null, null, "3.40282346e+38", "1", "2")', '"0"'); 242 242 shouldBe('stepUpExplicitBounds(-100, 0, 1, -1)', '"0"'); 243 243 shouldBe('stepUpExplicitBounds(null, 0, 1, 0)', '"0"'); 244 shouldBe('stepUpExplicitBounds(-100, 0, 1, -1, 2)', '" -1"');245 shouldBe('input.value', '" -1"');244 shouldBe('stepUpExplicitBounds(-100, 0, 1, -1, 2)', '"0"'); 245 shouldBe('input.value', '"0"'); 246 246 shouldBe('stepUpExplicitBounds(null, null, "3.40282346e+38", "1", "2")', '"0"'); 247 247 -
trunk/LayoutTests/fast/forms/time/time-stepup-stepdown-expected.txt
r289075 r289465 5 5 6 6 Invalid value 7 PASS stepUp("", null, null) threw exception InvalidStateError: The object is in an invalid state..8 PASS stepDown("", null, null) threw exception InvalidStateError: The object is in an invalid state..7 PASS stepUp("", null, null) is "00:01" 8 PASS stepDown("", null, null) is "00:00" 9 9 Non-number arguments 10 10 PASS stepUp("20:13", null, null, "0") is "20:13" … … 26 26 Overflow/underflow 27 27 PASS stepUp("20:13", "3.40282346e+38", null) is "20:13" 28 PASS stepDown("20:13", "3.40282346e+38", null) is " 20:13"29 PASS stepUp("20:13", "1", "20:13") is "20:13 "30 PASS stepDown("20:13", "1", "20:13") is "20:13 "28 PASS stepDown("20:13", "3.40282346e+38", null) is "00:00:00" 29 PASS stepUp("20:13", "1", "20:13") is "20:13:00" 30 PASS stepDown("20:13", "1", "20:13") is "20:13:00" 31 31 PASS stepUp("23:59", null, null) is "23:59" 32 32 PASS stepDown("00:00", null, null) is "00:00" -
trunk/LayoutTests/fast/forms/time/time-stepup-stepdown.html
r289075 r289465 39 39 input.type = 'time'; 40 40 debug('Invalid value'); 41 should ThrowErrorName('stepUp("", null, null)', "InvalidStateError");42 should ThrowErrorName('stepDown("", null, null)', "InvalidStateError");41 shouldBe('stepUp("", null, null)', '"00:01"'); 42 shouldBe('stepDown("", null, null)', '"00:00"'); 43 43 debug('Non-number arguments'); 44 44 shouldBe('stepUp("20:13", null, null, "0")', '"20:13"'); … … 60 60 debug('Overflow/underflow'); 61 61 shouldBe('stepUp("20:13", "3.40282346e+38", null)', '"20:13"'); 62 shouldBe('stepDown("20:13", "3.40282346e+38", null)', '" 20:13"');63 shouldBe('stepUp("20:13", "1", "20:13")', '"20:13 "');64 shouldBe('stepDown("20:13", "1", "20:13")', '"20:13 "');62 shouldBe('stepDown("20:13", "3.40282346e+38", null)', '"00:00:00"'); 63 shouldBe('stepUp("20:13", "1", "20:13")', '"20:13:00"'); 64 shouldBe('stepDown("20:13", "1", "20:13")', '"20:13:00"'); 65 65 shouldBe('stepUp("23:59", null, null)', '"23:59"'); 66 66 shouldBe('stepDown("00:00", null, null)', '"00:00"'); -
trunk/LayoutTests/fast/forms/week/week-stepup-stepdown-expected.txt
r289075 r289465 5 5 6 6 Invalid value 7 PASS stepUp("", null, null) threw exception InvalidStateError: The object is in an invalid state..8 PASS stepDown("", null, null) threw exception InvalidStateError: The object is in an invalid state..7 PASS stepUp("", null, null) is "1970-W02" 8 PASS stepDown("", null, null) is "1969-W52" 9 9 Non-number arguments 10 10 PASS stepUp("2010-W02", null, null, "0") is "2010-W02" … … 26 26 Overflow/underflow 27 27 PASS stepUp("2010-W02", "3.40282346e+38", null) is "2010-W02" 28 PASS stepDown("2010-W02", "3.40282346e+38", null) is " 2010-W02"28 PASS stepDown("2010-W02", "3.40282346e+38", null) is "1970-W01" 29 29 PASS stepUp("2010-W02", "1", "2010-W02") is "2010-W02" 30 30 PASS stepDown("2010-W02", "1", "2010-W02") is "2010-W02" -
trunk/LayoutTests/fast/forms/week/week-stepup-stepdown.html
r289075 r289465 39 39 input.type = 'week'; 40 40 debug('Invalid value'); 41 should ThrowErrorName('stepUp("", null, null)', "InvalidStateError");42 should ThrowErrorName('stepDown("", null, null)', "InvalidStateError");41 shouldBe('stepUp("", null, null)', '"1970-W02"'); 42 shouldBe('stepDown("", null, null)', '"1969-W52"'); 43 43 debug('Non-number arguments'); 44 44 shouldBe('stepUp("2010-W02", null, null, "0")', '"2010-W02"'); … … 60 60 debug('Overflow/underflow'); 61 61 shouldBe('stepUp("2010-W02", "3.40282346e+38", null)', '"2010-W02"'); 62 shouldBe('stepDown("2010-W02", "3.40282346e+38", null)', '" 2010-W02"');62 shouldBe('stepDown("2010-W02", "3.40282346e+38", null)', '"1970-W01"'); 63 63 shouldBe('stepUp("2010-W02", "1", "2010-W02")', '"2010-W02"'); 64 64 shouldBe('stepDown("2010-W02", "1", "2010-W02")', '"2010-W02"'); -
trunk/LayoutTests/imported/w3c/ChangeLog
r289454 r289465 1 2022-02-09 Ziran Sun <zsun@igalia.com> 2 3 [Forms] Improving applyStep() to be in line with specs 4 https://bugs.webkit.org/show_bug.cgi?id=236134 5 6 Reviewed by Chris Dumez. 7 8 * web-platform-tests/html/semantics/forms/the-input-element/range-expected.txt: 9 1 10 2022-02-08 Antoine Quint <graouts@webkit.org> 2 11 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/range-expected.txt
r289209 r289465 22 22 PASS Performing stepUp() 23 23 PASS Performing stepDown() 24 FAIL Performing stepUp() beyond the value of the max attribute assert_equals: expected "12" but got "9" 25 FAIL Performing stepDown() beyond the value of the min attribute assert_equals: expected "3" but got "6" 24 PASS Performing stepUp() beyond the value of the max attribute 25 PASS Performing stepDown() beyond the value of the min attribute 26 26 FAIL Skip ASCII whitespace within input assert_equals: expected "123" but got "50" 27 27 PASS Multiply value by ten raised to the exponentth power with `e` -
trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/time-expected.txt
r289075 r289465 30 30 PASS stepUp stop because it exceeds the maximum value 31 31 PASS stepDown stop so lower than the minimum value 32 FAIL stop at border on stepUp assert_in_array: a valid time string representing 1 minute after 3pm value "15:00" not in array ["15:01", "15:01:00", "15:01:00.0", "15:01:00.00", "15:01:00.000"] 33 FAIL stop at border on stepDown assert_in_array: a valid time string representing 1 minute before 2pm value "13:00" not in array ["12:59", "12:59:00", "12:59:00.0", "12:59:00.00", "12:59:00.000"] 34 FAIL empty value of stepUp The object is in an invalid state. 32 PASS stop at border on stepUp 33 PASS stop at border on stepDown 34 PASS empty value of stepUp 35 35 PASS set value on not time format value 36 36 -
trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/time-expected.txt
r289075 r289465 30 30 PASS stepUp stop because it exceeds the maximum value 31 31 PASS stepDown stop so lower than the minimum value 32 FAIL stop at border on stepUp assert_in_array: a valid time string representing 1 minute after 3pm value "15:00" not in array ["15:01", "15:01:00", "15:01:00.0", "15:01:00.00", "15:01:00.000"] 33 FAIL stop at border on stepDown assert_in_array: a valid time string representing 1 minute before 2pm value "13:00" not in array ["12:59", "12:59:00", "12:59:00.0", "12:59:00.00", "12:59:00.000"] 34 FAIL empty value of stepUp The object is in an invalid state. 32 PASS stop at border on stepUp 33 PASS stop at border on stepDown 34 PASS empty value of stepUp 35 35 PASS set value on not time format value 36 36 -
trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/time-expected.txt
r289075 r289465 30 30 PASS stepUp stop because it exceeds the maximum value 31 31 PASS stepDown stop so lower than the minimum value 32 FAIL stop at border on stepUp assert_in_array: a valid time string representing 1 minute after 3pm value "15:00" not in array ["15:01", "15:01:00", "15:01:00.0", "15:01:00.00", "15:01:00.000"] 33 FAIL stop at border on stepDown assert_in_array: a valid time string representing 1 minute before 2pm value "13:00" not in array ["12:59", "12:59:00", "12:59:00.0", "12:59:00.00", "12:59:00.000"] 34 FAIL empty value of stepUp The object is in an invalid state. 32 PASS stop at border on stepUp 33 PASS stop at border on stepDown 34 PASS empty value of stepUp 35 35 PASS set value on not time format value 36 36 -
trunk/Source/WebCore/ChangeLog
r289462 r289465 1 2022-02-09 Ziran Sun <zsun@igalia.com> 2 3 [Forms] Improving applyStep() to be in line with specs 4 https://bugs.webkit.org/show_bug.cgi?id=236134 5 6 Reviewed by Chris Dumez. 7 8 This is to improve applyStep() func to follow specs at 9 https://html.spec.whatwg.org/multipage/input.html#dom-input-stepup 10 11 Since Chromium implementation follows the specs steps, this patch imports the 12 Chromium implmentation. 13 14 This is a further patch after https://bugs.webkit.org/show_bug.cgi?id=235509. It has corrected 15 some changes on test files in fast/form directory in the previous patch submitted for Bug 16 235509. With this CL a few more sub-tests are now passing. 17 18 * html/InputType.cpp: 19 (WebCore::InputType::applyStep): 20 * html/StepRange.cpp: 21 (WebCore::StepRange::stepSnappedMaximum const): 22 * html/StepRange.h: 23 1 24 2022-02-09 Saam Barati <sbarati@apple.com> 2 25 -
trunk/Source/WebCore/html/InputType.cpp
r289075 r289465 922 922 ExceptionOr<void> InputType::applyStep(int count, AnyStepHandling anyStepHandling, TextFieldEventBehavior eventBehavior) 923 923 { 924 // https://html.spec.whatwg.org/C/#dom-input-stepup 925 924 926 StepRange stepRange(createStepRange(anyStepHandling)); 925 927 if (!stepRange.hasStep()) 926 928 return Exception { InvalidStateError }; 927 929 928 ASSERT(element()); 929 const Decimal current = parseToNumberOrNaN(element()->value()); 930 if (!current.isFinite()) 931 return Exception { InvalidStateError }; 932 Decimal newValue = current + stepRange.step() * count; 933 if (!newValue.isFinite()) 934 return Exception { InvalidStateError }; 935 936 const Decimal acceptableErrorValue = stepRange.acceptableError(); 937 if (newValue - stepRange.minimum() < -acceptableErrorValue) 930 // 3. If the element has a minimum and a maximum and the minimum is greater than the maximum, then abort these steps. 931 if (stepRange.minimum() > stepRange.maximum()) 938 932 return { }; 939 if (newValue < stepRange.minimum()) 940 newValue = stepRange.minimum(); 941 942 if (!equalLettersIgnoringASCIICase(element()->attributeWithoutSynchronization(stepAttr), "any")) 933 934 // 4. If the element has a minimum and a maximum and there is no value greater than or equal to the element's minimum and less than or equal to 935 // the element's maximum that, when subtracted from the step base, is an integral multiple of the allowed value step, then abort these steps. 936 Decimal alignedMaximum = stepRange.stepSnappedMaximum(); 937 if (!alignedMaximum.isFinite()) 938 return { }; 939 940 ASSERT(element()); 941 const Decimal current = parseToNumber(element()->value(), 0); 942 Decimal base = stepRange.stepBase(); 943 Decimal step = stepRange.step(); 944 Decimal newValue = current; 945 946 newValue = newValue + stepRange.step() * Decimal::fromDouble(count); 947 const AtomString& stepString = element()->getAttribute(HTMLNames::stepAttr); 948 if (!equalIgnoringASCIICase(stepString, "any")) 943 949 newValue = stepRange.alignValueForStep(current, newValue); 944 950 945 if (newValue - stepRange.maximum() > acceptableErrorValue) 951 // 8. If the element has a minimum, and value is less than that minimum, then set value to the smallest value that, when subtracted from the step 952 // base, is an integral multiple of the allowed value step, and that is more than or equal to minimum. 953 if (newValue < stepRange.minimum()) { 954 const Decimal alignedMinimum = base + ((stepRange.minimum() - base) / step).ceiling() * step; 955 ASSERT(alignedMinimum >= stepRange.minimum()); 956 newValue = alignedMinimum; 957 } 958 959 // 9. If the element has a maximum, and value is greater than that maximum, then set value to the largest value that, when subtracted from the step 960 // base, is an integral multiple of the allowed value step, and that is less than or equal to maximum. 961 if (newValue > stepRange.maximum()) 962 newValue = alignedMaximum; 963 964 // 10. If either the method invoked was the stepDown() method and value is greater than valueBeforeStepping, or the method invoked was the stepUp() 965 // method and value is less than valueBeforeStepping, then return. 966 if ((count < 0 && current < newValue) || (count > 0 && current > newValue)) 946 967 return { }; 947 if (newValue > stepRange.maximum()) 948 newValue = stepRange.maximum(); 949 968 950 969 Ref protectedThis { *this }; 951 970 auto result = setValueAsDecimal(newValue, eventBehavior); -
trunk/Source/WebCore/html/StepRange.cpp
r286581 r289465 143 143 } 144 144 145 Decimal StepRange::stepSnappedMaximum() const 146 { 147 Decimal base = stepBase(); 148 Decimal step = m_step; 149 if (base - step == base || !(base / step).isFinite()) 150 return Decimal::nan(); 151 Decimal alignedMaximum = base + ((maximum() - base) / step).floor() * step; 152 if (alignedMaximum > maximum()) 153 alignedMaximum -= step; 154 if (alignedMaximum < minimum()) 155 return Decimal::nan(); 156 return alignedMaximum; 157 } 158 145 159 bool StepRange::stepMismatch(const Decimal& valueForCheck) const 146 160 { -
trunk/Source/WebCore/html/StepRange.h
r286581 r289465 74 74 Decimal maximum() const { return m_maximum; } 75 75 Decimal minimum() const { return m_minimum; } 76 Decimal stepSnappedMaximum() const; 76 77 static Decimal parseStep(AnyStepHandling, const StepDescription&, const String&); 77 78 Decimal step() const { return m_step; }
Note: See TracChangeset
for help on using the changeset viewer.