Changeset 289075 in webkit


Ignore:
Timestamp:
Feb 3, 2022 1:34:50 PM (6 months ago)
Author:
Ziran Sun
Message:

[Forms] Value doesn't change for stepUp()/stepDown() with out of range values
https://bugs.webkit.org/show_bug.cgi?id=235509

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

  • web-platform-tests/html/semantics/forms/the-input-element/input-stepdown-expected.txt:
  • web-platform-tests/html/semantics/forms/the-input-element/input-stepup-expected.txt:
  • web-platform-tests/html/semantics/forms/the-input-element/range-expected.txt:

Source/WebCore:

For input type number, WebKit throws "invalid state" Error when the value is greater than
max when calling stepUp() or less than min when calling stepDown(). According to section 10
in https://html.spec.whatwg.org/multipage/input.html#dom-input-stepup,
we should do "return", which indicates that value doesn't change.

  • html/InputType.cpp:

(WebCore::InputType::applyStep):

LayoutTests:

Update expectation files.

  • fast/forms/date/date-stepup-stepdown-expected.txt:
  • fast/forms/date/date-stepup-stepdown.html:
  • fast/forms/datetimelocal/datetimelocal-stepup-stepdown-expected.txt:
  • fast/forms/datetimelocal/datetimelocal-stepup-stepdown.html:
  • fast/forms/month/month-stepup-stepdown-expected.txt:
  • fast/forms/month/month-stepup-stepdown.html:
  • fast/forms/number/number-stepup-stepdown-expected.txt:
  • fast/forms/number/number-stepup-stepdown.html:
  • fast/forms/range/range-stepup-stepdown-expected.txt:
  • fast/forms/range/range-stepup-stepdown.html:
  • fast/forms/time/time-stepup-stepdown-expected.txt:
  • fast/forms/time/time-stepup-stepdown.html:
  • fast/forms/week/week-stepup-stepdown-expected.txt:
  • fast/forms/week/week-stepup-stepdown.html:
  • platform/gtk/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/time-expected.txt:
  • platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/time-expected.txt:
  • platform/mac-wk1/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/input-stepdown-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/input-stepdown-expected.txt.
  • platform/mac-wk1/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/input-stepup-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/input-stepup-expected.txt.
  • platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/time-expected.txt:
Location:
trunk
Files:
24 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r289074 r289075  
     12022-02-03  Ziran Sun  <zsun@igalia.com>
     2
     3        [Forms] Value doesn't change for stepUp()/stepDown() with out of range values
     4        https://bugs.webkit.org/show_bug.cgi?id=235509
     5
     6        Reviewed by Chris Dumez.
     7
     8        Update expectation files.       
     9
     10        * fast/forms/date/date-stepup-stepdown-expected.txt:
     11        * fast/forms/date/date-stepup-stepdown.html:
     12        * fast/forms/datetimelocal/datetimelocal-stepup-stepdown-expected.txt:
     13        * fast/forms/datetimelocal/datetimelocal-stepup-stepdown.html:
     14        * fast/forms/month/month-stepup-stepdown-expected.txt:
     15        * fast/forms/month/month-stepup-stepdown.html:
     16        * fast/forms/number/number-stepup-stepdown-expected.txt:
     17        * fast/forms/number/number-stepup-stepdown.html:
     18        * fast/forms/range/range-stepup-stepdown-expected.txt:
     19        * fast/forms/range/range-stepup-stepdown.html:
     20        * fast/forms/time/time-stepup-stepdown-expected.txt:
     21        * fast/forms/time/time-stepup-stepdown.html:
     22        * fast/forms/week/week-stepup-stepdown-expected.txt:
     23        * fast/forms/week/week-stepup-stepdown.html:
     24        * platform/gtk/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/time-expected.txt:
     25        * platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/time-expected.txt:
     26        * platform/mac-wk1/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/input-stepdown-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/input-stepdown-expected.txt.
     27        * platform/mac-wk1/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/input-stepup-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/input-stepup-expected.txt.
     28        * platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/time-expected.txt:
     29
    1302022-02-03  Nikolaos Mouchtaris  <nmouchtaris@apple.com>
    231
  • trunk/LayoutTests/fast/forms/date/date-stepup-stepdown-expected.txt

    r219663 r289075  
    2525PASS stepDown("2010-02-10", "any", null) threw exception InvalidStateError: The object is in an invalid state..
    2626Overflow/underflow
    27 PASS stepUp("2010-02-10", "3.40282346e+38", null) threw exception InvalidStateError: The object is in an invalid state..
    28 PASS stepDown("2010-02-10", "3.40282346e+38", null) threw exception InvalidStateError: The object is in an invalid state..
    29 PASS stepUp("2010-02-10", "1", "2010-02-10") threw exception InvalidStateError: The object is in an invalid state..
    30 PASS stepDown("2010-02-10", "1", "2010-02-10") threw exception InvalidStateError: The object is in an invalid state..
     27PASS stepUp("2010-02-10", "3.40282346e+38", null) is "2010-02-10"
     28PASS stepDown("2010-02-10", "3.40282346e+38", null) is "2010-02-10"
     29PASS stepUp("2010-02-10", "1", "2010-02-10") is "2010-02-10"
     30PASS stepDown("2010-02-10", "1", "2010-02-10") is "2010-02-10"
    3131
    3232PASS successfullyParsed is true
  • trunk/LayoutTests/fast/forms/date/date-stepup-stepdown.html

    r219663 r289075  
    5959shouldThrowErrorName('stepDown("2010-02-10", "any", null)', "InvalidStateError");
    6060debug('Overflow/underflow');
    61 shouldThrowErrorName('stepUp("2010-02-10", "3.40282346e+38", null)', "InvalidStateError");
    62 shouldThrowErrorName('stepDown("2010-02-10", "3.40282346e+38", null)', "InvalidStateError");
    63 shouldThrowErrorName('stepUp("2010-02-10", "1", "2010-02-10")', "InvalidStateError");
    64 shouldThrowErrorName('stepDown("2010-02-10", "1", "2010-02-10")', "InvalidStateError");
     61shouldBe('stepUp("2010-02-10", "3.40282346e+38", null)', '"2010-02-10"');
     62shouldBe('stepDown("2010-02-10", "3.40282346e+38", null)', '"2010-02-10"');
     63shouldBe('stepUp("2010-02-10", "1", "2010-02-10")', '"2010-02-10"');
     64shouldBe('stepDown("2010-02-10", "1", "2010-02-10")', '"2010-02-10"');
    6565
    6666debug('');
  • trunk/LayoutTests/fast/forms/datetimelocal/datetimelocal-stepup-stepdown-expected.txt

    r219663 r289075  
    2525PASS stepDown("2010-02-10T20:13", "any", null) threw exception InvalidStateError: The object is in an invalid state..
    2626Overflow/underflow
    27 PASS stepUp("2010-02-10T20:13", "3.40282346e+38", null) threw exception InvalidStateError: The object is in an invalid state..
    28 PASS stepDown("2010-02-10T20:13", "3.40282346e+38", null) threw exception InvalidStateError: The object is in an invalid state..
    29 PASS stepUp("2010-02-10T20:13", "1", "2010-02-10T20:13") threw exception InvalidStateError: The object is in an invalid state..
    30 PASS stepDown("2010-02-10T20:13", "1", "2010-02-10T20:13") threw exception InvalidStateError: The object is in an invalid state..
     27PASS stepUp("2010-02-10T20:13", "3.40282346e+38", null) is "2010-02-10T20:13"
     28PASS stepDown("2010-02-10T20:13", "3.40282346e+38", null) is "2010-02-10T20:13"
     29PASS stepUp("2010-02-10T20:13", "1", "2010-02-10T20:13") is "2010-02-10T20:13"
     30PASS stepDown("2010-02-10T20:13", "1", "2010-02-10T20:13") is "2010-02-10T20:13"
    3131PASS successfullyParsed is true
    3232
  • trunk/LayoutTests/fast/forms/datetimelocal/datetimelocal-stepup-stepdown.html

    r219663 r289075  
    5959shouldThrowErrorName('stepDown("2010-02-10T20:13", "any", null)', "InvalidStateError");
    6060debug('Overflow/underflow');
    61 shouldThrowErrorName('stepUp("2010-02-10T20:13", "3.40282346e+38", null)', "InvalidStateError");
    62 shouldThrowErrorName('stepDown("2010-02-10T20:13", "3.40282346e+38", null)', "InvalidStateError");
    63 shouldThrowErrorName('stepUp("2010-02-10T20:13", "1", "2010-02-10T20:13")', "InvalidStateError");
    64 shouldThrowErrorName('stepDown("2010-02-10T20:13", "1", "2010-02-10T20:13")', "InvalidStateError");
     61shouldBe('stepUp("2010-02-10T20:13", "3.40282346e+38", null)', '"2010-02-10T20:13"');
     62shouldBe('stepDown("2010-02-10T20:13", "3.40282346e+38", null)', '"2010-02-10T20:13"');
     63shouldBe('stepUp("2010-02-10T20:13", "1", "2010-02-10T20:13")', '"2010-02-10T20:13"');
     64shouldBe('stepDown("2010-02-10T20:13", "1", "2010-02-10T20:13")', '"2010-02-10T20:13"');
    6565</script>
    6666<script src="../../../resources/js-test-post.js"></script>
  • trunk/LayoutTests/fast/forms/month/month-stepup-stepdown-expected.txt

    r219663 r289075  
    2525PASS stepDown("2010-02", "any", null) threw exception InvalidStateError: The object is in an invalid state..
    2626Overflow/underflow
    27 PASS stepUp("2010-02", "3.40282346e+38", null) threw exception InvalidStateError: The object is in an invalid state..
    28 PASS stepDown("2010-02", "3.40282346e+38", null) threw exception InvalidStateError: The object is in an invalid state..
    29 PASS stepUp("2010-02", "1", "2010-02") threw exception InvalidStateError: The object is in an invalid state..
    30 PASS stepDown("2010-02", "1", "2010-02") threw exception InvalidStateError: The object is in an invalid state..
     27PASS stepUp("2010-02", "3.40282346e+38", null) is "2010-02"
     28PASS stepDown("2010-02", "3.40282346e+38", null) is "2010-02"
     29PASS stepUp("2010-02", "1", "2010-02") is "2010-02"
     30PASS stepDown("2010-02", "1", "2010-02") is "2010-02"
    3131
    3232PASS successfullyParsed is true
  • trunk/LayoutTests/fast/forms/month/month-stepup-stepdown.html

    r219663 r289075  
    5959shouldThrowErrorName('stepDown("2010-02", "any", null)', "InvalidStateError");
    6060debug('Overflow/underflow');
    61 shouldThrowErrorName('stepUp("2010-02", "3.40282346e+38", null)', "InvalidStateError");
    62 shouldThrowErrorName('stepDown("2010-02", "3.40282346e+38", null)', "InvalidStateError");
    63 shouldThrowErrorName('stepUp("2010-02", "1", "2010-02")', "InvalidStateError");
    64 shouldThrowErrorName('stepDown("2010-02", "1", "2010-02")', "InvalidStateError");
     61shouldBe('stepUp("2010-02", "3.40282346e+38", null)', '"2010-02"');
     62shouldBe('stepDown("2010-02", "3.40282346e+38", null)', '"2010-02"');
     63shouldBe('stepUp("2010-02", "1", "2010-02")', '"2010-02"');
     64shouldBe('stepDown("2010-02", "1", "2010-02")', '"2010-02"');
    6565
    6666debug('');
  • trunk/LayoutTests/fast/forms/number/number-stepup-stepdown-expected.txt

    r219663 r289075  
    142142Overflow/underflow
    143143PASS stepDown("1", "1", "0") is "0"
    144 PASS stepDown("0", "1", "0") threw exception InvalidStateError: The object is in an invalid state..
    145 PASS stepDown("1", "1", "0", 2) threw exception InvalidStateError: The object is in an invalid state..
     144PASS stepDown("0", "1", "0") is "0"
     145PASS stepDown("1", "1", "0", 2) is "1"
    146146PASS input.value is "1"
    147 PASS stepDown("1", "3.40282346e+38", "", 2) threw exception InvalidStateError: The object is in an invalid state..
     147PASS stepDown("1", "3.40282346e+38", "", 2) is "1"
    148148PASS stepUp("-1", "1", "0") is "0"
    149 PASS stepUp("0", "1", "0") threw exception InvalidStateError: The object is in an invalid state..
    150 PASS stepUp("-1", "1", "0", 2) threw exception InvalidStateError: The object is in an invalid state..
     149PASS stepUp("0", "1", "0") is "0"
     150PASS stepUp("-1", "1", "0", 2) is "-1"
    151151PASS input.value is "-1"
    152 PASS stepUp("1", "3.40282346e+38", "", 2) threw exception InvalidStateError: The object is in an invalid state..
     152PASS stepUp("1", "3.40282346e+38", "", 2) is "1"
    153153
    154154stepDown()/stepUp() for stepMismatch values
  • trunk/LayoutTests/fast/forms/number/number-stepup-stepdown.html

    r219663 r289075  
    221221debug('Overflow/underflow');
    222222shouldBe('stepDown("1", "1", "0")', '"0"');
    223 shouldThrowErrorName('stepDown("0", "1", "0")', "InvalidStateError");
    224 shouldThrowErrorName('stepDown("1", "1", "0", 2)', "InvalidStateError");
     223shouldBe('stepDown("0", "1", "0")', '"0"');
     224shouldBe('stepDown("1", "1", "0", 2)', '"1"');
    225225shouldBe('input.value', '"1"');
    226 shouldThrowErrorName('stepDown("1", "3.40282346e+38", "", 2)', "InvalidStateError");
     226shouldBe('stepDown("1", "3.40282346e+38", "", 2)', '"1"');
    227227shouldBe('stepUp("-1", "1", "0")', '"0"');
    228 shouldThrowErrorName('stepUp("0", "1", "0")', "InvalidStateError");
    229 shouldThrowErrorName('stepUp("-1", "1", "0", 2)', "InvalidStateError");
     228shouldBe('stepUp("0", "1", "0")', '"0"');
     229shouldBe('stepUp("-1", "1", "0", 2)', '"-1"');
    230230shouldBe('input.value', '"-1"');
    231 shouldThrowErrorName('stepUp("1", "3.40282346e+38", "", 2)', "InvalidStateError");
     231shouldBe('stepUp("1", "3.40282346e+38", "", 2)', '"1"');
    232232
    233233debug('');
  • trunk/LayoutTests/fast/forms/range/range-stepup-stepdown-expected.txt

    r219663 r289075  
    140140Overflow/underflow
    141141PASS stepUpExplicitBounds(null, "100", "1", "99") is "100"
    142 PASS stepUpExplicitBounds(null, "100", "1", "100") threw exception InvalidStateError: The object is in an invalid state..
     142PASS stepUpExplicitBounds(null, "100", "1", "100") is "100"
    143143PASS input.value is "100"
    144 PASS stepUpExplicitBounds(null, "100", "1", "99", "2") threw exception InvalidStateError: The object is in an invalid state..
     144PASS stepUpExplicitBounds(null, "100", "1", "99", "2") is "99"
    145145PASS input.value is "99"
    146146PASS stepDownExplicitBounds("0", null, "1", "1") is "0"
    147 PASS stepDownExplicitBounds("0", null, "1", "0") threw exception InvalidStateError: The object is in an invalid state..
     147PASS stepDownExplicitBounds("0", null, "1", "0") is "0"
    148148PASS input.value is "0"
    149 PASS stepDownExplicitBounds("0", null, "1", "1", "2") threw exception InvalidStateError: The object is in an invalid state..
     149PASS stepDownExplicitBounds("0", null, "1", "1", "2") is "1"
    150150PASS input.value is "1"
    151 PASS stepDownExplicitBounds(null, null, "3.40282346e+38", "1", "2") threw exception InvalidStateError: The object is in an invalid state..
     151PASS stepDownExplicitBounds(null, null, "3.40282346e+38", "1", "2") is "0"
    152152PASS stepUpExplicitBounds(-100, 0, 1, -1) is "0"
    153 PASS stepUpExplicitBounds(null, 0, 1, 0) threw exception InvalidStateError: The object is in an invalid state..
    154 PASS stepUpExplicitBounds(-100, 0, 1, -1, 2) threw exception InvalidStateError: The object is in an invalid state..
     153PASS stepUpExplicitBounds(null, 0, 1, 0) is "0"
     154PASS stepUpExplicitBounds(-100, 0, 1, -1, 2) is "-1"
    155155PASS input.value is "-1"
    156 PASS stepUpExplicitBounds(null, null, "3.40282346e+38", "1", "2") threw exception InvalidStateError: The object is in an invalid state..
     156PASS stepUpExplicitBounds(null, null, "3.40282346e+38", "1", "2") is "0"
    157157
    158158stepDown()/stepUp() for stepMismatch values
     
    163163
    164164value + step is <= max, but rounded result would be > max.
    165 PASS stepUpExplicitBounds(null, 99, 10, 89) threw exception InvalidStateError: The object is in an invalid state..
     165PASS stepUpExplicitBounds(null, 99, 10, 89) is "90"
    166166
    167167Huge value and small step
  • trunk/LayoutTests/fast/forms/range/range-stepup-stepdown.html

    r219663 r289075  
    230230debug('Overflow/underflow');
    231231shouldBe('stepUpExplicitBounds(null, "100", "1", "99")', '"100"');
    232 shouldThrowErrorName('stepUpExplicitBounds(null, "100", "1", "100")', "InvalidStateError");
     232shouldBe('stepUpExplicitBounds(null, "100", "1", "100")', '"100"');
    233233shouldBe('input.value', '"100"');
    234 shouldThrowErrorName('stepUpExplicitBounds(null, "100", "1", "99", "2")', "InvalidStateError");
     234shouldBe('stepUpExplicitBounds(null, "100", "1", "99", "2")', '"99"');
    235235shouldBe('input.value', '"99"');
    236236shouldBe('stepDownExplicitBounds("0", null, "1", "1")', '"0"');
    237 shouldThrowErrorName('stepDownExplicitBounds("0", null, "1", "0")', "InvalidStateError");
     237shouldBe('stepDownExplicitBounds("0", null, "1", "0")', '"0"');
    238238shouldBe('input.value', '"0"');
    239 shouldThrowErrorName('stepDownExplicitBounds("0", null, "1", "1", "2")', "InvalidStateError");
     239shouldBe('stepDownExplicitBounds("0", null, "1", "1", "2")', '"1"');
    240240shouldBe('input.value', '"1"');
    241 shouldThrowErrorName('stepDownExplicitBounds(null, null, "3.40282346e+38", "1", "2")', "InvalidStateError");
     241shouldBe('stepDownExplicitBounds(null, null, "3.40282346e+38", "1", "2")', '"0"');
    242242shouldBe('stepUpExplicitBounds(-100, 0, 1, -1)', '"0"');
    243 shouldThrowErrorName('stepUpExplicitBounds(null, 0, 1, 0)', "InvalidStateError");
    244 shouldThrowErrorName('stepUpExplicitBounds(-100, 0, 1, -1, 2)', "InvalidStateError");
     243shouldBe('stepUpExplicitBounds(null, 0, 1, 0)', '"0"');
     244shouldBe('stepUpExplicitBounds(-100, 0, 1, -1, 2)', '"-1"');
    245245shouldBe('input.value', '"-1"');
    246 shouldThrowErrorName('stepUpExplicitBounds(null, null, "3.40282346e+38", "1", "2")', "InvalidStateError");
     246shouldBe('stepUpExplicitBounds(null, null, "3.40282346e+38", "1", "2")', '"0"');
    247247
    248248debug('');
     
    255255debug('');
    256256debug('value + step is <= max, but rounded result would be > max.');
    257 shouldThrowErrorName('stepUpExplicitBounds(null, 99, 10, 89)', "InvalidStateError");
     257shouldBe('stepUpExplicitBounds(null, 99, 10, 89)', '"90"');
    258258
    259259debug('');
  • trunk/LayoutTests/fast/forms/time/time-stepup-stepdown-expected.txt

    r219663 r289075  
    2525PASS stepDown("20:13", "any", null) threw exception InvalidStateError: The object is in an invalid state..
    2626Overflow/underflow
    27 PASS stepUp("20:13", "3.40282346e+38", null) threw exception InvalidStateError: The object is in an invalid state..
    28 PASS stepDown("20:13", "3.40282346e+38", null) threw exception InvalidStateError: The object is in an invalid state..
    29 PASS stepUp("20:13", "1", "20:13") threw exception InvalidStateError: The object is in an invalid state..
    30 PASS stepDown("20:13", "1", "20:13") threw exception InvalidStateError: The object is in an invalid state..
    31 PASS stepUp("23:59", null, null) threw exception InvalidStateError: The object is in an invalid state..
    32 PASS stepDown("00:00", null, null) threw exception InvalidStateError: The object is in an invalid state..
     27PASS stepUp("20:13", "3.40282346e+38", null) is "20:13"
     28PASS stepDown("20:13", "3.40282346e+38", null) is "20:13"
     29PASS stepUp("20:13", "1", "20:13") is "20:13"
     30PASS stepDown("20:13", "1", "20:13") is "20:13"
     31PASS stepUp("23:59", null, null) is "23:59"
     32PASS stepDown("00:00", null, null) is "00:00"
    3333
    3434PASS successfullyParsed is true
  • trunk/LayoutTests/fast/forms/time/time-stepup-stepdown.html

    r219663 r289075  
    5959shouldThrowErrorName('stepDown("20:13", "any", null)', "InvalidStateError");
    6060debug('Overflow/underflow');
    61 shouldThrowErrorName('stepUp("20:13", "3.40282346e+38", null)', "InvalidStateError");
    62 shouldThrowErrorName('stepDown("20:13", "3.40282346e+38", null)', "InvalidStateError");
    63 shouldThrowErrorName('stepUp("20:13", "1", "20:13")', "InvalidStateError");
    64 shouldThrowErrorName('stepDown("20:13", "1", "20:13")', "InvalidStateError");
    65 shouldThrowErrorName('stepUp("23:59", null, null)', "InvalidStateError");
    66 shouldThrowErrorName('stepDown("00:00", null, null)', "InvalidStateError");
     61shouldBe('stepUp("20:13", "3.40282346e+38", null)', '"20:13"');
     62shouldBe('stepDown("20:13", "3.40282346e+38", null)', '"20:13"');
     63shouldBe('stepUp("20:13", "1", "20:13")', '"20:13"');
     64shouldBe('stepDown("20:13", "1", "20:13")', '"20:13"');
     65shouldBe('stepUp("23:59", null, null)', '"23:59"');
     66shouldBe('stepDown("00:00", null, null)', '"00:00"');
    6767
    6868debug('');
  • trunk/LayoutTests/fast/forms/week/week-stepup-stepdown-expected.txt

    r219663 r289075  
    2525PASS stepDown("2010-W02", "any", null) threw exception InvalidStateError: The object is in an invalid state..
    2626Overflow/underflow
    27 PASS stepUp("2010-W02", "3.40282346e+38", null) threw exception InvalidStateError: The object is in an invalid state..
    28 PASS stepDown("2010-W02", "3.40282346e+38", null) threw exception InvalidStateError: The object is in an invalid state..
    29 PASS stepUp("2010-W02", "1", "2010-W02") threw exception InvalidStateError: The object is in an invalid state..
    30 PASS stepDown("2010-W02", "1", "2010-W02") threw exception InvalidStateError: The object is in an invalid state..
     27PASS stepUp("2010-W02", "3.40282346e+38", null) is "2010-W02"
     28PASS stepDown("2010-W02", "3.40282346e+38", null) is "2010-W02"
     29PASS stepUp("2010-W02", "1", "2010-W02") is "2010-W02"
     30PASS stepDown("2010-W02", "1", "2010-W02") is "2010-W02"
    3131
    3232PASS successfullyParsed is true
  • trunk/LayoutTests/fast/forms/week/week-stepup-stepdown.html

    r219663 r289075  
    5959shouldThrowErrorName('stepDown("2010-W02", "any", null)', "InvalidStateError");
    6060debug('Overflow/underflow');
    61 shouldThrowErrorName('stepUp("2010-W02", "3.40282346e+38", null)', "InvalidStateError");
    62 shouldThrowErrorName('stepDown("2010-W02", "3.40282346e+38", null)', "InvalidStateError");
    63 shouldThrowErrorName('stepUp("2010-W02", "1", "2010-W02")', "InvalidStateError");
    64 shouldThrowErrorName('stepDown("2010-W02", "1", "2010-W02")', "InvalidStateError");
     61shouldBe('stepUp("2010-W02", "3.40282346e+38", null)', '"2010-W02"');
     62shouldBe('stepDown("2010-W02", "3.40282346e+38", null)', '"2010-W02"');
     63shouldBe('stepUp("2010-W02", "1", "2010-W02")', '"2010-W02"');
     64shouldBe('stepDown("2010-W02", "1", "2010-W02")', '"2010-W02"');
    6565
    6666debug('');
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r289058 r289075  
     12022-02-03  Ziran Sun  <zsun@igalia.com>
     2
     3        [Forms] Value doesn't change for stepUp()/stepDown() with out of range values
     4        https://bugs.webkit.org/show_bug.cgi?id=235509
     5
     6        Reviewed by Chris Dumez.
     7
     8        * web-platform-tests/html/semantics/forms/the-input-element/input-stepdown-expected.txt:
     9        * web-platform-tests/html/semantics/forms/the-input-element/input-stepup-expected.txt:
     10        * web-platform-tests/html/semantics/forms/the-input-element/range-expected.txt:
     11
    1122022-02-03  Chris Dumez  <cdumez@apple.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/input-stepdown-expected.txt

    r267646 r289075  
    44
    55PASS Forms
    6 FAIL Calling stepDown() on input - number - where value < min should not modify value. The object is in an invalid state.
    7 FAIL Calling stepDown() on input - date - where value < min should not modify value. The object is in an invalid state.
    8 FAIL Calling stepDown() on input - datetime-local - where value < min should not modify value. The object is in an invalid state.
    9 FAIL Calling stepDown() on input - month - where value < min should not modify value. The object is in an invalid state.
    10 FAIL Calling stepDown() on input - time - where value < min should not modify value. The object is in an invalid state.
    11 FAIL Calling stepDown() on input - week - where value < min should not modify value. The object is in an invalid state.
     6PASS Calling stepDown() on input - number - where value < min should not modify value.
     7PASS Calling stepDown() on input - date - where value < min should not modify value.
     8PASS Calling stepDown() on input - datetime-local - where value < min should not modify value.
     9PASS Calling stepDown() on input - month - where value < min should not modify value.
     10PASS Calling stepDown() on input - time - where value < min should not modify value.
     11PASS Calling stepDown() on input - week - where value < min should not modify value.
    1212
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/input-stepup-expected.txt

    r267646 r289075  
    55
    66PASS Forms
    7 FAIL Calling stepUp() on input -number- where value > max should not modify value. The object is in an invalid state.
    8 FAIL Calling stepUp() on input -date- where value > max should not modify value. The object is in an invalid state.
    9 FAIL Calling stepUp() on input -datetime-local- where value > max should not modify value. The object is in an invalid state.
    10 FAIL Calling stepUp() on input -month- where value > max should not modify value. The object is in an invalid state.
    11 FAIL Calling stepUp() on input -time- where value > max should not modify value. The object is in an invalid state.
    12 FAIL Calling stepUp() on input -week- where value > max should not modify value. The object is in an invalid state.
     7PASS Calling stepUp() on input -number- where value > max should not modify value.
     8PASS Calling stepUp() on input -date- where value > max should not modify value.
     9PASS Calling stepUp() on input -datetime-local- where value > max should not modify value.
     10PASS Calling stepUp() on input -month- where value > max should not modify value.
     11PASS Calling stepUp() on input -time- where value > max should not modify value.
     12PASS Calling stepUp() on input -week- where value > max should not modify value.
    1313
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/range-expected.txt

    r267646 r289075  
    2222PASS Performing stepUp()
    2323PASS Performing stepDown()
    24 FAIL Performing stepUp() beyond the value of the max attribute The object is in an invalid state.
    25 FAIL Performing stepDown() beyond the value of the min attribute The object is in an invalid state.
     24FAIL Performing stepUp() beyond the value of the max attribute assert_equals: expected "12" but got "9"
     25FAIL Performing stepDown() beyond the value of the min attribute assert_equals: expected "3" but got "6"
    2626FAIL Skip ASCII whitespace within input assert_equals: expected "123" but got "50"
    2727PASS 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

    r276481 r289075  
    2828PASS stepUp argument 2 times
    2929PASS stepDown argument 2 times
    30 FAIL stepUp stop because it exceeds the maximum value The object is in an invalid state.
    31 FAIL stepDown stop so lower than the minimum value The object is in an invalid state.
    32 FAIL stop at border on stepUp The object is in an invalid state.
    33 FAIL stop at border on stepDown The object is in an invalid state.
     30PASS stepUp stop because it exceeds the maximum value
     31PASS stepDown stop so lower than the minimum value
     32FAIL 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"]
     33FAIL 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"]
    3434FAIL  empty value of stepUp The object is in an invalid state.
    3535PASS set value on not time format value
  • trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/time-expected.txt

    r267658 r289075  
    2828PASS stepUp argument 2 times
    2929PASS stepDown argument 2 times
    30 FAIL stepUp stop because it exceeds the maximum value The object is in an invalid state.
    31 FAIL stepDown stop so lower than the minimum value The object is in an invalid state.
    32 FAIL stop at border on stepUp The object is in an invalid state.
    33 FAIL stop at border on stepDown The object is in an invalid state.
     30PASS stepUp stop because it exceeds the maximum value
     31PASS stepDown stop so lower than the minimum value
     32FAIL 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"]
     33FAIL 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"]
    3434FAIL  empty value of stepUp The object is in an invalid state.
    3535PASS set value on not time format value
  • trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/input-stepdown-expected.txt

    r289074 r289075  
    44
    55PASS Forms
    6 FAIL Calling stepDown() on input - number - where value < min should not modify value. The object is in an invalid state.
     6PASS Calling stepDown() on input - number - where value < min should not modify value.
    77FAIL Calling stepDown() on input - date - where value < min should not modify value. The object is in an invalid state.
    88FAIL Calling stepDown() on input - datetime-local - where value < min should not modify value. The object is in an invalid state.
  • trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/input-stepup-expected.txt

    r289074 r289075  
    55
    66PASS Forms
    7 FAIL Calling stepUp() on input -number- where value > max should not modify value. The object is in an invalid state.
     7PASS Calling stepUp() on input -number- where value > max should not modify value.
    88FAIL Calling stepUp() on input -date- where value > max should not modify value. The object is in an invalid state.
    99FAIL Calling stepUp() on input -datetime-local- where value > max should not modify value. The object is in an invalid state.
  • trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/time-expected.txt

    r267658 r289075  
    2828PASS stepUp argument 2 times
    2929PASS stepDown argument 2 times
    30 FAIL stepUp stop because it exceeds the maximum value The object is in an invalid state.
    31 FAIL stepDown stop so lower than the minimum value The object is in an invalid state.
    32 FAIL stop at border on stepUp The object is in an invalid state.
    33 FAIL stop at border on stepDown The object is in an invalid state.
     30PASS stepUp stop because it exceeds the maximum value
     31PASS stepDown stop so lower than the minimum value
     32FAIL 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"]
     33FAIL 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"]
    3434FAIL  empty value of stepUp The object is in an invalid state.
    3535PASS set value on not time format value
  • trunk/Source/WebCore/ChangeLog

    r289074 r289075  
     12022-02-03  Ziran Sun  <zsun@igalia.com>
     2
     3        [Forms] Value doesn't change for stepUp()/stepDown() with out of range values
     4        https://bugs.webkit.org/show_bug.cgi?id=235509
     5
     6        Reviewed by Chris Dumez.
     7
     8        For input type number, WebKit throws "invalid state" Error when the value is greater than
     9        max when calling stepUp() or less than min when calling stepDown(). According to section 10
     10        in https://html.spec.whatwg.org/multipage/input.html#dom-input-stepup,
     11        we should do "return", which indicates that value doesn't change.
     12
     13        * html/InputType.cpp:
     14        (WebCore::InputType::applyStep):
     15
    1162022-02-03  Nikolaos Mouchtaris  <nmouchtaris@apple.com>
    217
  • trunk/Source/WebCore/html/InputType.cpp

    r287138 r289075  
    936936    const Decimal acceptableErrorValue = stepRange.acceptableError();
    937937    if (newValue - stepRange.minimum() < -acceptableErrorValue)
    938         return Exception { InvalidStateError };
     938        return { };
    939939    if (newValue < stepRange.minimum())
    940940        newValue = stepRange.minimum();
     
    944944
    945945    if (newValue - stepRange.maximum() > acceptableErrorValue)
    946         return Exception { InvalidStateError };
     946        return { };
    947947    if (newValue > stepRange.maximum())
    948948        newValue = stepRange.maximum();
Note: See TracChangeset for help on using the changeset viewer.