Changeset 290124 in webkit
- Timestamp:
- Feb 18, 2022 7:39:39 AM (5 months ago)
- Location:
- trunk
- Files:
-
- 9 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/forms/number/number-stepup-stepdown-expected.txt (modified) (2 diffs)
-
LayoutTests/fast/forms/number/number-stepup-stepdown-from-renderer-expected.txt (modified) (2 diffs)
-
LayoutTests/fast/forms/number/number-stepup-stepdown-from-renderer.html (modified) (2 diffs)
-
LayoutTests/fast/forms/number/number-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/number-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/parser/HTMLParserIdioms.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r290123 r290124 1 2022-02-18 Ziran Sun <zsun@igalia.com> 2 3 [InputElement] Return empty string for an invalid floating-point number that ends with "." 4 https://bugs.webkit.org/show_bug.cgi?id=236700 5 6 Reviewed by Chris Dumez. 7 8 * fast/forms/number/number-stepup-stepdown-expected.txt: 9 * fast/forms/number/number-stepup-stepdown-from-renderer-expected.txt: 10 * fast/forms/number/number-stepup-stepdown-from-renderer.html: 11 * fast/forms/number/number-stepup-stepdown.html: 12 1 13 2022-02-18 Antoine Quint <graouts@webkit.org> 2 14 -
trunk/LayoutTests/fast/forms/number/number-stepup-stepdown-expected.txt
r289465 r290124 57 57 PASS stepUp(".1", 1, null) is "1.1" 58 58 PASS stepUp(".2", 1, null) is "1.2" 59 PASS stepUp("1.", 1, null) is " 2"60 PASS stepUp("2.", 1, null) is " 3"59 PASS stepUp("1.", 1, null) is "1" 60 PASS stepUp("2.", 1, null) is "1" 61 61 62 62 PASS stepUp("-.1", 1, null) is "0.9" 63 63 PASS stepUp("-.2", 1, null) is "0.8" 64 PASS stepUp("-1.", 1, null) is " 0"65 PASS stepUp("-2.", 1, null) is " -1"64 PASS stepUp("-1.", 1, null) is "1" 65 PASS stepUp("-2.", 1, null) is "1" 66 66 67 67 PASS stepDown(".1", 1, null) is "-0.9" 68 68 PASS stepDown(".2", 1, null) is "-0.8" 69 PASS stepDown("1.", 1, null) is " 0"70 PASS stepDown("2.", 1, null) is " 1"69 PASS stepDown("1.", 1, null) is "-1" 70 PASS stepDown("2.", 1, null) is "-1" 71 71 72 72 PASS stepDown("-.1", 1, null) is "-1.1" 73 73 PASS stepDown("-.2", 1, null) is "-1.2" 74 PASS stepDown("-1.", 1, null) is "- 2"75 PASS stepDown("-2.", 1, null) is "- 3"74 PASS stepDown("-1.", 1, null) is "-1" 75 PASS stepDown("-2.", 1, null) is "-1" 76 76 77 77 PASS stepUp("0.1", .1, null) is "0.2" … … 105 105 PASS stepUp(".1", .1, null) is "0.2" 106 106 PASS stepUp(".2", .1, null) is "0.3" 107 PASS stepUp("1.", .1, null) is " 1.1"108 PASS stepUp("2.", .1, null) is " 2.1"107 PASS stepUp("1.", .1, null) is "0.1" 108 PASS stepUp("2.", .1, null) is "0.1" 109 109 110 110 PASS stepUp("-.1", .1, null) is "0" 111 111 PASS stepUp("-.2", .1, null) is "-0.1" 112 PASS stepUp("-1.", .1, null) is " -0.9"113 PASS stepUp("-2.", .1, null) is " -1.9"112 PASS stepUp("-1.", .1, null) is "0.1" 113 PASS stepUp("-2.", .1, null) is "0.1" 114 114 115 115 PASS stepDown(".1", .1, null) is "0" 116 116 PASS stepDown(".2", .1, null) is "0.1" 117 PASS stepDown("1.", .1, null) is " 0.9"118 PASS stepDown("2.", .1, null) is " 1.9"117 PASS stepDown("1.", .1, null) is "-0.1" 118 PASS stepDown("2.", .1, null) is "-0.1" 119 119 120 120 PASS stepDown("-.1", .1, null) is "-0.2" 121 121 PASS stepDown("-.2", .1, null) is "-0.3" 122 PASS stepDown("-1.", .1, null) is "- 1.1"123 PASS stepDown("-2.", .1, null) is "- 2.1"122 PASS stepDown("-1.", .1, null) is "-0.1" 123 PASS stepDown("-2.", .1, null) is "-0.1" 124 124 125 125 Extra arguments -
trunk/LayoutTests/fast/forms/number/number-stepup-stepdown-from-renderer-expected.txt
r191940 r290124 60 60 PASS stepUp(".1", 1, null) is "1" 61 61 PASS stepUp(".2", 1, null) is "1" 62 PASS stepUp("1.", 1, null) is " 2"63 PASS stepUp("2.", 1, null) is " 3"62 PASS stepUp("1.", 1, null) is "1" 63 PASS stepUp("2.", 1, null) is "1" 64 64 65 65 PASS stepUp("-.1", 1, null) is "0" 66 66 PASS stepUp("-.2", 1, null) is "0" 67 PASS stepUp("-1.", 1, null) is " 0"68 PASS stepUp("-2.", 1, null) is " -1"67 PASS stepUp("-1.", 1, null) is "1" 68 PASS stepUp("-2.", 1, null) is "1" 69 69 70 70 PASS stepDown(".1", 1, null) is "0" 71 71 PASS stepDown(".2", 1, null) is "0" 72 PASS stepDown("1.", 1, null) is " 0"73 PASS stepDown("2.", 1, null) is " 1"72 PASS stepDown("1.", 1, null) is "-1" 73 PASS stepDown("2.", 1, null) is "-1" 74 74 75 75 PASS stepDown("-.1", 1, null) is "-1" 76 76 PASS stepDown("-.2", 1, null) is "-1" 77 PASS stepDown("-1.", 1, null) is "- 2"78 PASS stepDown("-2.", 1, null) is "- 3"77 PASS stepDown("-1.", 1, null) is "-1" 78 PASS stepDown("-2.", 1, null) is "-1" 79 79 80 80 PASS stepUp("0.1", .1, null) is "0.2" … … 108 108 PASS stepUp(".1", .1, null) is "0.2" 109 109 PASS stepUp(".2", .1, null) is "0.3" 110 PASS stepUp("1.", .1, null) is " 1.1"111 PASS stepUp("2.", .1, null) is " 2.1"110 PASS stepUp("1.", .1, null) is "0.1" 111 PASS stepUp("2.", .1, null) is "0.1" 112 112 113 113 PASS stepUp("-.1", .1, null) is "0" 114 114 PASS stepUp("-.2", .1, null) is "-0.1" 115 PASS stepUp("-1.", .1, null) is " -0.9"116 PASS stepUp("-2.", .1, null) is " -1.9"115 PASS stepUp("-1.", .1, null) is "0.1" 116 PASS stepUp("-2.", .1, null) is "0.1" 117 117 PASS stepDown(".1", .1, null) is "0" 118 118 PASS stepDown(".2", .1, null) is "0.1" 119 PASS stepDown("1.", .1, null) is " 0.9"120 PASS stepDown("2.", .1, null) is " 1.9"119 PASS stepDown("1.", .1, null) is "-0.1" 120 PASS stepDown("2.", .1, null) is "-0.1" 121 121 122 122 PASS stepDown("-.1", .1, null) is "-0.2" 123 123 PASS stepDown("-.2", .1, null) is "-0.3" 124 PASS stepDown("-1.", .1, null) is "- 1.1"125 PASS stepDown("-2.", .1, null) is "- 2.1"124 PASS stepDown("-1.", .1, null) is "-0.1" 125 PASS stepDown("-2.", .1, null) is "-0.1" 126 126 127 127 Invalid step value -
trunk/LayoutTests/fast/forms/number/number-stepup-stepdown-from-renderer.html
r203333 r290124 172 172 shouldBe('stepUp(".1", 1, null)', '"1"'); // Is 1.1 in non-render test 173 173 shouldBe('stepUp(".2", 1, null)', '"1"'); // Is 1.2 in non-render test 174 shouldBe('stepUp("1.", 1, null)', '" 2"');175 shouldBe('stepUp("2.", 1, null)', '" 3"');174 shouldBe('stepUp("1.", 1, null)', '"1"'); 175 shouldBe('stepUp("2.", 1, null)', '"1"'); 176 176 177 177 debug(''); 178 178 shouldBe('stepUp("-.1", 1, null)', '"0"'); // Is 0.9 in non-render test 179 179 shouldBe('stepUp("-.2", 1, null)', '"0"'); // Is 0.8 in non-render test 180 shouldBe('stepUp("-1.", 1, null)', '" 0"');181 shouldBe('stepUp("-2.", 1, null)', '" -1"');180 shouldBe('stepUp("-1.", 1, null)', '"1"'); 181 shouldBe('stepUp("-2.", 1, null)', '"1"'); 182 182 183 183 debug(''); 184 184 shouldBe('stepDown(".1", 1, null)', '"0"'); // Is -0.9 in non-render test 185 185 shouldBe('stepDown(".2", 1, null)', '"0"'); // Is -0.8 in non-render test 186 shouldBe('stepDown("1.", 1, null)', '" 0"');187 shouldBe('stepDown("2.", 1, null)', '" 1"');186 shouldBe('stepDown("1.", 1, null)', '"-1"'); 187 shouldBe('stepDown("2.", 1, null)', '"-1"'); 188 188 189 189 debug(''); 190 190 shouldBe('stepDown("-.1", 1, null)', '"-1"'); // Is -1.1 in non-render test 191 191 shouldBe('stepDown("-.2", 1, null)', '"-1"'); // Is -1.2 in non-render test 192 shouldBe('stepDown("-1.", 1, null)', '"- 2"');193 shouldBe('stepDown("-2.", 1, null)', '"- 3"');192 shouldBe('stepDown("-1.", 1, null)', '"-1"'); 193 shouldBe('stepDown("-2.", 1, null)', '"-1"'); 194 194 195 195 // Same as above, but stepping by .1 rather than 1. … … 229 229 shouldBe('stepUp(".1", .1, null)', '"0.2"'); 230 230 shouldBe('stepUp(".2", .1, null)', '"0.3"'); 231 shouldBe('stepUp("1.", .1, null)', '" 1.1"');232 shouldBe('stepUp("2.", .1, null)', '" 2.1"');231 shouldBe('stepUp("1.", .1, null)', '"0.1"'); 232 shouldBe('stepUp("2.", .1, null)', '"0.1"'); 233 233 234 234 debug(''); 235 235 shouldBe('stepUp("-.1", .1, null)', '"0"'); 236 236 shouldBe('stepUp("-.2", .1, null)', '"-0.1"'); 237 shouldBe('stepUp("-1.", .1, null)', '" -0.9"');238 shouldBe('stepUp("-2.", .1, null)', '" -1.9"');237 shouldBe('stepUp("-1.", .1, null)', '"0.1"'); 238 shouldBe('stepUp("-2.", .1, null)', '"0.1"'); 239 239 240 240 shouldBe('stepDown(".1", .1, null)', '"0"'); 241 241 shouldBe('stepDown(".2", .1, null)', '"0.1"'); 242 shouldBe('stepDown("1.", .1, null)', '" 0.9"');243 shouldBe('stepDown("2.", .1, null)', '" 1.9"');242 shouldBe('stepDown("1.", .1, null)', '"-0.1"'); 243 shouldBe('stepDown("2.", .1, null)', '"-0.1"'); 244 244 245 245 debug(''); 246 246 shouldBe('stepDown("-.1", .1, null)', '"-0.2"'); 247 247 shouldBe('stepDown("-.2", .1, null)', '"-0.3"'); 248 shouldBe('stepDown("-1.", .1, null)', '"- 1.1"');249 shouldBe('stepDown("-2.", .1, null)', '"- 2.1"');248 shouldBe('stepDown("-1.", .1, null)', '"-0.1"'); 249 shouldBe('stepDown("-2.", .1, null)', '"-0.1"'); 250 250 251 251 debug(''); -
trunk/LayoutTests/fast/forms/number/number-stepup-stepdown.html
r289465 r290124 119 119 shouldBe('stepUp(".1", 1, null)', '"1.1"'); 120 120 shouldBe('stepUp(".2", 1, null)', '"1.2"'); 121 shouldBe('stepUp("1.", 1, null)', '" 2"');122 shouldBe('stepUp("2.", 1, null)', '" 3"');121 shouldBe('stepUp("1.", 1, null)', '"1"'); 122 shouldBe('stepUp("2.", 1, null)', '"1"'); 123 123 124 124 debug(''); 125 125 shouldBe('stepUp("-.1", 1, null)', '"0.9"'); 126 126 shouldBe('stepUp("-.2", 1, null)', '"0.8"'); 127 shouldBe('stepUp("-1.", 1, null)', '" 0"');128 shouldBe('stepUp("-2.", 1, null)', '" -1"');127 shouldBe('stepUp("-1.", 1, null)', '"1"'); 128 shouldBe('stepUp("-2.", 1, null)', '"1"'); 129 129 130 130 debug(''); 131 131 shouldBe('stepDown(".1", 1, null)', '"-0.9"'); 132 132 shouldBe('stepDown(".2", 1, null)', '"-0.8"'); 133 shouldBe('stepDown("1.", 1, null)', '" 0"');134 shouldBe('stepDown("2.", 1, null)', '" 1"');133 shouldBe('stepDown("1.", 1, null)', '"-1"'); 134 shouldBe('stepDown("2.", 1, null)', '"-1"'); 135 135 136 136 debug(''); 137 137 shouldBe('stepDown("-.1", 1, null)', '"-1.1"'); 138 138 shouldBe('stepDown("-.2", 1, null)', '"-1.2"'); 139 shouldBe('stepDown("-1.", 1, null)', '"- 2"');140 shouldBe('stepDown("-2.", 1, null)', '"- 3"');139 shouldBe('stepDown("-1.", 1, null)', '"-1"'); 140 shouldBe('stepDown("-2.", 1, null)', '"-1"'); 141 141 142 142 // Same as above, but stepping by .1 rather than 1. … … 176 176 shouldBe('stepUp(".1", .1, null)', '"0.2"'); 177 177 shouldBe('stepUp(".2", .1, null)', '"0.3"'); 178 shouldBe('stepUp("1.", .1, null)', '" 1.1"');179 shouldBe('stepUp("2.", .1, null)', '" 2.1"');178 shouldBe('stepUp("1.", .1, null)', '"0.1"'); 179 shouldBe('stepUp("2.", .1, null)', '"0.1"'); 180 180 181 181 debug(''); 182 182 shouldBe('stepUp("-.1", .1, null)', '"0"'); 183 183 shouldBe('stepUp("-.2", .1, null)', '"-0.1"'); 184 shouldBe('stepUp("-1.", .1, null)', '" -0.9"');185 shouldBe('stepUp("-2.", .1, null)', '" -1.9"');184 shouldBe('stepUp("-1.", .1, null)', '"0.1"'); 185 shouldBe('stepUp("-2.", .1, null)', '"0.1"'); 186 186 187 187 debug(''); 188 188 shouldBe('stepDown(".1", .1, null)', '"0"'); 189 189 shouldBe('stepDown(".2", .1, null)', '"0.1"'); 190 shouldBe('stepDown("1.", .1, null)', '" 0.9"');191 shouldBe('stepDown("2.", .1, null)', '" 1.9"');190 shouldBe('stepDown("1.", .1, null)', '"-0.1"'); 191 shouldBe('stepDown("2.", .1, null)', '"-0.1"'); 192 192 193 193 debug(''); 194 194 shouldBe('stepDown("-.1", .1, null)', '"-0.2"'); 195 195 shouldBe('stepDown("-.2", .1, null)', '"-0.3"'); 196 shouldBe('stepDown("-1.", .1, null)', '"- 1.1"');197 shouldBe('stepDown("-2.", .1, null)', '"- 2.1"');196 shouldBe('stepDown("-1.", .1, null)', '"-0.1"'); 197 shouldBe('stepDown("-2.", .1, null)', '"-0.1"'); 198 198 199 199 debug(''); -
trunk/LayoutTests/imported/w3c/ChangeLog
r290120 r290124 1 2022-02-18 Ziran Sun <zsun@igalia.com> 2 3 [InputElement] Return empty string for an invalid floating-point number that ends with "." 4 https://bugs.webkit.org/show_bug.cgi?id=236700 5 6 Reviewed by Chris Dumez. 7 8 * web-platform-tests/html/semantics/forms/the-input-element/number-expected.txt: 9 1 10 2022-02-18 Jon Lee <jonlee@apple.com> 2 11 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/number-expected.txt
r267646 r290124 16 16 PASS Value > max attribute 17 17 PASS value with a leading '.' 18 FAIL value ending with '.' assert_equals: expected "" but got "1." 18 PASS value ending with '.' 19 19 PASS value = -0 20 20 PASS value = Infinity -
trunk/Source/WebCore/ChangeLog
r290123 r290124 1 2022-02-18 Ziran Sun <zsun@igalia.com> 2 3 [InputElement] Return empty string for an invalid floating-point number that ends with "." 4 https://bugs.webkit.org/show_bug.cgi?id=236700 5 6 Reviewed by Chris Dumez. 7 8 As per specs https://html.spec.whatwg.org/multipage/input.html#number-state-(type%3Dnumber), 9 "If the value of the element is not a valid floating-point number, then set it to the empty 10 string instead". 11 12 * html/parser/HTMLParserIdioms.cpp: 13 (WebCore::parseToDoubleForNumberType): 14 1 15 2022-02-18 Antoine Quint <graouts@webkit.org> 2 16 -
trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp
r282242 r290124 131 131 return fallbackValue; 132 132 133 if (string.endsWith('.')) 134 return fallbackValue; 135 133 136 bool valid = false; 134 137 double value = string.toDouble(&valid);
Note: See TracChangeset
for help on using the changeset viewer.