Changeset 92728 in webkit


Ignore:
Timestamp:
Aug 9, 2011 5:05:38 PM (13 years ago)
Author:
tkent@chromium.org
Message:

Move <input type=month> tests to fast/forms/month/
https://bugs.webkit.org/show_bug.cgi?id=65916

Reviewed by Tony Chang.

  • fast/forms/ValidityState-rangeOverflow-expected.txt: Removed month part.
  • fast/forms/ValidityState-rangeUnderflow-expected.txt: Removed month part.
  • fast/forms/ValidityState-stepMismatch-expected.txt: Removed month part.
  • fast/forms/ValidityState-typeMismatch-month-expected.txt: Removed.
  • fast/forms/ValidityState-typeMismatch-month.html: Removed.
  • fast/forms/date-input-visible-strings-expected.txt: Removed month part.
  • fast/forms/date-input-visible-strings.html: Removed month part.
  • fast/forms/input-stepup-stepdown-expected.txt: Removed month part.
  • fast/forms/input-stepup-stepdown-from-renderer-expected.txt: Removed month part.
  • fast/forms/input-type-change3-expected.txt: Removed month part.
  • fast/forms/input-valueasdate-expected.txt: Removed.
  • fast/forms/input-valueasdate-month-expected.txt: Removed.
  • fast/forms/input-valueasdate-month.html: Removed.
  • fast/forms/input-valueasdate.html: Removed.
  • fast/forms/input-valueasnumber-month-expected.txt: Removed.
  • fast/forms/input-valueasnumber-month.html: Removed.
  • fast/forms/month: Added.
  • fast/forms/month/ValidityState-rangeOverflow-month-expected.txt: Added.
  • fast/forms/month/ValidityState-rangeOverflow-month.html: Copied from LayoutTests/fast/forms/script-tests/ValidityState-rangeOverflow.js.
  • fast/forms/month/ValidityState-rangeUnderflow-month-expected.txt: Added.
  • fast/forms/month/ValidityState-rangeUnderflow-month.html: Copied from LayoutTests/fast/forms/script-tests/ValidityState-rangeUnderflow.js.
  • fast/forms/month/ValidityState-stepMismatch-month-expected.txt: Added.
  • fast/forms/month/ValidityState-stepMismatch-month.html: Copied from LayoutTests/fast/forms/script-tests/ValidityState-stepMismatch.js.
  • fast/forms/month/ValidityState-typeMismatch-month-expected.txt: Copied from LayoutTests/fast/forms/ValidityState-typeMismatch-month-expected.txt.
  • fast/forms/month/ValidityState-typeMismatch-month.html: Copied from LayoutTests/fast/forms/script-tests/ValidityState-typeMismatch-month.js.
  • fast/forms/month/input-valueasdate-expected.txt: Copied from LayoutTests/fast/forms/input-valueasdate-expected.txt.
  • fast/forms/month/input-valueasdate-month-expected.txt: Copied from LayoutTests/fast/forms/input-valueasdate-month-expected.txt.
  • fast/forms/month/input-valueasdate-month.html: Copied from LayoutTests/fast/forms/script-tests/input-valueasdate-month.js.
  • fast/forms/month/input-valueasdate.html: Copied from LayoutTests/fast/forms/script-tests/input-valueasdate.js.
  • fast/forms/month/input-valueasnumber-month-expected.txt: Copied from LayoutTests/fast/forms/input-valueasnumber-month-expected.txt.
  • fast/forms/month/input-valueasnumber-month.html: Copied from LayoutTests/fast/forms/script-tests/input-valueasnumber-month.js.
  • fast/forms/month/month-input-type-expected.txt: Added.
  • fast/forms/month/month-input-type.html: Copied from LayoutTests/fast/forms/week/week-input-type.html.
  • fast/forms/month/month-input-visible-string-expected.txt: Added.
  • fast/forms/month/month-input-visible-string.html: Copied from LayoutTests/fast/forms/week/week-input-visible-string.html.
  • fast/forms/month/month-stepup-stepdown-expected.txt: Added.
  • fast/forms/month/month-stepup-stepdown-from-renderer-expected.txt: Added.
  • fast/forms/month/month-stepup-stepdown-from-renderer.html: Copied from LayoutTests/fast/forms/script-tests/input-stepup-stepdown-from-renderer.js.
  • fast/forms/month/month-stepup-stepdown.html: Copied from LayoutTests/fast/forms/script-tests/input-stepup-stepdown.js.
  • fast/forms/script-tests/ValidityState-rangeOverflow.js: Removed month part.
  • fast/forms/script-tests/ValidityState-rangeUnderflow.js: Removed month part.
  • fast/forms/script-tests/ValidityState-stepMismatch.js: Removed month part.
  • fast/forms/script-tests/ValidityState-typeMismatch-month.js: Removed.
  • fast/forms/script-tests/input-stepup-stepdown-from-renderer.js: Removed month part.
  • fast/forms/script-tests/input-stepup-stepdown.js: Removed month part.
  • fast/forms/script-tests/input-type-change3.js: Removed month part.
  • fast/forms/script-tests/input-valueasdate-month.js: Removed.
  • fast/forms/script-tests/input-valueasdate.js: Removed.
  • fast/forms/script-tests/input-valueasnumber-month.js: Removed.
Location:
trunk/LayoutTests
Files:
8 added
4 deleted
15 edited
7 copied
8 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r92725 r92728  
     12011-08-09  Kent Tamura  <tkent@chromium.org>
     2
     3        Move <input type=month> tests to fast/forms/month/
     4        https://bugs.webkit.org/show_bug.cgi?id=65916
     5
     6        Reviewed by Tony Chang.
     7
     8        * fast/forms/ValidityState-rangeOverflow-expected.txt: Removed month part.
     9        * fast/forms/ValidityState-rangeUnderflow-expected.txt: Removed month part.
     10        * fast/forms/ValidityState-stepMismatch-expected.txt: Removed month part.
     11        * fast/forms/ValidityState-typeMismatch-month-expected.txt: Removed.
     12        * fast/forms/ValidityState-typeMismatch-month.html: Removed.
     13        * fast/forms/date-input-visible-strings-expected.txt: Removed month part.
     14        * fast/forms/date-input-visible-strings.html: Removed month part.
     15        * fast/forms/input-stepup-stepdown-expected.txt: Removed month part.
     16        * fast/forms/input-stepup-stepdown-from-renderer-expected.txt: Removed month part.
     17        * fast/forms/input-type-change3-expected.txt: Removed month part.
     18        * fast/forms/input-valueasdate-expected.txt: Removed.
     19        * fast/forms/input-valueasdate-month-expected.txt: Removed.
     20        * fast/forms/input-valueasdate-month.html: Removed.
     21        * fast/forms/input-valueasdate.html: Removed.
     22        * fast/forms/input-valueasnumber-month-expected.txt: Removed.
     23        * fast/forms/input-valueasnumber-month.html: Removed.
     24        * fast/forms/month: Added.
     25        * fast/forms/month/ValidityState-rangeOverflow-month-expected.txt: Added.
     26        * fast/forms/month/ValidityState-rangeOverflow-month.html: Copied from LayoutTests/fast/forms/script-tests/ValidityState-rangeOverflow.js.
     27        * fast/forms/month/ValidityState-rangeUnderflow-month-expected.txt: Added.
     28        * fast/forms/month/ValidityState-rangeUnderflow-month.html: Copied from LayoutTests/fast/forms/script-tests/ValidityState-rangeUnderflow.js.
     29        * fast/forms/month/ValidityState-stepMismatch-month-expected.txt: Added.
     30        * fast/forms/month/ValidityState-stepMismatch-month.html: Copied from LayoutTests/fast/forms/script-tests/ValidityState-stepMismatch.js.
     31        * fast/forms/month/ValidityState-typeMismatch-month-expected.txt: Copied from LayoutTests/fast/forms/ValidityState-typeMismatch-month-expected.txt.
     32        * fast/forms/month/ValidityState-typeMismatch-month.html: Copied from LayoutTests/fast/forms/script-tests/ValidityState-typeMismatch-month.js.
     33        * fast/forms/month/input-valueasdate-expected.txt: Copied from LayoutTests/fast/forms/input-valueasdate-expected.txt.
     34        * fast/forms/month/input-valueasdate-month-expected.txt: Copied from LayoutTests/fast/forms/input-valueasdate-month-expected.txt.
     35        * fast/forms/month/input-valueasdate-month.html: Copied from LayoutTests/fast/forms/script-tests/input-valueasdate-month.js.
     36        * fast/forms/month/input-valueasdate.html: Copied from LayoutTests/fast/forms/script-tests/input-valueasdate.js.
     37        * fast/forms/month/input-valueasnumber-month-expected.txt: Copied from LayoutTests/fast/forms/input-valueasnumber-month-expected.txt.
     38        * fast/forms/month/input-valueasnumber-month.html: Copied from LayoutTests/fast/forms/script-tests/input-valueasnumber-month.js.
     39        * fast/forms/month/month-input-type-expected.txt: Added.
     40        * fast/forms/month/month-input-type.html: Copied from LayoutTests/fast/forms/week/week-input-type.html.
     41        * fast/forms/month/month-input-visible-string-expected.txt: Added.
     42        * fast/forms/month/month-input-visible-string.html: Copied from LayoutTests/fast/forms/week/week-input-visible-string.html.
     43        * fast/forms/month/month-stepup-stepdown-expected.txt: Added.
     44        * fast/forms/month/month-stepup-stepdown-from-renderer-expected.txt: Added.
     45        * fast/forms/month/month-stepup-stepdown-from-renderer.html: Copied from LayoutTests/fast/forms/script-tests/input-stepup-stepdown-from-renderer.js.
     46        * fast/forms/month/month-stepup-stepdown.html: Copied from LayoutTests/fast/forms/script-tests/input-stepup-stepdown.js.
     47        * fast/forms/script-tests/ValidityState-rangeOverflow.js: Removed month part.
     48        * fast/forms/script-tests/ValidityState-rangeUnderflow.js: Removed month part.
     49        * fast/forms/script-tests/ValidityState-stepMismatch.js: Removed month part.
     50        * fast/forms/script-tests/ValidityState-typeMismatch-month.js: Removed.
     51        * fast/forms/script-tests/input-stepup-stepdown-from-renderer.js: Removed month part.
     52        * fast/forms/script-tests/input-stepup-stepdown.js: Removed month part.
     53        * fast/forms/script-tests/input-type-change3.js: Removed month part.
     54        * fast/forms/script-tests/input-valueasdate-month.js: Removed.
     55        * fast/forms/script-tests/input-valueasdate.js: Removed.
     56        * fast/forms/script-tests/input-valueasnumber-month.js: Removed.
     57
    1582011-08-09  Anders Carlsson  <andersca@apple.com>
    259
  • trunk/LayoutTests/fast/forms/ValidityState-rangeOverflow-expected.txt

    r92427 r92728  
    4949PASS The value "9999-01-01T23:59" doesn't overflow the maximum value "2010-12-31T00:00" when disabled.
    5050
    51 Type=month
    52 PASS The value "2010-01" doesn't overflow the maximum value "".
    53 PASS The value "2010-01" doesn't overflow the maximum value "".
    54 PASS The value "2010-01" doesn't overflow the maximum value "foo".
    55 PASS The value "2010-01" doesn't overflow the maximum value "2010-01".
    56 PASS The value "2010-01" doesn't overflow the maximum value "2010-02".
    57 PASS The value "2010-01" doesn't overflow the maximum value "2011-01".
    58 PASS The value "foo" doesn't overflow the maximum value "2011-01".
    59 PASS The value "2010-01" doesn't overflow the maximum value "0000-01".
    60 PASS The value "2010-01" overflows the maximum value "2009-12".
    61 PASS The value "9999-01" overflows the maximum value "2010-12".
    62 PASS The value "2010-01" overflows the maximum value "2009-12".
    63 PASS The value "9999-01" doesn't overflow the maximum value "2010-12" when disabled.
    64 
    6551Type=number
    6652PASS The value "99" doesn't overflow the maximum value "100".
  • trunk/LayoutTests/fast/forms/ValidityState-rangeUnderflow-expected.txt

    r92427 r92728  
    4949PASS The value "9999-01-01T12:00" doesn't underflow the minimum value "10000-12-31T12:00" when disabled.
    5050
    51 Type=month
    52 PASS The value "2010-01" doesn't underflow the minimum value "".
    53 PASS The value "2010-01" doesn't underflow the minimum value "".
    54 PASS The value "2010-01" doesn't underflow the minimum value "foo".
    55 PASS The value "1000-01" doesn't underflow the minimum value "".
    56 PASS The value "1582-10" doesn't underflow the minimum value "".
    57 PASS The value "2010-01" doesn't underflow the minimum value "2009-12".
    58 PASS The value "2010-01" doesn't underflow the minimum value "2009-01".
    59 PASS The value "foo" doesn't underflow the minimum value "2011-01".
    60 PASS The value "2010-01" undeflows the minimum value "2010-02".
    61 PASS The value "9999-01" undeflows the minimum value "10000-12".
    62 PASS The value "2010-01" undeflows the minimum value "2010-02".
    63 PASS The value "9999-01" doesn't underflow the minimum value "10000-12" when disabled.
    64 
    6551Type=number
    6652PASS The value "101" doesn't underflow the minimum value "100".
  • trunk/LayoutTests/fast/forms/ValidityState-stepMismatch-expected.txt

    r92427 r92728  
    1 Check stepMismatch results for type=date, datetime, datetime-local, month, time.
     1Check stepMismatch results for type=date, datetime, datetime-local, time.
    22
    33On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
     
    9696Disabled
    9797PASS stepMismatchFor("2010-02-09T12:34:55.001", "1", "2010-02-09T12:34:56", true) is false
    98 
    99 Month type
    100 Empty values
    101 PASS stepMismatchFor("", null, null) is false
    102 PASS stepMismatchFor("", "2", "1969-12") is false
    103 Normal step values
    104 PASS stepMismatchFor("2010-03", "2", "2010-02") is true
    105 PASS stepMismatchFor("2010-02", "2", "2010-02") is false
    106 PASS stepMismatchFor("2010-04", "2", "2010-02") is false
    107 PASS stepMismatchFor("1800-11", "3", "1800-09") is true
    108 PASS stepMismatchFor("1800-09", "3", "1800-09") is false
    109 PASS stepMismatchFor("1800-12", "3", "1800-09") is false
    110 PASS stepMismatchFor("275760-09", "3", "275760-08") is true
    111 PASS stepMismatchFor("275760-09", "2", "275760-09") is false
    112 Implicit step base
    113 PASS stepMismatchFor("1970-02", "2", null) is true
    114 PASS stepMismatchFor("1970-03", "2", null) is false
    115 Fractional step values
    116 PASS stepMismatchFor("2010-03", "0.1", "2010-02") is false
    117 PASS stepMismatchFor("2010-03", "1.1", "2010-02") is false
    118 PASS stepMismatchFor("2010-03", "1.9", "2010-02") is true
    119 Invalid or no step values
    120 PASS stepMismatchFor("2010-03", null, "2010-02") is false
    121 PASS stepMismatchFor("2010-03", "-1", "2010-02") is false
    122 PASS stepMismatchFor("2010-03", "foo", "2010-02") is false
    123 Special step value
    124 PASS stepMismatchFor("2010-03", "any", "2010-02") is false
    125 Disabled
    126 PASS stepMismatchFor("2010-03", "2", "2010-02", true) is false
    12798
    12899Number type
  • trunk/LayoutTests/fast/forms/date-input-visible-strings-expected.txt

    r92427 r92728  
    44datetime: value='2011-04-27T01:56:20.391Z' visible='2011-04-27T01:56:20.391Z'
    55datetime-local: value='2011-04-27T01:56:20.391' visible='2011-04-27T01:56:20.391'
    6 month: value='2011-04' visible='2011-04'
    76time: value='01:56:20.391' visible='01:56:20.391'
    87PASS successfullyParsed is true
  • trunk/LayoutTests/fast/forms/date-input-visible-strings.html

    r92427 r92728  
    1313        <input type="datetime"><br>
    1414        <input type="datetime-local"><br>
    15         <input type="month"><br>
    1615        <input type="time"><br>
    1716    </form>
  • trunk/LayoutTests/fast/forms/input-stepup-stepdown-expected.txt

    r92427 r92728  
    1 Check stepUp() and stepDown() bahevior for type=date, datetime, datetime-local, month, time.
     1Check stepUp() and stepDown() bahevior for type=date, datetime, datetime-local, time.
    22
    33On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
     
    8484PASS stepUp("2010-02-10T20:13", "1", "2010-02-10T20:13") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
    8585PASS stepDown("2010-02-10T20:13", "1", "2010-02-10T20:13") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
    86 
    87 Month type
    88 Invalid value
    89 PASS stepUp("", null, null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
    90 PASS stepDown("", null, null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
    91 Non-number arguments
    92 PASS stepUp("2010-02", null, null, "0") is "2010-02"
    93 PASS stepDown("2010-02", null, null, "0") is "2010-02"
    94 PASS stepUp("2010-02", null, null, "foo") is "2010-02"
    95 PASS stepDown("2010-02", null, null, "foo") is "2010-02"
    96 PASS stepUp("2010-02", null, null, null) is "2010-02"
    97 PASS stepDown("2010-02", null, null, null) is "2010-02"
    98 Normal cases
    99 PASS stepUp("2010-02", null, null) is "2010-03"
    100 PASS stepDown("2010-02", null, null) is "2010-01"
    101 PASS stepUp("2010-02", null, null, 10) is "2010-12"
    102 PASS stepDown("2010-02", null, null, 11) is "2009-03"
    103 PASS stepUp("1970-01", "4", null, 2) is "1970-09"
    104 PASS stepDown("1970-01", "4", null, 3) is "1969-01"
    105 Step=any
    106 PASS stepUp("2010-02", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
    107 PASS stepDown("2010-02", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
    108 Overflow/underflow
    109 PASS stepUp("2010-02", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
    110 PASS stepDown("2010-02", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
    111 PASS stepUp("2010-02", "1", "2010-02") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
    112 PASS stepDown("2010-02", "1", "2010-02") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
    11386
    11487Number type
  • trunk/LayoutTests/fast/forms/input-stepup-stepdown-from-renderer-expected.txt

    r92427 r92728  
    1 Check stepping-up and -down for  from renderer. No cases of empty initial values for type=date, datetime, datetime-local, month, time.
     1Check stepping-up and -down for  from renderer. No cases of empty initial values for type=date, datetime, datetime-local, time.
    22
    33On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
     
    6666PASS stepDown("2010-02-10T20:13", "3", "2010-02-10T20:12:56") is "2010-02-10T20:12:59"
    6767PASS stepUp("1970-01-01T00:13", "7", "") is "1970-01-01T00:13:04"
    68 
    69 Month type
    70 Function arguments are (value, step, {min or max}, [stepCount]).
    71 Normal cases
    72 PASS stepUp("2010-02", null, null) is "2010-03"
    73 PASS stepDown("2010-02", null, null) is "2010-01"
    74 PASS stepUp("2010-02", null, null, 10) is "2010-12"
    75 PASS stepDown("2010-02", null, null, 11) is "2009-03"
    76 PASS stepUp("1970-01", "4", null, 2) is "1970-09"
    77 PASS stepDown("1970-01", "4", null, 3) is "1969-01"
    78 Step=any
    79 PASS stepUp("2010-02", "any", null) is "2010-03"
    80 PASS stepDown("2010-02", "any", null) is "2010-01"
    81 Overflow/underflow
    82 PASS stepUp("2010-02", "3.40282346e+38", null) is "275760-09"
    83 PASS stepDown("2010-02", "3.40282346e+38", null) is "1970-01"
    84 PASS stepUp("2010-02", "1", "2010-02") is "2010-02"
    85 PASS stepDown("2010-02", "1", "2010-02") is "2010-02"
    86 stepDown()/stepUp() for stepMismatch values
    87 PASS stepDown("2010-02", "3", "2009-10") is "2010-01"
    88 PASS stepUp("1970-02", "4", "") is "1970-05"
    8968
    9069Number type
  • trunk/LayoutTests/fast/forms/input-type-change3-expected.txt

    r92427 r92728  
    2525PASS input.type for "isindex" is correctly "text".
    2626PASS input.type for "khtml_isindex" is correctly "".
    27 PASS input.type for "month" is correctly "month".
    2827PASS input.type for "number" is correctly "number".
    2928PASS input.type for "password" is correctly "password".
  • trunk/LayoutTests/fast/forms/month/ValidityState-rangeOverflow-month.html

    r92674 r92728  
    1 description('This test aims to check for rangeOverflow flag with input fields');
     1<!DOCTYPE html>
     2<html>
     3<head>
     4<link rel="stylesheet" href="../../js/resources/js-test-style.css">
     5<script src="../../js/resources/js-test-pre.js"></script>
     6</head>
     7<body>
     8<p id="description"></p>
     9<div id="console"></div>
     10<script>
     11description('This test aims to check for rangeOverflow flag with month input fields');
    212
    313var input = document.createElement('input');
     
    3343}
    3444
    35 // ----------------------------------------------------------------
    36 debug('Type=text');
    37 input.type = 'text';  // No overflow for type=text.
    38 checkNotOverflow('101', '100');
    39 
    40 // ----------------------------------------------------------------
    41 debug('');
    42 debug('Type=date');
    43 input.type = 'date';
    44 input.min = '';
    45 // No overflow cases
    46 checkNotOverflow('2010-01-27', null);
    47 checkNotOverflow('2010-01-27', '');
    48 checkNotOverflow('2010-01-27', 'foo');
    49 checkNotOverflow('2010-01-27', '2010-01-27');
    50 checkNotOverflow('2010-01-27', '2010-01-28');
    51 checkNotOverflow('2010-01-27', '2011-01-26');
    52 checkNotOverflow('foo', '2011-01-26');
    53 checkNotOverflow('2010-01-27', '0000-01-01'); // Too small max value.
    54 
    55 // Overflow cases
    56 checkOverflow('2010-01-27', '2010-01-26');
    57 checkOverflow('9999-01-01', '2010-12-31');
    58 input.min = '2010-01-28';  // value < min && value > max
    59 checkOverflow('2010-01-27', '2010-01-26');
    60 
    61 // Disabled
    62 checkNotOverflow('9999-01-01', '2010-12-31', true);
    63 
    64 // ----------------------------------------------------------------
    65 debug('');
    66 debug('Type=datetime');
    67 input.type = 'datetime';
    68 input.min = '';
    69 // No overflow cases
    70 checkNotOverflow('2010-01-27T12:34Z', null);
    71 checkNotOverflow('2010-01-27T12:34Z', '');
    72 checkNotOverflow('2010-01-27T12:34Z', 'foo');
    73 checkNotOverflow('2010-01-27T12:34Z', '2010-01-27T12:34Z');
    74 checkNotOverflow('2010-01-27T12:34Z', '2010-01-27T12:34:56Z');
    75 checkNotOverflow('2010-01-27T12:34Z', '2011-01-26T12:34Z');
    76 checkNotOverflow('foo', '2011-01-26T12:34Z');
    77 checkNotOverflow('2010-01-27T12:34Z', '0000-01-01T00:00Z'); // Too small max value.
    78 
    79 // Overflow cases
    80 checkOverflow('2010-01-27T12:34Z', '2010-01-26T12:33:59.999Z');
    81 checkOverflow('9999-01-01T23:59Z', '2010-12-31T00:00Z');
    82 input.min = '2010-01-28T12:00Z';  // value < min && value > max
    83 checkOverflow('2010-01-27T12:34Z', '2010-01-26T12:34Z');
    84 
    85 // Disabled
    86 checkNotOverflow('9999-01-01T23:59Z', '2010-12-31T00:00Z', true);
    87 
    88 // ----------------------------------------------------------------
    89 debug('');
    90 debug('Type=datetime-local');
    91 input.type = 'datetime-local';
    92 input.min = '';
    93 // No overflow cases
    94 checkNotOverflow('2010-01-27T12:34', null);
    95 checkNotOverflow('2010-01-27T12:34', '');
    96 checkNotOverflow('2010-01-27T12:34', 'foo');
    97 checkNotOverflow('2010-01-27T12:34', '2010-01-27T12:34');
    98 checkNotOverflow('2010-01-27T12:34', '2010-01-27T12:34:56');
    99 checkNotOverflow('2010-01-27T12:34', '2011-01-26T12:34');
    100 checkNotOverflow('foo', '2011-01-26T12:34');
    101 checkNotOverflow('2010-01-27T12:34', '0000-01-01T00:00'); // Too small max value.
    102 
    103 // Overflow cases
    104 checkOverflow('2010-01-27T12:34', '2010-01-26T12:33:59.999');
    105 checkOverflow('9999-01-01T23:59', '2010-12-31T00:00');
    106 input.min = '2010-01-28T12:00';  // value < min && value > max
    107 checkOverflow('2010-01-27T12:34', '2010-01-26T12:34');
    108 
    109 // Disabled
    110 checkNotOverflow('9999-01-01T23:59', '2010-12-31T00:00', true);
    111 
    112 // ----------------------------------------------------------------
    113 debug('');
    114 debug('Type=month');
    11545input.type = 'month';
    11646input.min = '';
     
    13464checkNotOverflow('9999-01', '2010-12', true);
    13565
    136 // ----------------------------------------------------------------
    137 debug('');
    138 debug('Type=number');
    139 input.type = 'number';
    140 input.min = '';
    141 checkNotOverflow('99', '100');  // Very normal case.
    142 checkNotOverflow('-101', '-100');
    143 checkNotOverflow('99', '1E+2');
    144 checkNotOverflow('0.99', '1.00');
    145 checkNotOverflow('abc', '100');  // Invalid value.
    146 checkNotOverflow('', '-1');  // No value.
    147 checkNotOverflow('101', '');  // No max.
    148 checkNotOverflow('101', 'xxx');  // Invalid max.
    149 // The following case should be rangeOverflow==true ideally.  But the "double" type doesn't have enough precision.
    150 checkNotOverflow('0.999999999999999999999999999999999999999999', '0.999999999999999999999999999999999999999998');
    151 
    152 // Overflow cases
    153 checkOverflow('101', '100');
    154 checkOverflow('-99', '-100');
    155 checkOverflow('101', '1E+2');
    156 input.min = '200';  // value < min && value > max
    157 checkOverflow('101', '100');
    158 
    159 // Disabled
    160 checkNotOverflow('101', '1E+2', true);
    161 
    162 // ----------------------------------------------------------------
    163 debug('');
    164 debug('Type=time');
    165 input.type = 'time';
    166 input.min = '';
    167 // No overflow cases
    168 checkNotOverflow('13:16', null);
    169 checkNotOverflow('13:16', '');
    170 checkNotOverflow('13:16', 'foo');
    171 checkNotOverflow('13:16', '13:16');
    172 checkNotOverflow('13:16', '13:17');
    173 checkNotOverflow('13:16', '14:15');
    174 checkNotOverflow('foo', '13:16');
    175 
    176 // Overflow cases
    177 checkOverflow('13:16', '13:15');
    178 checkOverflow('23:59:59.999', '13:16');
    179 input.min = '14:00';  // value < min && value > max
    180 checkOverflow('13:16', '12:00');
    181 
    182 // Disabled
    183 checkNotOverflow('23:59:59.999', '13:16', true);
    184 
    18566var successfullyParsed = true;
     67</script>
     68<script src="../../js/resources/js-test-post.js"></script>
     69</body>
     70</html>
  • trunk/LayoutTests/fast/forms/month/ValidityState-rangeUnderflow-month.html

    r92674 r92728  
    1 description('This test aims to check for rangeUnderflow flag with input fields');
     1<!DOCTYPE html>
     2<html>
     3<head>
     4<link rel="stylesheet" href="../../js/resources/js-test-style.css">
     5<script src="../../js/resources/js-test-pre.js"></script>
     6</head>
     7<body>
     8<p id="description"></p>
     9<div id="console"></div>
     10<script>
     11description('This test aims to check for rangeUnderflow flag with month input fields');
    212
    313var input = document.createElement('input');
     
    3343}
    3444
    35 // ----------------------------------------------------------------
    36 debug('Type=text');
    37 input.type = 'text';  // No underflow for type=text.
    38 checkNotUnderflow('99', '100');
    39 
    40 // ----------------------------------------------------------------
    41 debug('');
    42 debug('Type=date');
    43 input.type = 'date';
    44 input.max = '';
    45 // No underflow cases
    46 checkNotUnderflow('2010-01-27', null);
    47 checkNotUnderflow('2010-01-27', '');
    48 checkNotUnderflow('2010-01-27', 'foo');
    49 // 1000-01-01 is smaller than the implicit minimum value.
    50 // But the date parser rejects it before comparing the minimum value.
    51 checkNotUnderflow('1000-01-01', '');
    52 checkNotUnderflow('1582-10-15', '');
    53 checkNotUnderflow('2010-01-27', '2010-01-26');
    54 checkNotUnderflow('2010-01-27', '2009-01-28');
    55 checkNotUnderflow('foo', '2011-01-26');
    56 
    57 // Underflow cases
    58 checkUnderflow('2010-01-27', '2010-01-28');
    59 checkUnderflow('9999-01-01', '10000-12-31');
    60 input.max = '2010-01-01';  // value < min && value > max
    61 checkUnderflow('2010-01-27', '2010-02-01');
    62 
    63 // Disabled
    64 checkNotUnderflow('9999-01-01', '10000-12-31', true);
    65 
    66 // ----------------------------------------------------------------
    67 debug('');
    68 debug('Type=datetime');
    69 input.type = 'datetime';
    70 input.max = '';
    71 // No underflow cases
    72 checkNotUnderflow('2010-01-27T12:34Z', null);
    73 checkNotUnderflow('2010-01-27T12:34Z', '');
    74 checkNotUnderflow('2010-01-27T12:34Z', 'foo');
    75 // 1000-01-01 is smaller than the implicit minimum value.
    76 // But the date parser rejects it before comparing the minimum value.
    77 checkNotUnderflow('1000-01-01T12:34Z', '');
    78 checkNotUnderflow('1582-10-15T00:00Z', '');
    79 checkNotUnderflow('2010-01-27T12:34Z', '2010-01-26T00:00Z');
    80 checkNotUnderflow('2010-01-27T12:34Z', '2009-01-28T00:00Z');
    81 checkNotUnderflow('foo', '2011-01-26T00:00Z');
    82 
    83 // Underflow cases
    84 checkUnderflow('2010-01-27T12:34Z', '2010-01-27T13:00Z');
    85 checkUnderflow('9999-01-01T12:00Z', '10000-12-31T12:00Z');
    86 input.max = '2010-01-01T12:00Z';  // value < min && value > max
    87 checkUnderflow('2010-01-27T12:00Z', '2010-02-01T12:00Z');
    88 
    89 // Disabled
    90 checkNotUnderflow('9999-01-01T12:00Z', '10000-12-31T12:00Z', true);
    91 
    92 // ----------------------------------------------------------------
    93 debug('');
    94 debug('Type=datetime-local');
    95 input.type = 'datetime-local';
    96 input.max = '';
    97 // No underflow cases
    98 checkNotUnderflow('2010-01-27T12:34', null);
    99 checkNotUnderflow('2010-01-27T12:34', '');
    100 checkNotUnderflow('2010-01-27T12:34', 'foo');
    101 // 1000-01-01 is smaller than the implicit minimum value.
    102 // But the date parser rejects it before comparing the minimum value.
    103 checkNotUnderflow('1000-01-01T12:34', '');
    104 checkNotUnderflow('1582-10-15T00:00', '');
    105 checkNotUnderflow('2010-01-27T12:34', '2010-01-26T00:00');
    106 checkNotUnderflow('2010-01-27T12:34', '2009-01-28T00:00');
    107 checkNotUnderflow('foo', '2011-01-26T00:00');
    108 
    109 // Underflow cases
    110 checkUnderflow('2010-01-27T12:34', '2010-01-27T13:00');
    111 checkUnderflow('9999-01-01T12:00', '10000-12-31T12:00');
    112 input.max = '2010-01-01T12:00';  // value < min && value > max
    113 checkUnderflow('2010-01-27T12:00', '2010-02-01T12:00');
    114 
    115 // Disabled
    116 checkNotUnderflow('9999-01-01T12:00', '10000-12-31T12:00', true);
    117 
    118 // ----------------------------------------------------------------
    119 debug('');
    120 debug('Type=month');
    12145input.type = 'month';
    12246input.max = '';
     
    14266checkNotUnderflow('9999-01', '10000-12', true);
    14367
    144 // ----------------------------------------------------------------
    145 debug('');
    146 debug('Type=number');
    147 input.type = 'number';
    148 input.max = '';
    149 // No underflow cases
    150 input.type = 'number';
    151 checkNotUnderflow('101', '100');  // Very normal case.
    152 checkNotUnderflow('-99', '-100');
    153 checkNotUnderflow('101', '1E+2');
    154 checkNotUnderflow('1.01', '1.00');
    155 checkNotUnderflow('abc', '100');  // Invalid value.
    156 checkNotUnderflow('', '1');  // No value.
    157 checkNotUnderflow('-1', '');  // No min.
    158 checkNotUnderflow('-1', 'xxx');  // Invalid min.
    159 // The following case should be rangeUnderflow==true ideally.  But the "double" type doesn't have enough precision.
    160 checkNotUnderflow('0.999999999999999999999999999999999999999998', '0.999999999999999999999999999999999999999999');
    161 
    162 // Underflow cases
    163 checkUnderflow('99', '100');
    164 checkUnderflow('-101', '-100');
    165 checkUnderflow('99', '1E+2');
    166 input.max = '100';  // value < min && value > max
    167 checkUnderflow('101', '200');
    168 
    169 // Disabled
    170 checkNotUnderflow('99', '1E+2', true);
    171 
    172 // ----------------------------------------------------------------
    173 debug('');
    174 debug('Type=time');
    175 input.type = 'time';
    176 input.max = '';
    177 // No underflow cases
    178 checkNotUnderflow('13:16', null);
    179 checkNotUnderflow('13:16', '');
    180 checkNotUnderflow('13:16', 'foo');
    181 checkNotUnderflow('00:00:00.000', '');
    182 checkNotUnderflow('23:59:59.999', '');
    183 checkNotUnderflow('13:16', '11:00');
    184 checkNotUnderflow('13:16', '13:16');
    185 checkNotUnderflow('foo', '11:00');
    186 
    187 // Underflow cases
    188 checkUnderflow('13:16', '13:17');
    189 checkUnderflow('23:59', '23:59:30');
    190 input.max = '11:00';  // value < min && value > max
    191 checkUnderflow('13:16', '14:00');
    192 
    193 // Disabled
    194 checkNotUnderflow('23:59', '23:59:30', true);
    195 
    19668var successfullyParsed = true;
     69</script>
     70<script src="../../js/resources/js-test-post.js"></script>
     71</body>
     72</html>
  • trunk/LayoutTests/fast/forms/month/ValidityState-stepMismatch-month.html

    r92674 r92728  
    1 description('Check stepMismatch results for type=date, datetime, datetime-local, month, time.');
     1<!DOCTYPE html>
     2<html>
     3<head>
     4<link rel="stylesheet" href="../../js/resources/js-test-style.css">
     5<script src="../../js/resources/js-test-pre.js"></script>
     6</head>
     7<body>
     8<p id="description"></p>
     9<div id="console"></div>
     10<script>
     11description('Check stepMismatch results for type=month.');
    212
    313var input = document.createElement('input');
     
    1222}
    1323
    14 debug('Date type');
    15 input.type = 'date';
    16 debug('Empty values');
    17 shouldBeFalse('stepMismatchFor("", null, null)');
    18 shouldBeFalse('stepMismatchFor("", "2", "1969-12-31")');
    19 debug('Normal step values');
    20 shouldBeTrue('stepMismatchFor("2010-02-10", "2", "2010-02-09")');
    21 shouldBeFalse('stepMismatchFor("2010-02-09", "2", "2010-02-09")');
    22 shouldBeFalse('stepMismatchFor("2010-02-11", "2", "2010-02-09")');
    23 shouldBeTrue('stepMismatchFor("1800-11-11", "3", "1800-11-09")');
    24 shouldBeFalse('stepMismatchFor("1800-11-09", "3", "1800-11-09")');
    25 shouldBeFalse('stepMismatchFor("1800-11-12", "3", "1800-11-09")');
    26 shouldBeTrue('stepMismatchFor("275760-09-13", "3", "275760-09-11")');
    27 shouldBeFalse('stepMismatchFor("275760-09-13", "2", "275760-09-11")');
    28 debug('Implicit step base');
    29 shouldBeTrue('stepMismatchFor("1970-01-02", "2", null)');
    30 shouldBeFalse('stepMismatchFor("1970-01-03", "2", null)');
    31 debug('Fractional step values');
    32 shouldBeFalse('stepMismatchFor("2010-02-10", "0.1", "2010-02-09")');
    33 shouldBeFalse('stepMismatchFor("2010-02-10", "1.1", "2010-02-09")');
    34 shouldBeTrue('stepMismatchFor("2010-02-10", "1.9", "2010-02-09")');
    35 debug('Invalid or no step values');
    36 shouldBeFalse('stepMismatchFor("2010-02-10", null, "2010-02-09")');
    37 shouldBeFalse('stepMismatchFor("2010-02-10", "-1", "2010-02-09")');
    38 shouldBeFalse('stepMismatchFor("2010-02-10", "foo", "2010-02-09")');
    39 debug('Special step value');
    40 shouldBeFalse('stepMismatchFor("2010-02-10", "any", "2010-02-09")');
    41 debug('Disabled');
    42 shouldBeFalse('stepMismatchFor("2010-02-10", "2", "2010-02-09", true)');
    43 
    44 debug('');
    45 debug('Datetime type');
    46 input.type = 'datetime';
    47 debug('Empty values');
    48 shouldBeFalse('stepMismatchFor("", null, null)');
    49 shouldBeFalse('stepMismatchFor("", "2", "1969-12-31T12:34:56Z")');
    50 debug('Normal step values');
    51 shouldBeFalse('stepMismatchFor("2010-02-09T12:34:55Z", "1", "2010-02-09T12:34:56Z")');
    52 shouldBeTrue('stepMismatchFor("2010-02-09T12:34:55.001Z", "1", "2010-02-09T12:34:56Z")');
    53 shouldBeFalse('stepMismatchFor("2010-02-09T12:34:56.001Z", "0.001", "2010-02-09T12:34:56Z")');
    54 shouldBeTrue('stepMismatchFor("2010-02-09T12:34:55Z", "0.333", "2010-02-09T12:34:56Z")');
    55 shouldBeFalse('stepMismatchFor("2010-02-09T12:34:55.001Z", "0.333", "2010-02-09T12:34:56Z")');
    56 shouldBeFalse('stepMismatchFor("2010-02-09T12:34Z", "86400", "2010-02-08T12:34Z")');
    57 shouldBeTrue('stepMismatchFor("2010-02-09T12:34:56Z", "86400", "2010-02-08T12:34Z")');
    58 shouldBeTrue('stepMismatchFor("275760-09-13T00:00Z", "3", "275760-09-12T23:59:50Z")');
    59 shouldBeFalse('stepMismatchFor("275760-09-13T00:00Z", "2", "275760-09-12T23:59:50Z")');
    60 shouldBeTrue('stepMismatchFor("0001-01-01T00:00Z", "3", "0001-01-11T00:00:02Z")');
    61 shouldBeFalse('stepMismatchFor("0001-01-01T00:00Z", "2", "0001-01-11T00:00:02Z")');
    62 debug('Implicit step base');
    63 shouldBeFalse('stepMismatchFor("1970-01-01T12:34Z", "120", null)');
    64 shouldBeTrue('stepMismatchFor("1970-01-01T12:35Z", "120", null)');
    65 debug('Small step values');
    66 shouldBeFalse('stepMismatchFor("2010-02-10T12:34:56.000Z", "0.0003", "2010-02-10T12:34.55.000Z")');
    67 shouldBeTrue('stepMismatchFor("2010-02-10T12:34:55.001Z", "0.0019", "2010-02-10T12:34.55.000Z")');
    68 debug('Invalid or no step values');
    69 shouldBeFalse('stepMismatchFor("2010-02-10T12:34Z", null, "2010-02-09T12:34Z")');
    70 shouldBeTrue('stepMismatchFor("2010-02-10T12:34:56Z", null, "2010-02-09T12:34Z")');
    71 shouldBeFalse('stepMismatchFor("2010-02-10T12:34Z", "-1", "2010-02-09T12:34Z")');
    72 shouldBeFalse('stepMismatchFor("2010-02-10T12:34Z", "foo", "2010-02-09T12:34Z")');
    73 debug('Special step value');
    74 shouldBeFalse('stepMismatchFor("2010-02-09T12:34Z", "any", "2010-02-09T12:34Z")');
    75 debug('Disabled');
    76 shouldBeFalse('stepMismatchFor("2010-02-09T12:34:55.001Z", "1", "2010-02-09T12:34:56Z", true)');
    77 
    78 debug('');
    79 debug('Datetime-local type');
    80 input.type = 'datetime-local';
    81 debug('Empty values');
    82 shouldBeFalse('stepMismatchFor("", null, null)');
    83 shouldBeFalse('stepMismatchFor("", "2", "1969-12-31T12:34:56")');
    84 debug('Normal step values');
    85 shouldBeFalse('stepMismatchFor("2010-02-09T12:34:55", "1", "2010-02-09T12:34:56")');
    86 shouldBeTrue('stepMismatchFor("2010-02-09T12:34:55.001", "1", "2010-02-09T12:34:56")');
    87 shouldBeFalse('stepMismatchFor("2010-02-09T12:34:56.001", "0.001", "2010-02-09T12:34:56")');
    88 shouldBeTrue('stepMismatchFor("2010-02-09T12:34:55", "0.333", "2010-02-09T12:34:56")');
    89 shouldBeFalse('stepMismatchFor("2010-02-09T12:34:55.001", "0.333", "2010-02-09T12:34:56")');
    90 shouldBeFalse('stepMismatchFor("2010-02-09T12:34", "86400", "2010-02-08T12:34")');
    91 shouldBeTrue('stepMismatchFor("2010-02-09T12:34:56", "86400", "2010-02-08T12:34")');
    92 shouldBeTrue('stepMismatchFor("275760-09-13T00:00", "3", "275760-09-12T23:59:50")');
    93 shouldBeFalse('stepMismatchFor("275760-09-13T00:00", "2", "275760-09-12T23:59:50")');
    94 shouldBeTrue('stepMismatchFor("0001-01-01T00:00", "3", "0001-01-11T00:00:02")');
    95 shouldBeFalse('stepMismatchFor("0001-01-01T00:00", "2", "0001-01-11T00:00:02")');
    96 debug('Implicit step base');
    97 shouldBeFalse('stepMismatchFor("1970-01-01T12:34", "120", null)');
    98 shouldBeTrue('stepMismatchFor("1970-01-01T12:35", "120", null)');
    99 debug('Small step values');
    100 shouldBeFalse('stepMismatchFor("2010-02-10T12:34:56.000", "0.0003", "2010-02-10T12:34.55.000")');
    101 shouldBeTrue('stepMismatchFor("2010-02-10T12:34:55.001", "0.0019", "2010-02-10T12:34.55.000")');
    102 debug('Invalid or no step values');
    103 shouldBeFalse('stepMismatchFor("2010-02-10T12:34", null, "2010-02-09T12:34")');
    104 shouldBeTrue('stepMismatchFor("2010-02-10T12:34:56", null, "2010-02-09T12:34")');
    105 shouldBeFalse('stepMismatchFor("2010-02-10T12:34", "-1", "2010-02-09T12:34")');
    106 shouldBeFalse('stepMismatchFor("2010-02-10T12:34", "foo", "2010-02-09T12:34")');
    107 debug('Special step value');
    108 shouldBeFalse('stepMismatchFor("2010-02-09T12:34", "any", "2010-02-09T12:34")');
    109 debug('Disabled');
    110 shouldBeFalse('stepMismatchFor("2010-02-09T12:34:55.001", "1", "2010-02-09T12:34:56", true)');
    111 
    112 debug('');
    113 debug('Month type');
    11424input.type = 'month';
    11525debug('Empty values');
     
    14252
    14353debug('');
    144 debug('Number type');
    145 input.type = 'number';
    146 debug('Empty values');
    147 shouldBe('stepMismatchFor("", null, null)', 'false');
    148 shouldBe('stepMismatchFor("", "1.0", "0.1")', 'false');
    149 debug('Integers');
    150 shouldBe('stepMismatchFor("1", "2", "0")', 'true');
    151 shouldBe('stepMismatchFor("-3", "2", "-4")', 'true');
    152 shouldBe('input.max = "5"; stepMismatchFor("5", "3", "0")', 'true');
    153 shouldBe('input.value', '"5"');
    154 debug('Invalid step values');
    155 input.max = '';
    156 shouldBe('stepMismatchFor("-3", "-2", "-4")', 'false');
    157 shouldBe('stepMismatchFor("-3", null, "-4")', 'false');
    158 shouldBe('stepMismatchFor("-3", undefined, "-4")', 'false');
    159 debug('Huge numbers and small step; uncomparable');
    160 shouldBe('stepMismatchFor("3.40282347e+38", "3", "")', 'false');
    161 shouldBe('stepMismatchFor("3.40282346e+38", "3", "")', 'false');
    162 shouldBe('stepMismatchFor("3.40282345e+38", "3", "")', 'false');
    163 debug('Huge numbers and huge step');
    164 shouldBe('stepMismatchFor("3.20e+38", "0.20e+38", "")', 'false');
    165 shouldBe('stepMismatchFor("3.20e+38", "0.22e+38", "")', 'true');
    166 debug('Fractional numbers');
    167 shouldBe('stepMismatchFor("0.9", "0.1", "")', 'false');
    168 shouldBe('stepMismatchFor("0.9", "0.1000001", "")', 'true');
    169 shouldBe('stepMismatchFor("0.9", "0.1000000000000001", "")', 'false');
    170 shouldBe('stepMismatchFor("1.0", "0.3333333333333333", "")', 'false');
    171 debug('Rounding');
    172 shouldBe('stepMismatchFor("5.005", "0.005", "4")', 'false');
    173 debug('Disabled');
    174 shouldBe('stepMismatchFor("1", "2", "0", true)', 'false');
    175 
    176 debug('');
    177 debug('Range type');
    178 input.type = 'range';
    179 // The following test inputs are the same as inputs for type=numbe,
    180 // but all expected results should be 'false'.
    181 debug('Empty values');
    182 shouldBe('stepMismatchFor("", null, null)', 'false');
    183 shouldBe('stepMismatchFor("", "1.0", "0.1")', 'false');
    184 debug('Integers');
    185 shouldBe('stepMismatchFor("1", "2", "0")', 'false');
    186 shouldBe('stepMismatchFor("-3", "2", "-4")', 'false');
    187 shouldBe('input.max = "5"; stepMismatchFor("5", "3", "0")', 'false');
    188 shouldBe('input.value', '"3"'); // Different from type=number.
    189 debug('Invalid step values');
    190 input.max = '';
    191 shouldBe('stepMismatchFor("-3", "-2", "-4")', 'false');
    192 shouldBe('stepMismatchFor("-3", null, "-4")', 'false');
    193 shouldBe('stepMismatchFor("-3", undefined, "-4")', 'false');
    194 debug('Huge numbers and small step; uncomparable');
    195 shouldBe('stepMismatchFor("3.40282347e+38", "3", "")', 'false');
    196 shouldBe('stepMismatchFor("3.40282346e+38", "3", "")', 'false');
    197 shouldBe('stepMismatchFor("3.40282345e+38", "3", "")', 'false');
    198 debug('Huge numbers and huge step');
    199 shouldBe('stepMismatchFor("3.20e+38", "0.20e+38", "")', 'false');
    200 shouldBe('stepMismatchFor("3.20e+38", "0.22e+38", "")', 'false');
    201 debug('Fractional numbers');
    202 shouldBe('stepMismatchFor("0.9", "0.1", "")', 'false');
    203 shouldBe('stepMismatchFor("0.9", "0.1000001", "")', 'false');
    204 shouldBe('stepMismatchFor("0.9", "0.1000000000000001", "")', 'false');
    205 shouldBe('stepMismatchFor("1.0", "0.3333333333333333", "")', 'false');
    206 debug('Disabled');
    207 shouldBe('stepMismatchFor("1", "2", "0", true)', 'false');
    208 
    209 debug('');
    210 debug('Time type');
    211 input.type = 'time';
    212 debug('Empty values');
    213 shouldBeFalse('stepMismatchFor("", null, null)');
    214 shouldBeFalse('stepMismatchFor("", "2", "12:34:56")');
    215 debug('Normal step values');
    216 shouldBeFalse('stepMismatchFor("12:34:55", "1", "12:34:56")');
    217 shouldBeTrue('stepMismatchFor("12:34:55.001", "1", "12:34:56")');
    218 shouldBeFalse('stepMismatchFor("12:34:56.001", "0.001", "12:34:56")');
    219 shouldBeTrue('stepMismatchFor("12:34:55", "0.333", "12:34:56")');
    220 shouldBeFalse('stepMismatchFor("12:34:55.001", "0.333", "12:34:56")');
    221 shouldBeFalse('stepMismatchFor("12:34", "86400", "12:34")');
    222 shouldBeTrue('stepMismatchFor("23:59:59.998", "86399.999", "00:00")');
    223 shouldBeFalse('stepMismatchFor("23:59:59.999", "86399.999", "00:00")');
    224 debug('Implicit step base');
    225 shouldBeFalse('stepMismatchFor("12:34", "120", null)');
    226 shouldBeTrue('stepMismatchFor("12:35", "120", null)');
    227 debug('Small step values');
    228 shouldBeFalse('stepMismatchFor("12:34:55.001", "0.0003", "12:34.55.000")');
    229 shouldBeTrue('stepMismatchFor("12:34:55.001", "0.0019", "12:34.55.000")');
    230 shouldBeFalse('stepMismatchFor("12:34:55.004", "0.0019", "12:34.55.000")');
    231 debug('Invalid or no step values');
    232 shouldBeFalse('stepMismatchFor("12:34", null, "12:34")');
    233 shouldBeTrue('stepMismatchFor("12:34:56", null, "12:34")');
    234 shouldBeFalse('stepMismatchFor("12:34", "-1", "12:34")');
    235 shouldBeFalse('stepMismatchFor("12:34", "foo", "12:34")');
    236 debug('Special step value');
    237 shouldBeFalse('stepMismatchFor("12:35", "any", "12:34")');
    238 debug('Disabled');
    239 shouldBeFalse('stepMismatchFor("12:34:55.001", "1", "12:34:56", true)');
    240 
    241 debug('');
    242 debug('Unsupported types');
    243 shouldBe('input.type = "text"; input.step = "3"; input.min = ""; input.value = "2"; input.validity.stepMismatch', 'false');
    244 shouldBe('input.type = "button"; input.validity.stepMismatch', 'false');
    245 shouldBe('input.type = "checkbox"; input.validity.stepMismatch', 'false');
    246 shouldBe('input.type = "color"; input.validity.stepMismatch', 'false');
    247 shouldBe('input.type = "email"; input.validity.stepMismatch', 'false');
    248 shouldBe('input.type = "hidden"; input.validity.stepMismatch', 'false');
    249 shouldBe('input.type = "image"; input.validity.stepMismatch', 'false');
    250 shouldBe('input.type = "khtml_isindex"; input.validity.stepMismatch', 'false');
    251 shouldBe('input.type = "passwd"; input.validity.stepMismatch', 'false');
    252 shouldBe('input.type = "radio"; input.validity.stepMismatch', 'false');
    253 shouldBe('input.type = "reset"; input.validity.stepMismatch', 'false');
    254 shouldBe('input.type = "search"; input.validity.stepMismatch', 'false');
    255 shouldBe('input.type = "submit"; input.validity.stepMismatch', 'false');
    256 shouldBe('input.type = "tel"; input.validity.stepMismatch', 'false');
    257 shouldBe('input.type = "url"; input.validity.stepMismatch', 'false');
    258 shouldBe('input.type = "file"; input.validity.stepMismatch', 'false');
    259 
    26054var successfullyParsed = true;
     55<script src="../../js/resources/js-test-post.js"></script>
     56</body>
     57</html>
  • trunk/LayoutTests/fast/forms/month/ValidityState-typeMismatch-month.html

    r92674 r92728  
     1<!DOCTYPE html>
     2<html>
     3<head>
     4<link rel="stylesheet" href="../../js/resources/js-test-style.css">
     5<script src="../../js/resources/js-test-pre.js"></script>
     6</head>
     7<body>
     8<p id="description"></p>
     9<div id="console"></div>
     10<script>
    111description('This test aims to check for typeMismatch flag with type=month input fields');
    212var i = document.createElement('input');
     
    6676
    6777var successfullyParsed = true;
     78</script>
     79<script src="../../js/resources/js-test-post.js"></script>
     80</body>
     81</html>
  • trunk/LayoutTests/fast/forms/month/input-valueasdate-month.html

    r92674 r92728  
     1<!DOCTYPE html>
     2<html>
     3<head>
     4<link rel="stylesheet" href="../../js/resources/js-test-style.css">
     5<script src="../../js/resources/js-test-pre.js"></script>
     6</head>
     7<body>
     8<p id="description"></p>
     9<div id="console"></div>
     10<script>
    111description('Tests for .valueAsDate with &lt;input type=month>.');
    212
     
    4151
    4252var successfullyParsed = true;
     53</script>
     54<script src="../../js/resources/js-test-post.js"></script>
     55</body>
     56</html>
  • trunk/LayoutTests/fast/forms/month/input-valueasdate.html

    r92674 r92728  
     1<!DOCTYPE html>
     2<html>
     3<head>
     4<link rel="stylesheet" href="../../js/resources/js-test-style.css">
     5<script src="../../js/resources/js-test-pre.js"></script>
     6</head>
     7<body>
     8<p id="description"></p>
     9<div id="console"></div>
     10<script>
    111description('Test HTMLInputElement::valueAsDate binding.');
    212
     
    4151
    4252var successfullyParsed = true;
     53</script>
     54<script src="../../js/resources/js-test-post.js"></script>
     55</body>
     56</html>
  • trunk/LayoutTests/fast/forms/month/input-valueasnumber-month.html

    r92674 r92728  
     1<!DOCTYPE html>
     2<html>
     3<head>
     4<link rel="stylesheet" href="../../js/resources/js-test-style.css">
     5<script src="../../js/resources/js-test-pre.js"></script>
     6</head>
     7<body>
     8<p id="description"></p>
     9<div id="console"></div>
     10<script>
    111description('Tests for .valueAsNumber with &lt;input type=month>.');
    212
     
    4757
    4858var successfullyParsed = true;
     59</script>
     60<script src="../../js/resources/js-test-post.js"></script>
     61</body>
     62</html>
  • trunk/LayoutTests/fast/forms/month/month-input-type.html

    r92674 r92728  
    2323}
    2424
    25 check("week", "week");
    26 check("WEEK", "week");
    27 check(" week ", "text");
     25check("month", "month");
     26check("MONTH", "month");
     27check(" month ", "text");
    2828
    2929var successfullyParsed = true;
     
    3232</body>
    3333</html>
    34 
  • trunk/LayoutTests/fast/forms/month/month-input-visible-string.html

    r92674 r92728  
    66</head>
    77<body>
    8 <p>The user-visible values of week input fields should be localized if the platform has
     8<p>The user-visible values of month input fields should be localized if the platform has
    99a LocalizedDate implementation. Otherwise, they should be in the HTML5 formats.</p>
    1010
    1111    <form method="get" action="#">
    12         <input type="week"><br>
     12        <input type="month"><br>
    1313    </form>
    1414
  • trunk/LayoutTests/fast/forms/month/month-stepup-stepdown-from-renderer.html

    r92674 r92728  
    1 description('Check stepping-up and -down for <input> from renderer. No cases of empty initial values for type=date, datetime, datetime-local, month, time.');
     1<!DOCTYPE html>
     2<html>
     3<head>
     4<link rel="stylesheet" href="../../js/resources/js-test-style.css">
     5<script src="../../js/resources/js-test-pre.js"></script>
     6</head>
     7<body>
     8<p id="description"></p>
     9<div id="console"></div>
     10<script>
     11description('Check stepping-up and -down for month input fields from renderer. No cases of empty initial values.');
    212
    313var input = document.createElement('input');
     
    4555}
    4656
    47 // Range value gets automatically shifted based on bounds,
    48 // So always set the min and max first to get expected behavior
    49 
    50 function stepUpExplicitBounds(min, max, step, value, stepCount) {
    51     setInputAttributes(min, max, step, value);
    52     if (typeof stepCount !== 'undefined')
    53         if (stepCount < 0) {
    54             for (var i = 0; i < -stepCount; i++)
    55                 sendKey('Down');
    56         } else {
    57             for (var i = 0; i < stepCount; i++)
    58                 sendKey('Up');
    59         }
    60     else
    61         sendKey('Up');
    62     return input.value;
    63 }
    64 
    65 function stepDownExplicitBounds(min, max, step, value, stepCount) {
    66     setInputAttributes(min, max, step, value);
    67     if (typeof stepCount !== 'undefined')
    68         if (stepCount < 0) {
    69             for (var i = 0; i < -stepCount; i++)
    70                 sendKey('Up');
    71         } else {
    72             for (var i = 0; i < stepCount; i++)
    73                 sendKey('Down');
    74         }
    75     else
    76         sendKey('Down');
    77     return input.value;
    78 }
    79 
    80 debug('Date type');
    81 input.type = 'date';
    82 debug('Function arguments are (value, step, {min or max}, [stepCount]).');
    83 debug('Normal cases');
    84 shouldBe('stepUp("2010-02-10", null, null)', '"2010-02-11"');
    85 shouldBe('stepDown("2010-02-10", null, null)', '"2010-02-09"');
    86 shouldBe('stepUp("2010-02-10", null, null, 10)', '"2010-02-20"');
    87 shouldBe('stepDown("2010-02-10", null, null, 11)', '"2010-01-30"');
    88 shouldBe('stepUp("1970-01-01", "4", null, 2)', '"1970-01-09"');
    89 shouldBe('stepDown("1970-01-01", "4", null, 3)', '"1969-12-20"');
    90 debug('Step=any');
    91 shouldBe('stepUp("2010-02-10", "any", null)', '"2010-02-11"');
    92 shouldBe('stepDown("2010-02-10", "any", null)', '"2010-02-09"');
    93 debug('Overflow/underflow');
    94 shouldBe('stepUp("2010-02-10", "3.40282346e+38", null)','"275760-09-13"');
    95 shouldBe('stepDown("2010-02-10", "3.40282346e+38", null)', '"1970-01-01"');
    96 shouldBe('stepUp("2010-02-10", "1", "2010-02-10")', '"2010-02-10"');
    97 shouldBe('stepDown("2010-02-10", "1", "2010-02-10")', '"2010-02-10"');
    98 debug('stepDown()/stepUp() for stepMismatch values');
    99 shouldBe('stepDown("2010-02-10", "3", "2010-02-06")', '"2010-02-09"');
    100 shouldBe('stepUp("1970-01-02", "2", "")', '"1970-01-03"');
    101 
    102 debug('');
    103 debug('Datetime type');
    104 input.type = 'datetime';
    105 debug('Function arguments are (value, step, {min or max}, [stepCount]).');
    106 debug('Normal cases');
    107 shouldBe('stepUp("2010-02-10T20:13Z", null, null)', '"2010-02-10T20:14Z"');
    108 shouldBe('stepDown("2010-02-10T20:13Z", null, null)', '"2010-02-10T20:12Z"');
    109 shouldBe('stepUp("2010-02-10T20:13Z", null, null, 10)', '"2010-02-10T20:23Z"');
    110 shouldBe('stepDown("2010-02-10T20:13Z", null, null, 11)', '"2010-02-10T20:02Z"');
    111 shouldBe('stepUp("1970-01-01T20:13Z", "4", null, 2)', '"1970-01-01T20:13:08Z"');
    112 shouldBe('stepDown("1970-01-01T20:13Z", "4", null, 3)', '"1970-01-01T20:12:48Z"');
    113 debug('Step=any');
    114 shouldBe('stepUp("2010-02-10T20:13Z", "any", null)', '"2010-02-10T20:14Z"');
    115 shouldBe('stepDown("2010-02-10T20:13Z", "any", null)', '"2010-02-10T20:12Z"');
    116 debug('Overflow/underflow');
    117 shouldBe('stepUp("2010-02-10T20:13Z", "3.40282346e+38", null)', '"275760-09-13T00:00:00.000Z"');
    118 shouldBe('stepDown("2010-02-10T20:13Z", "3.40282346e+38", null)', '"1970-01-01T00:00:00.000Z"');
    119 shouldBe('stepUp("2010-02-10T20:13Z", "1", "2010-02-10T20:13Z")', '"2010-02-10T20:13Z"');
    120 shouldBe('stepDown("2010-02-10T20:13Z", "1", "2010-02-10T20:13Z")', '"2010-02-10T20:13Z"');
    121 debug('stepDown()/stepUp() for stepMismatch values');
    122 shouldBe('stepDown("2010-02-10T20:13Z", "3", "2010-02-10T20:12:56Z")', '"2010-02-10T20:12:59Z"');
    123 shouldBe('stepUp("1970-01-01T00:13Z", "7", "")', '"1970-01-01T00:13:04Z"');
    124 
    125 debug('');
    126 debug('Datetime-local type');
    127 input.type = 'datetime-local';
    128 debug('Function arguments are (value, step, {min or max}, [stepCount]).');
    129 debug('Normal cases');
    130 shouldBe('stepUp("2010-02-10T20:13", null, null)', '"2010-02-10T20:14"');
    131 shouldBe('stepDown("2010-02-10T20:13", null, null)', '"2010-02-10T20:12"');
    132 shouldBe('stepUp("2010-02-10T20:13", null, null, 10)', '"2010-02-10T20:23"');
    133 shouldBe('stepDown("2010-02-10T20:13", null, null, 11)', '"2010-02-10T20:02"');
    134 shouldBe('stepUp("1970-01-01T20:13", "4", null, 2)', '"1970-01-01T20:13:08"');
    135 shouldBe('stepDown("1970-01-01T20:13", "4", null, 3)', '"1970-01-01T20:12:48"');
    136 debug('Step=any');
    137 shouldBe('stepUp("2010-02-10T20:13", "any", null)', '"2010-02-10T20:14"');
    138 shouldBe('stepDown("2010-02-10T20:13", "any", null)', '"2010-02-10T20:12"');
    139 debug('Overflow/underflow');
    140 shouldBe('stepUp("2010-02-10T20:13", "3.40282346e+38", null)', '"275760-09-13T00:00:00.000"');
    141 shouldBe('stepDown("2010-02-10T20:13", "3.40282346e+38", null)', '"1970-01-01T00:00:00.000"');
    142 shouldBe('stepUp("2010-02-10T20:13", "1", "2010-02-10T20:13")', '"2010-02-10T20:13"');
    143 shouldBe('stepDown("2010-02-10T20:13", "1", "2010-02-10T20:13")', '"2010-02-10T20:13"');
    144 debug('stepDown()/stepUp() for stepMismatch values');
    145 shouldBe('stepDown("2010-02-10T20:13", "3", "2010-02-10T20:12:56")', '"2010-02-10T20:12:59"');
    146 shouldBe('stepUp("1970-01-01T00:13", "7", "")', '"1970-01-01T00:13:04"');
    147 
    148 debug('');
    149 debug('Month type');
    15057input.type = 'month';
    15158debug('Function arguments are (value, step, {min or max}, [stepCount]).');
     
    17077
    17178debug('');
    172 debug('Number type');
    173 input.type = 'number';
    174 debug('Function arguments are (value, step, {min or max}, [stepCount]).');
    175 debug('Invalid value');
    176 shouldBe('stepUp("", null, null)', '"1"');
    177 shouldBe('stepDown("", null, null)', '"-1"');
    178 shouldBe('stepUp("", "any", null)', '"1"');
    179 shouldBe('stepDown("", "any", null)', '"-1"');
    180 shouldBe('stepUp("", "foo", null)', '"1"');
    181 shouldBe('stepDown("", "foo", null)', '"-1"');
    182 shouldBe('stepUp("foo", null, null)', '"1"');
    183 shouldBe('stepDown("foo", null, null)', '"-1"');
    184 shouldBe('stepUp("foo", "any", null)', '"1"');
    185 shouldBe('stepDown("foo", "any", null)', '"-1"');
    186 shouldBe('stepUp("foo", "foo", null)', '"1"');
    187 shouldBe('stepDown("foo", "foo", null)', '"-1"');
    188 debug('Normal cases');
    189 shouldBe('stepUp("0", null, null)', '"1"');
    190 shouldBe('stepUp("1", null, null, 2)', '"3"');
    191 shouldBe('stepUp("3", null, null, -1)', '"2"');
    192 shouldBe('stepDown("2", null, null)', '"1"');
    193 shouldBe('stepDown("1", null, null, 2)', '"-1"');
    194 shouldBe('stepDown("-1", null, null, -1)', '"0"');
    195 debug('Invalid step value');
    196 shouldBe('stepUp("0", "foo", null)', '"1"');
    197 shouldBe('stepUp("1", "0", null)', '"2"');
    198 shouldBe('stepUp("2", "-1", null)', '"3"');
    199 debug('Step=any');
    200 shouldBe('stepUp("0", "any", null)', '"1"');
    201 shouldBe('stepDown("0", "any", null)', '"-1"');
    202 debug('Step=any corner case');
    203 shouldBe('stepUpExplicitBounds("0", "100", "any", "1.5", "1")', '"2.5"');
    204 shouldBe('stepDownExplicitBounds("0", "100", "any", "1.5", "1")', '"0.5"');
    205 debug('Overflow/underflow');
    206 shouldBe('stepDown("1", "1", "0")', '"0"');
    207 shouldBe('stepDown("0", "1", "0")', '"0"');
    208 shouldBe('stepDown("1", "1", "0", 2)', '"0"');
    209 shouldBe('stepDown("1", "3.40282346e+38", "", 2)', '"-3.40282346e+38"');
    210 shouldBe('stepUp("-1", "1", "0")', '"0"');
    211 shouldBe('stepUp("0", "1", "0")', '"0"');
    212 shouldBe('stepUp("-1", "1", "0", 2)', '"0"');
    213 shouldBe('stepUp("1", "3.40282346e+38", "", 2)', '"3.40282346e+38"');
    214 debug('stepDown()/stepUp() for stepMismatch values');
    215 shouldBe('stepUp("1", "2", "")', '"2"');
    216 shouldBe('input.min = "0"; stepUp("9", "10", "")', '"10"');
    217 shouldBe('stepDown("19", "10", "0")', '"10"');
    218 shouldBe('stepUp("89", "10", "99")', '"90"');
    219 debug('Huge value and small step');
    220 shouldBe('input.min = ""; stepUp("1e+38", "1", "", 999)', '"1e+38"');
    221 shouldBe('input.max = ""; stepDown("1e+38", "1", "", 999)', '"1e+38"');
    222 debug('Fractional numbers');
    223 shouldBe('input.min = ""; stepUp("0", "0.33333333333333333", "", 3)', '"1"');
    224 shouldBe('stepUp("1", "0.1", "", 10)', '"2"');
    225 shouldBe('input.min = "0"; stepUp("0", "0.003921568627450980", "1", 255)', '"1"');
    226 debug('Rounding');
    227 shouldBe('stepUp("5.005", "0.005", "", 2)', '"5.015"');
    228 shouldBe('stepUp("5.005", "0.005", "", 11)', '"5.06"');
    229 shouldBe('stepUp("5.005", "0.005", "", 12)', '"5.065"');
    230 shouldBe('stepUpExplicitBounds("4", "9", "0.005", "5.005", 2)', '"5.015"');
    231 shouldBe('stepUpExplicitBounds("4", "9", "0.005", "5.005", 11)', '"5.06"');
    232 shouldBe('stepUpExplicitBounds("4", "9", "0.005", "5.005", 12)', '"5.065"');
    233 shouldBe('stepUpExplicitBounds(-4, 4, 1, "")', '"1"');
    234 shouldBe('stepDownExplicitBounds(-4, 4, 1, "")', '"-1"');
    235 shouldBe('stepDownExplicitBounds(0, 4, 1, "")', '"0"');
    236 shouldBe('stepUpExplicitBounds(-4, 0, 1, "")', '"0"');
    237 shouldBe('stepDownExplicitBounds(1, 4, 1, "")', '"1"');
    238 shouldBe('stepUpExplicitBounds(1, 4, 1, "")', '"1"');
    239 shouldBe('stepDownExplicitBounds(-4, -1, 1, "")', '"-1"');
    240 shouldBe('stepUpExplicitBounds(-4, -1, 1, "")', '"-1"');
    241 shouldBe('stepUpExplicitBounds(-100, null, 3, "")', '"2"');
    242 shouldBe('stepDownExplicitBounds(-100, null, 3, "")', '"-1"');
    243 shouldBe('stepUpExplicitBounds(1, 4, 1, 0)', '"1"');
    244 shouldBe('stepDownExplicitBounds(1, 4, 1, 0)', '"0"');
    245 shouldBe('stepDownExplicitBounds(-4, -1, 1, 0)', '"-1"');
    246 shouldBe('stepUpExplicitBounds(-4, -1, 1, 0)', '"0"');
    247 shouldBe('stepUpExplicitBounds(-100, null, 3, 3)', '"5"');
    248 shouldBe('stepDownExplicitBounds(-100, null, 3, 3)', '"2"');
    249 
    250 debug('');
    251 debug('Range type');
    252 input.type = 'range';
    253 debug('Function arguments are (min, max, step, value, [stepCount]).');
    254 debug('Using the default values');
    255 shouldBe('stepUpExplicitBounds(null, null, null, "")', '"51"');
    256 shouldBe('stepDownExplicitBounds(null, null, null, "")', '"49"');
    257 shouldBe('stepUpExplicitBounds(null, null, "any", "")', '"51"');
    258 shouldBe('stepDownExplicitBounds(null, null, "any", "")', '"49"');
    259 shouldBe('stepUpExplicitBounds(null, null, "foo", "")', '"51"');
    260 shouldBe('stepDownExplicitBounds(null, null, "foo", "")', '"49"');
    261 shouldBe('stepUpExplicitBounds(null, null, null, "foo")', '"51"');
    262 shouldBe('stepDownExplicitBounds(null, null, null, "foo")', '"49"');
    263 shouldBe('stepUpExplicitBounds(null, null, "any", "foo")', '"51"');
    264 shouldBe('stepDownExplicitBounds(null, null, "any", "foo")', '"49"');
    265 shouldBe('stepUpExplicitBounds(null, null, "foo", "foo")', '"51"');
    266 shouldBe('stepDownExplicitBounds(null, null, "foo", "foo")', '"49"');
    267 debug('Normal cases');
    268 shouldBe('stepUpExplicitBounds(null, null, null, "0")', '"1"');
    269 shouldBe('stepUpExplicitBounds(null, null, null, "1", 2)', '"3"');
    270 shouldBe('stepUpExplicitBounds(null, null, null, "3", -1)', '"2"');
    271 shouldBe('stepDownExplicitBounds("-100", null, null, "2")', '"1"');
    272 shouldBe('stepDownExplicitBounds("-100", null, null, "1", 2)', '"-1"');
    273 shouldBe('stepDownExplicitBounds("-100", null, null, "-1", -1)', '"0"');
    274 debug('Invalid step value');
    275 shouldBe('stepUpExplicitBounds(null, null, "foo", "0")', '"1"');
    276 shouldBe('stepUpExplicitBounds(null, null, "0", "1")', '"2"');
    277 shouldBe('stepUpExplicitBounds(null, null, "-1", "2")', '"3"');
    278 shouldBe('stepDownExplicitBounds(null, null, "foo", "1")', '"0"');
    279 shouldBe('stepDownExplicitBounds(null, null, "0", "2")', '"1"');
    280 shouldBe('stepDownExplicitBounds(null, null, "-1", "3")', '"2"');
    281 debug('Step=any');
    282 shouldBe('stepUpExplicitBounds(null, null, "any", "1")', '"2"');
    283 shouldBe('stepDownExplicitBounds(null, null, "any", "1")', '"0"');
    284 debug('Overflow/underflow');
    285 shouldBe('stepUpExplicitBounds(null, "100", "1", "99")', '"100"');
    286 shouldBe('stepUpExplicitBounds(null, "100", "1", "100")', '"100"');
    287 shouldBe('stepUpExplicitBounds(null, "100", "1", "99", 2)', '"100"');
    288 shouldBe('stepDownExplicitBounds("0", null, "1", "1")', '"0"');
    289 shouldBe('stepDownExplicitBounds("0", null, "1", "0")', '"0"');
    290 shouldBe('stepDownExplicitBounds("0", null, "1", "1", 2)', '"0"');
    291 shouldBe('stepDownExplicitBounds(null, null, "3.40282346e+38", "1", 2)', '"0"');
    292 shouldBe('stepUpExplicitBounds(-100, 0, 1, -1)', '"0"');
    293 shouldBe('stepUpExplicitBounds(null, 0, 1, 0)', '"0"');
    294 shouldBe('stepUpExplicitBounds(-100, 0, 1, -1, 2)', '"0"');
    295 shouldBe('stepUpExplicitBounds(null, null, "3.40282346e+38", "1", 2)', '"0"');
    296 debug('stepDown()/stepUp() for stepMismatch values');
    297 shouldBe('stepUpExplicitBounds(null, null, 2, 1)', '"4"');
    298 shouldBe('stepUpExplicitBounds(0, null, 10, 9, 9)', '"100"');
    299 shouldBe('stepDownExplicitBounds(0, null, 10, 19)', '"10"');
    300 debug('value + step is <= max, but rounded result would be > max.');
    301 shouldBe('stepUpExplicitBounds(null, 99, 10, 89)', '"90"');
    302 debug('Huge value and small step');
    303 shouldBe('stepUpExplicitBounds(0, 1e38, 1, 1e38, 999)', '"1e+38"');
    304 shouldBe('stepDownExplicitBounds(0, 1e38, 1, 1e38, 999)', '"1e+38"');
    305 debug('Fractional numbers');
    306 shouldBe('stepUpExplicitBounds(null, null, 0.33333333333333333, 0, 3)', '"1"');
    307 shouldBe('stepUpExplicitBounds(null, null, 0.1, 1)', '"1.1"');
    308 shouldBe('stepUpExplicitBounds(null, null, 0.1, 1, 8)', '"1.8"');
    309 shouldBe('stepUpExplicitBounds(null, null, 0.1, 1, 10)', '"2"');
    310 shouldBe('stepUpExplicitBounds(0, 1, 0.003921568627450980, 0, 255)', '"1"');
    311 shouldBe('stepDownExplicitBounds(null, null, 0.1, 1, 8)', '"0.2"');
    312 shouldBe('stepDownExplicitBounds(null, null, 0.1, 1)', '"0.9"');
    313 
    314 debug('');
    315 debug('Time type');
    316 input.type = 'time';
    317 debug('Function arguments are (value, step, {min or max}, [stepCount]).');
    318 debug('Normal cases');
    319 shouldBe('stepUp("20:13", null, null)', '"20:14"');
    320 shouldBe('stepDown("20:13", null, null)', '"20:12"');
    321 shouldBe('stepUp("20:13", null, null, 10)', '"20:23"');
    322 shouldBe('stepDown("20:13", null, null, 11)', '"20:02"');
    323 shouldBe('stepUp("20:13", "4", null, 2)', '"20:13:08"');
    324 shouldBe('stepDown("20:13", "4", null, 3)', '"20:12:48"');
    325 debug('Step=any');
    326 shouldBe('stepUp("20:13", "any", null)', '"20:14"');
    327 shouldBe('stepDown("20:13", "any", null)', '"20:12"');
    328 debug('Overflow/underflow');
    329 shouldBe('stepUp("20:13", "3.40282346e+38", null)', '"23:59:59.999"');
    330 shouldBe('stepDown("20:13", "3.40282346e+38", null)', '"00:00:00.000"');
    331 shouldBe('stepUp("20:13", "1", "20:13")', '"20:13"');
    332 shouldBe('stepDown("20:13", "1", "20:13")', '"20:13"');
    333 shouldBe('stepUp("23:59", null, null)', '"23:59"');
    334 shouldBe('stepDown("00:00", null, null)', '"00:00"');
    335 debug('stepDown()/stepUp() for stepMismatch values');
    336 shouldBe('stepDown("20:13", "3", "20:12:56")', '"20:12:59"');
    337 shouldBe('stepUp("00:13", "7", "")', '"00:13:04"');
    338 
    339 debug('');
    34079var successfullyParsed = true;
     80</script>
     81<script src="../../js/resources/js-test-post.js"></script>
     82</body>
     83</html>
  • trunk/LayoutTests/fast/forms/month/month-stepup-stepdown.html

    r92674 r92728  
    1 description('Check stepUp() and stepDown() bahevior for type=date, datetime, datetime-local, month, time.');
     1<!DOCTYPE html>
     2<html>
     3<head>
     4<link rel="stylesheet" href="../../js/resources/js-test-style.css">
     5<script src="../../js/resources/js-test-pre.js"></script>
     6</head>
     7<body>
     8<p id="description"></p>
     9<div id="console"></div>
     10<script>
     11description('Check stepUp() and stepDown() bahevior for type=month.');
    212
    313var input = document.createElement('input');
     
    2939}
    3040
    31 // Range value gets automatically shifted based on bounds,
    32 // So always set the min and max first to get expected behavior
    33 
    34 function stepUpExplicitBounds(min, max, step, value, stepCount) {
    35     setInputAttributes(min, max, step, value);
    36     if (typeof stepCount !== 'undefined')
    37         input.stepUp(stepCount);
    38     else
    39         input.stepUp();
    40     return input.value;
    41 }
    42 
    43 function stepDownExplicitBounds(min, max, step, value, stepCount) {
    44     setInputAttributes(min, max, step, value);
    45     if (typeof stepCount !== 'undefined')
    46         input.stepDown(stepCount);
    47     else
    48         input.stepDown();
    49     return input.value;
    50 }
    51 
    52 debug('Date type');
    53 input.type = 'date';
    54 debug('Invalid value');
    55 shouldThrow('stepUp("", null, null)', invalidStateErr);
    56 shouldThrow('stepDown("", null, null)', invalidStateErr);
    57 debug('Non-number arguments');
    58 shouldBe('stepUp("2010-02-10", null, null, "0")', '"2010-02-10"');
    59 shouldBe('stepDown("2010-02-10", null, null, "0")', '"2010-02-10"');
    60 shouldBe('stepUp("2010-02-10", null, null, "foo")', '"2010-02-10"');
    61 shouldBe('stepDown("2010-02-10", null, null, "foo")', '"2010-02-10"');
    62 shouldBe('stepUp("2010-02-10", null, null, null)', '"2010-02-10"');
    63 shouldBe('stepDown("2010-02-10", null, null, null)', '"2010-02-10"');
    64 debug('Normal cases');
    65 shouldBe('stepUp("2010-02-10", null, null)', '"2010-02-11"');
    66 shouldBe('stepDown("2010-02-10", null, null)', '"2010-02-09"');
    67 shouldBe('stepUp("2010-02-10", null, null, 10)', '"2010-02-20"');
    68 shouldBe('stepDown("2010-02-10", null, null, 11)', '"2010-01-30"');
    69 shouldBe('stepUp("1970-01-01", "4", null, 2)', '"1970-01-09"');
    70 shouldBe('stepDown("1970-01-01", "4", null, 3)', '"1969-12-20"');
    71 debug('Step=any');
    72 shouldThrow('stepUp("2010-02-10", "any", null)', invalidStateErr);
    73 shouldThrow('stepDown("2010-02-10", "any", null)', invalidStateErr);
    74 debug('Overflow/underflow');
    75 shouldThrow('stepUp("2010-02-10", "3.40282346e+38", null)', invalidStateErr);
    76 shouldThrow('stepDown("2010-02-10", "3.40282346e+38", null)', invalidStateErr);
    77 shouldThrow('stepUp("2010-02-10", "1", "2010-02-10")', invalidStateErr);
    78 shouldThrow('stepDown("2010-02-10", "1", "2010-02-10")', invalidStateErr);
    79 
    80 debug('');
    81 debug('Datetime type');
    82 input.type = 'datetime';
    83 debug('Invalid value');
    84 shouldThrow('stepUp("", null, null)', invalidStateErr);
    85 shouldThrow('stepDown("", null, null)', invalidStateErr);
    86 debug('Non-number arguments');
    87 shouldBe('stepUp("2010-02-10T20:13Z", null, null, "0")', '"2010-02-10T20:13Z"');
    88 shouldBe('stepDown("2010-02-10T20:13Z", null, null, "0")', '"2010-02-10T20:13Z"');
    89 shouldBe('stepUp("2010-02-10T20:13Z", null, null, "foo")', '"2010-02-10T20:13Z"');
    90 shouldBe('stepDown("2010-02-10T20:13Z", null, null, "foo")', '"2010-02-10T20:13Z"');
    91 shouldBe('stepUp("2010-02-10T20:13Z", null, null, null)', '"2010-02-10T20:13Z"');
    92 shouldBe('stepDown("2010-02-10T20:13Z", null, null, null)', '"2010-02-10T20:13Z"');
    93 debug('Normal cases');
    94 shouldBe('stepUp("2010-02-10T20:13Z", null, null)', '"2010-02-10T20:14Z"');
    95 shouldBe('stepDown("2010-02-10T20:13Z", null, null)', '"2010-02-10T20:12Z"');
    96 shouldBe('stepUp("2010-02-10T20:13Z", null, null, 10)', '"2010-02-10T20:23Z"');
    97 shouldBe('stepDown("2010-02-10T20:13Z", null, null, 11)', '"2010-02-10T20:02Z"');
    98 shouldBe('stepUp("1970-01-01T20:13Z", "4", null, 2)', '"1970-01-01T20:13:08Z"');
    99 shouldBe('stepDown("1970-01-01T20:13Z", "4", null, 3)', '"1970-01-01T20:12:48Z"');
    100 debug('Step=any');
    101 shouldThrow('stepUp("2010-02-10T20:13Z", "any", null)', invalidStateErr);
    102 shouldThrow('stepDown("2010-02-10T20:13Z", "any", null)', invalidStateErr);
    103 debug('Overflow/underflow');
    104 shouldThrow('stepUp("2010-02-10T20:13Z", "3.40282346e+38", null)', invalidStateErr);
    105 shouldThrow('stepDown("2010-02-10T20:13Z", "3.40282346e+38", null)', invalidStateErr);
    106 shouldThrow('stepUp("2010-02-10T20:13Z", "1", "2010-02-10T20:13Z")', invalidStateErr);
    107 shouldThrow('stepDown("2010-02-10T20:13Z", "1", "2010-02-10T20:13Z")', invalidStateErr);
    108 
    109 debug('');
    110 debug('Datetime-local type');
    111 input.type = 'datetime-local';
    112 debug('Invalid value');
    113 shouldThrow('stepUp("", null, null)', invalidStateErr);
    114 shouldThrow('stepDown("", null, null)', invalidStateErr);
    115 debug('Non-number arguments');
    116 shouldBe('stepUp("2010-02-10T20:13", null, null, "0")', '"2010-02-10T20:13"');
    117 shouldBe('stepDown("2010-02-10T20:13", null, null, "0")', '"2010-02-10T20:13"');
    118 shouldBe('stepUp("2010-02-10T20:13", null, null, "foo")', '"2010-02-10T20:13"');
    119 shouldBe('stepDown("2010-02-10T20:13", null, null, "foo")', '"2010-02-10T20:13"');
    120 shouldBe('stepUp("2010-02-10T20:13", null, null, null)', '"2010-02-10T20:13"');
    121 shouldBe('stepDown("2010-02-10T20:13", null, null, null)', '"2010-02-10T20:13"');
    122 debug('Normal cases');
    123 shouldBe('stepUp("2010-02-10T20:13", null, null)', '"2010-02-10T20:14"');
    124 shouldBe('stepDown("2010-02-10T20:13", null, null)', '"2010-02-10T20:12"');
    125 shouldBe('stepUp("2010-02-10T20:13", null, null, 10)', '"2010-02-10T20:23"');
    126 shouldBe('stepDown("2010-02-10T20:13", null, null, 11)', '"2010-02-10T20:02"');
    127 shouldBe('stepUp("1970-01-01T20:13", "4", null, 2)', '"1970-01-01T20:13:08"');
    128 shouldBe('stepDown("1970-01-01T20:13", "4", null, 3)', '"1970-01-01T20:12:48"');
    129 debug('Step=any');
    130 shouldThrow('stepUp("2010-02-10T20:13", "any", null)', invalidStateErr);
    131 shouldThrow('stepDown("2010-02-10T20:13", "any", null)', invalidStateErr);
    132 debug('Overflow/underflow');
    133 shouldThrow('stepUp("2010-02-10T20:13", "3.40282346e+38", null)', invalidStateErr);
    134 shouldThrow('stepDown("2010-02-10T20:13", "3.40282346e+38", null)', invalidStateErr);
    135 shouldThrow('stepUp("2010-02-10T20:13", "1", "2010-02-10T20:13")', invalidStateErr);
    136 shouldThrow('stepDown("2010-02-10T20:13", "1", "2010-02-10T20:13")', invalidStateErr);
    137 
    138 debug('');
    139 debug('Month type');
    14041input.type = 'month';
    14142debug('Invalid value');
     
    16667
    16768debug('');
    168 debug('Number type');
    169 input.type = 'number';
    170 debug('Invalid value');
    171 shouldThrow('stepUp("", null, null)', invalidStateErr);
    172 shouldThrow('stepDown("", null, null)', invalidStateErr);
    173 debug('Non-number arguments');
    174 shouldBe('stepUp("0", null, null, "0")', '"0"');
    175 shouldBe('stepDown("0", null, null, "0")', '"0"');
    176 shouldBe('stepUp("0", null, null, "foo")', '"0"');
    177 shouldBe('stepDown("0", null, null, "foo")', '"0"');
    178 shouldBe('stepUp("0", null, null, null)', '"0"');
    179 shouldBe('stepDown("0", null, null, null)', '"0"');
    180 debug('Normal cases');
    181 shouldBe('stepUp("0", null, null)', '"1"');
    182 shouldBe('stepUp("1", null, null, 2)', '"3"');
    183 shouldBe('stepUp("3", null, null, -1)', '"2"');
    184 shouldBe('stepDown("2", null, null)', '"1"');
    185 shouldBe('stepDown("1", null, null, 2)', '"-1"');
    186 shouldBe('stepDown("-1", null, null, -1)', '"0"');
    187 debug('Extra arguments');
    188 shouldBe('input.value = "0"; input.min = null; input.step = null; input.stepUp(1, 2); input.value', '"1"');
    189 shouldBe('input.value = "1"; input.stepDown(1, 3); input.value', '"0"');
    190 debug('Invalid step value');
    191 shouldBe('stepUp("0", "foo", null)', '"1"');
    192 shouldBe('stepUp("1", "0", null)', '"2"');
    193 shouldBe('stepUp("2", "-1", null)', '"3"');
    194 debug('Step=any');
    195 shouldThrow('stepUp("0", "any", null)', invalidStateErr);
    196 shouldThrow('stepDown("0", "any", null)', invalidStateErr);
    197 debug('Step=any corner case');
    198 shouldThrow('stepUpExplicitBounds("0", "100", "any", "1.5", "1")', invalidStateErr);
    199 shouldThrow('stepDownExplicitBounds("0", "100", "any", "1.5", "1")', invalidStateErr);
    200 debug('Overflow/underflow');
    201 shouldBe('stepDown("1", "1", "0")', '"0"');
    202 shouldThrow('stepDown("0", "1", "0")', invalidStateErr);
    203 shouldThrow('stepDown("1", "1", "0", 2)', invalidStateErr);
    204 shouldBe('input.value', '"1"');
    205 shouldThrow('stepDown("1", "3.40282346e+38", "", 2)', invalidStateErr);
    206 shouldBe('stepUp("-1", "1", "0")', '"0"');
    207 shouldThrow('stepUp("0", "1", "0")', invalidStateErr);
    208 shouldThrow('stepUp("-1", "1", "0", 2)', invalidStateErr);
    209 shouldBe('input.value', '"-1"');
    210 shouldThrow('stepUp("1", "3.40282346e+38", "", 2)', invalidStateErr);
    211 debug('stepDown()/stepUp() for stepMismatch values');
    212 shouldBe('stepUp("1", "2", "")', '"3"');
    213 shouldBe('input.stepDown(); input.value', '"1"');
    214 shouldBe('input.min = "0"; stepUp("9", "10", "", 9)', '"99"');
    215 shouldBe('stepDown("19", "10", "0")', '"9"');
    216 shouldBe('stepUp("89", "10", "99")', '"99"');
    217 debug('Huge value and small step');
    218 shouldBe('input.min = ""; stepUp("1e+38", "1", "", 999999)', '"1e+38"');
    219 shouldBe('input.max = ""; stepDown("1e+38", "1", "", 999999)', '"1e+38"');
    220 debug('Fractional numbers');
    221 shouldBe('input.min = ""; stepUp("0", "0.33333333333333333", "", 3)', '"1"');
    222 shouldBe('stepUp("1", "0.1", "", 10)', '"2"');
    223 shouldBe('input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.value', '"3"');
    224 shouldBe('input.min = "0"; stepUp("0", "0.003921568627450980", "1", 255)', '"1"');
    225 shouldBe('for (var i = 0; i < 255; i++) { input.stepDown(); }; input.value', '"0"');
    226 debug('Rounding');
    227 shouldBe('stepUp("5.005", "0.005", "", 2)', '"5.015"');
    228 shouldBe('stepUp("5.005", "0.005", "", 11)', '"5.06"');
    229 shouldBe('stepUp("5.005", "0.005", "", 12)', '"5.065"');
    230 shouldBe('stepUpExplicitBounds("4", "9", "0.005", "5.005", 2)', '"5.015"');
    231 shouldBe('stepUpExplicitBounds("4", "9", "0.005", "5.005", 11)', '"5.06"');
    232 shouldBe('stepUpExplicitBounds("4", "9", "0.005", "5.005", 12)', '"5.065"');
    233 
    234 debug('');
    235 debug('Range type');
    236 input.type = 'range';
    237 debug('function arguments are (min, max, step, value, [stepCount])');
    238 debug('Using the default values');
    239 shouldBe('stepUpExplicitBounds(null, null, null, "")', '"51"');
    240 shouldBe('stepDownExplicitBounds(null, null, null, "")', '"49"');
    241 debug('Non-number arguments (stepCount)');
    242 shouldBe('stepUpExplicitBounds(null, null, null, "0", "0")', '"0"');
    243 shouldBe('stepDownExplicitBounds(null, null, null, "0", "0")', '"0"');
    244 shouldBe('stepUpExplicitBounds(null, null, null, "0", "foo")', '"0"');
    245 shouldBe('stepDownExplicitBounds(null, null, null, "0", "foo")', '"0"');
    246 shouldBe('stepUpExplicitBounds(null, null, null, "0", null)', '"0"');
    247 shouldBe('stepDownExplicitBounds(null, null, null, "0", null)', '"0"');
    248 debug('Normal cases');
    249 shouldBe('stepUpExplicitBounds(null, null, null, "0")', '"1"');
    250 shouldBe('stepUpExplicitBounds(null, null, null, "1", 2)', '"3"');
    251 shouldBe('stepUpExplicitBounds(null, null, null, "3", -1)', '"2"');
    252 shouldBe('stepDownExplicitBounds("-100", null, null, "2")', '"1"');
    253 shouldBe('stepDownExplicitBounds("-100", null, null, "1", 2)', '"-1"');
    254 shouldBe('stepDownExplicitBounds("-100", null, null, "-1", -1)', '"0"');
    255 debug('Extra arguments');
    256 shouldBe('setInputAttributes(null, null, null, "0"); input.stepUp(1,2); input.value', '"1"');
    257 shouldBe('setInputAttributes(null, null, null, "1"); input.stepDown(1,3); input.value', '"0"');
    258 debug('Invalid step value');
    259 shouldBe('stepUpExplicitBounds(null, null, "foo", "0")', '"1"');
    260 shouldBe('stepUpExplicitBounds(null, null, "0", "1")', '"2"');
    261 shouldBe('stepUpExplicitBounds(null, null, "-1", "2")', '"3"');
    262 shouldBe('stepDownExplicitBounds(null, null, "foo", "1")', '"0"');
    263 shouldBe('stepDownExplicitBounds(null, null, "0", "2")', '"1"');
    264 shouldBe('stepDownExplicitBounds(null, null, "-1", "3")', '"2"');
    265 debug('Step=any');
    266 shouldThrow('stepUpExplicitBounds(null, null, "any", "1")', invalidStateErr);
    267 shouldThrow('stepDownExplicitBounds(null, null, "any", "1")', invalidStateErr);
    268 debug('Overflow/underflow');
    269 shouldBe('stepUpExplicitBounds(null, "100", "1", "99")', '"100"');
    270 shouldThrow('stepUpExplicitBounds(null, "100", "1", "100")', invalidStateErr);
    271 shouldBe('input.value', '"100"');
    272 shouldThrow('stepUpExplicitBounds(null, "100", "1", "99", "2")', invalidStateErr);
    273 shouldBe('input.value', '"99"');
    274 shouldBe('stepDownExplicitBounds("0", null, "1", "1")', '"0"');
    275 shouldThrow('stepDownExplicitBounds("0", null, "1", "0")', invalidStateErr);
    276 shouldBe('input.value', '"0"');
    277 shouldThrow('stepDownExplicitBounds("0", null, "1", "1", "2")', invalidStateErr);
    278 shouldBe('input.value', '"1"');
    279 shouldThrow('stepDownExplicitBounds(null, null, "3.40282346e+38", "1", "2")', invalidStateErr);
    280 shouldBe('stepUpExplicitBounds(-100, 0, 1, -1)', '"0"');
    281 shouldThrow('stepUpExplicitBounds(null, 0, 1, 0)', invalidStateErr);
    282 shouldThrow('stepUpExplicitBounds(-100, 0, 1, -1, 2)', invalidStateErr);
    283 shouldBe('input.value', '"-1"');
    284 shouldThrow('stepUpExplicitBounds(null, null, "3.40282346e+38", "1", "2")', invalidStateErr);
    285 debug('stepDown()/stepUp() for stepMismatch values');
    286 shouldBe('stepUpExplicitBounds(null, null, 2, 1)', '"4"');
    287 shouldBe('input.stepDown(); input.value', '"2"');
    288 shouldBe('stepUpExplicitBounds(0, null, 10, 9, 9)', '"100"');
    289 shouldBe('stepDownExplicitBounds(0, null, 10, 19)', '"10"');
    290 debug('value + step is <= max, but rounded result would be > max.');
    291 shouldThrow('stepUpExplicitBounds(null, 99, 10, 89)', invalidStateErr);
    292 debug('Huge value and small step');
    293 shouldBe('stepUpExplicitBounds(0, 1e38, 1, 1e38, 999999)', '"1e+38"');
    294 shouldBe('stepDownExplicitBounds(0, 1e38, 1, 1e38, 999999)', '"1e+38"');
    295 debug('Fractional numbers');
    296 shouldBe('stepUpExplicitBounds(null, null, 0.33333333333333333, 0, 3)', '"1"');
    297 shouldBe('stepUpExplicitBounds(null, null, 0.1, 1)', '"1.1"');
    298 shouldBe('stepUpExplicitBounds(null, null, 0.1, 1, 8)', '"1.8"');
    299 shouldBe('stepUpExplicitBounds(null, null, 0.1, 1, 10)', '"2"');
    300 shouldBe('input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.value', '"3"');
    301 shouldBe('stepUpExplicitBounds(0, 1, 0.003921568627450980, 0, 255)', '"1"');
    302 shouldBe('for (var i = 0; i < 255; i++) { input.stepDown(); }; input.value', '"0"');
    303 shouldBe('stepDownExplicitBounds(null, null, 0.1, 1, 8)', '"0.2"');
    304 shouldBe('stepDownExplicitBounds(null, null, 0.1, 1)', '"0.9"');
    305 
    306 debug('');
    307 debug('Time type');
    308 input.type = 'time';
    309 debug('Invalid value');
    310 shouldThrow('stepUp("", null, null)', invalidStateErr);
    311 shouldThrow('stepDown("", null, null)', invalidStateErr);
    312 debug('Non-number arguments');
    313 shouldBe('stepUp("20:13", null, null, "0")', '"20:13"');
    314 shouldBe('stepDown("20:13", null, null, "0")', '"20:13"');
    315 shouldBe('stepUp("20:13", null, null, "foo")', '"20:13"');
    316 shouldBe('stepDown("20:13", null, null, "foo")', '"20:13"');
    317 shouldBe('stepUp("20:13", null, null, null)', '"20:13"');
    318 shouldBe('stepDown("20:13", null, null, null)', '"20:13"');
    319 debug('Normal cases');
    320 shouldBe('stepUp("20:13", null, null)', '"20:14"');
    321 shouldBe('stepDown("20:13", null, null)', '"20:12"');
    322 shouldBe('stepUp("20:13", null, null, 10)', '"20:23"');
    323 shouldBe('stepDown("20:13", null, null, 11)', '"20:02"');
    324 shouldBe('stepUp("20:13", "4", null, 2)', '"20:13:08"');
    325 shouldBe('stepDown("20:13", "4", null, 3)', '"20:12:48"');
    326 debug('Step=any');
    327 shouldThrow('stepUp("20:13", "any", null)', invalidStateErr);
    328 shouldThrow('stepDown("20:13", "any", null)', invalidStateErr);
    329 debug('Overflow/underflow');
    330 shouldThrow('stepUp("20:13", "3.40282346e+38", null)', invalidStateErr);
    331 shouldThrow('stepDown("20:13", "3.40282346e+38", null)', invalidStateErr);
    332 shouldThrow('stepUp("20:13", "1", "20:13")', invalidStateErr);
    333 shouldThrow('stepDown("20:13", "1", "20:13")', invalidStateErr);
    334 shouldThrow('stepUp("23:59", null, null)', invalidStateErr);
    335 shouldThrow('stepDown("00:00", null, null)', invalidStateErr);
    336 
    337 debug('');
    338 debug('Unsupported type');
    339 shouldThrow('input.step = "3"; input.min = ""; input.max = ""; input.value = "2"; input.stepDown()', '"Error: INVALID_STATE_ERR: DOM Exception 11"');
    340 shouldThrow('input.stepDown(0)', '"Error: INVALID_STATE_ERR: DOM Exception 11"');
    341 shouldThrow('input.stepUp()', '"Error: INVALID_STATE_ERR: DOM Exception 11"');
    342 shouldThrow('input.stepUp(0)', '"Error: INVALID_STATE_ERR: DOM Exception 11"');
    343 
    34469var successfullyParsed = true;
     70</script>
     71<script src="../../js/resources/js-test-post.js"></script>
     72</body>
     73</html>
  • trunk/LayoutTests/fast/forms/script-tests/ValidityState-rangeOverflow.js

    r92427 r92728  
    112112// ----------------------------------------------------------------
    113113debug('');
    114 debug('Type=month');
    115 input.type = 'month';
    116 input.min = '';
    117 // No overflow cases
    118 checkNotOverflow('2010-01', null);
    119 checkNotOverflow('2010-01', '');
    120 checkNotOverflow('2010-01', 'foo');
    121 checkNotOverflow('2010-01', '2010-01');
    122 checkNotOverflow('2010-01', '2010-02');
    123 checkNotOverflow('2010-01', '2011-01');
    124 checkNotOverflow('foo', '2011-01');
    125 checkNotOverflow('2010-01', '0000-01'); // Too small max value.
    126 
    127 // Overflow cases
    128 checkOverflow('2010-01', '2009-12');
    129 checkOverflow('9999-01', '2010-12');
    130 input.min = '2010-02';  // value < min && value > max
    131 checkOverflow('2010-01', '2009-12');
    132 
    133 // Disabled
    134 checkNotOverflow('9999-01', '2010-12', true);
    135 
    136 // ----------------------------------------------------------------
    137 debug('');
    138114debug('Type=number');
    139115input.type = 'number';
  • trunk/LayoutTests/fast/forms/script-tests/ValidityState-rangeUnderflow.js

    r92427 r92728  
    118118// ----------------------------------------------------------------
    119119debug('');
    120 debug('Type=month');
    121 input.type = 'month';
    122 input.max = '';
    123 // No underflow cases
    124 checkNotUnderflow('2010-01', null);
    125 checkNotUnderflow('2010-01', '');
    126 checkNotUnderflow('2010-01', 'foo');
    127 // 1000-01 is smaller than the implicit minimum value.
    128 // But the month parser rejects it before comparing the minimum value.
    129 checkNotUnderflow('1000-01', '');
    130 checkNotUnderflow('1582-10', '');
    131 checkNotUnderflow('2010-01', '2009-12');
    132 checkNotUnderflow('2010-01', '2009-01');
    133 checkNotUnderflow('foo', '2011-01');
    134 
    135 // Underflow cases
    136 checkUnderflow('2010-01', '2010-02');
    137 checkUnderflow('9999-01', '10000-12');
    138 input.max = '2009-12';  // value < min && value > max
    139 checkUnderflow('2010-01', '2010-02');
    140 
    141 // Disabled
    142 checkNotUnderflow('9999-01', '10000-12', true);
    143 
    144 // ----------------------------------------------------------------
    145 debug('');
    146120debug('Type=number');
    147121input.type = 'number';
  • trunk/LayoutTests/fast/forms/script-tests/ValidityState-stepMismatch.js

    r92427 r92728  
    1 description('Check stepMismatch results for type=date, datetime, datetime-local, month, time.');
     1description('Check stepMismatch results for type=date, datetime, datetime-local, time.');
    22
    33var input = document.createElement('input');
     
    109109debug('Disabled');
    110110shouldBeFalse('stepMismatchFor("2010-02-09T12:34:55.001", "1", "2010-02-09T12:34:56", true)');
    111 
    112 debug('');
    113 debug('Month type');
    114 input.type = 'month';
    115 debug('Empty values');
    116 shouldBeFalse('stepMismatchFor("", null, null)');
    117 shouldBeFalse('stepMismatchFor("", "2", "1969-12")');
    118 debug('Normal step values');
    119 shouldBeTrue('stepMismatchFor("2010-03", "2", "2010-02")');
    120 shouldBeFalse('stepMismatchFor("2010-02", "2", "2010-02")');
    121 shouldBeFalse('stepMismatchFor("2010-04", "2", "2010-02")');
    122 shouldBeTrue('stepMismatchFor("1800-11", "3", "1800-09")');
    123 shouldBeFalse('stepMismatchFor("1800-09", "3", "1800-09")');
    124 shouldBeFalse('stepMismatchFor("1800-12", "3", "1800-09")');
    125 shouldBeTrue('stepMismatchFor("275760-09", "3", "275760-08")');
    126 shouldBeFalse('stepMismatchFor("275760-09", "2", "275760-09")');
    127 debug('Implicit step base');
    128 shouldBeTrue('stepMismatchFor("1970-02", "2", null)');
    129 shouldBeFalse('stepMismatchFor("1970-03", "2", null)');
    130 debug('Fractional step values');
    131 shouldBeFalse('stepMismatchFor("2010-03", "0.1", "2010-02")');
    132 shouldBeFalse('stepMismatchFor("2010-03", "1.1", "2010-02")');
    133 shouldBeTrue('stepMismatchFor("2010-03", "1.9", "2010-02")');
    134 debug('Invalid or no step values');
    135 shouldBeFalse('stepMismatchFor("2010-03", null, "2010-02")');
    136 shouldBeFalse('stepMismatchFor("2010-03", "-1", "2010-02")');
    137 shouldBeFalse('stepMismatchFor("2010-03", "foo", "2010-02")');
    138 debug('Special step value');
    139 shouldBeFalse('stepMismatchFor("2010-03", "any", "2010-02")');
    140 debug('Disabled');
    141 shouldBeFalse('stepMismatchFor("2010-03", "2", "2010-02", true)');
    142111
    143112debug('');
  • trunk/LayoutTests/fast/forms/script-tests/input-stepup-stepdown-from-renderer.js

    r92427 r92728  
    1 description('Check stepping-up and -down for <input> from renderer. No cases of empty initial values for type=date, datetime, datetime-local, month, time.');
     1description('Check stepping-up and -down for <input> from renderer. No cases of empty initial values for type=date, datetime, datetime-local, time.');
    22
    33var input = document.createElement('input');
     
    145145shouldBe('stepDown("2010-02-10T20:13", "3", "2010-02-10T20:12:56")', '"2010-02-10T20:12:59"');
    146146shouldBe('stepUp("1970-01-01T00:13", "7", "")', '"1970-01-01T00:13:04"');
    147 
    148 debug('');
    149 debug('Month type');
    150 input.type = 'month';
    151 debug('Function arguments are (value, step, {min or max}, [stepCount]).');
    152 debug('Normal cases');
    153 shouldBe('stepUp("2010-02", null, null)', '"2010-03"');
    154 shouldBe('stepDown("2010-02", null, null)', '"2010-01"');
    155 shouldBe('stepUp("2010-02", null, null, 10)', '"2010-12"');
    156 shouldBe('stepDown("2010-02", null, null, 11)', '"2009-03"');
    157 shouldBe('stepUp("1970-01", "4", null, 2)', '"1970-09"');
    158 shouldBe('stepDown("1970-01", "4", null, 3)', '"1969-01"');
    159 debug('Step=any');
    160 shouldBe('stepUp("2010-02", "any", null)', '"2010-03"');
    161 shouldBe('stepDown("2010-02", "any", null)', '"2010-01"');
    162 debug('Overflow/underflow');
    163 shouldBe('stepUp("2010-02", "3.40282346e+38", null)', '"275760-09"');
    164 shouldBe('stepDown("2010-02", "3.40282346e+38", null)', '"1970-01"');
    165 shouldBe('stepUp("2010-02", "1", "2010-02")', '"2010-02"');
    166 shouldBe('stepDown("2010-02", "1", "2010-02")', '"2010-02"');
    167 debug('stepDown()/stepUp() for stepMismatch values');
    168 shouldBe('stepDown("2010-02", "3", "2009-10")', '"2010-01"');
    169 shouldBe('stepUp("1970-02", "4", "")', '"1970-05"');
    170147
    171148debug('');
  • trunk/LayoutTests/fast/forms/script-tests/input-stepup-stepdown.js

    r92427 r92728  
    1 description('Check stepUp() and stepDown() bahevior for type=date, datetime, datetime-local, month, time.');
     1description('Check stepUp() and stepDown() bahevior for type=date, datetime, datetime-local, time.');
    22
    33var input = document.createElement('input');
     
    135135shouldThrow('stepUp("2010-02-10T20:13", "1", "2010-02-10T20:13")', invalidStateErr);
    136136shouldThrow('stepDown("2010-02-10T20:13", "1", "2010-02-10T20:13")', invalidStateErr);
    137 
    138 debug('');
    139 debug('Month type');
    140 input.type = 'month';
    141 debug('Invalid value');
    142 shouldThrow('stepUp("", null, null)', invalidStateErr);
    143 shouldThrow('stepDown("", null, null)', invalidStateErr);
    144 debug('Non-number arguments');
    145 shouldBe('stepUp("2010-02", null, null, "0")', '"2010-02"');
    146 shouldBe('stepDown("2010-02", null, null, "0")', '"2010-02"');
    147 shouldBe('stepUp("2010-02", null, null, "foo")', '"2010-02"');
    148 shouldBe('stepDown("2010-02", null, null, "foo")', '"2010-02"');
    149 shouldBe('stepUp("2010-02", null, null, null)', '"2010-02"');
    150 shouldBe('stepDown("2010-02", null, null, null)', '"2010-02"');
    151 debug('Normal cases');
    152 shouldBe('stepUp("2010-02", null, null)', '"2010-03"');
    153 shouldBe('stepDown("2010-02", null, null)', '"2010-01"');
    154 shouldBe('stepUp("2010-02", null, null, 10)', '"2010-12"');
    155 shouldBe('stepDown("2010-02", null, null, 11)', '"2009-03"');
    156 shouldBe('stepUp("1970-01", "4", null, 2)', '"1970-09"');
    157 shouldBe('stepDown("1970-01", "4", null, 3)', '"1969-01"');
    158 debug('Step=any');
    159 shouldThrow('stepUp("2010-02", "any", null)', invalidStateErr);
    160 shouldThrow('stepDown("2010-02", "any", null)', invalidStateErr);
    161 debug('Overflow/underflow');
    162 shouldThrow('stepUp("2010-02", "3.40282346e+38", null)', invalidStateErr);
    163 shouldThrow('stepDown("2010-02", "3.40282346e+38", null)', invalidStateErr);
    164 shouldThrow('stepUp("2010-02", "1", "2010-02")', invalidStateErr);
    165 shouldThrow('stepDown("2010-02", "1", "2010-02")', invalidStateErr);
    166137
    167138debug('');
  • trunk/LayoutTests/fast/forms/script-tests/input-type-change3.js

    r92427 r92728  
    3939check("isindex", "text");
    4040check("khtml_isindex", "");
    41 check("month", "month");
    4241check("number", "number");
    4342check("password", "password");
Note: See TracChangeset for help on using the changeset viewer.