Changeset 70549 in webkit
- Timestamp:
- Oct 26, 2010 11:47:46 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r70548 r70549 1 2010-10-26 Dai Mikurube <dmikurube@google.com> 2 3 Reviewed by Kent Tamura. 4 5 Number values should be in the range of IEEE 754 single-precision floating point number 6 https://bugs.webkit.org/show_bug.cgi?id=48221 7 8 Changed tests and test expectations for number values to fit in the 9 range of IEEE 754 single-precision 10 11 * fast/forms/ValidityState-stepMismatch-expected.txt: 12 * fast/forms/input-stepup-stepdown-expected.txt: 13 * fast/forms/input-valueasnumber-number-expected.txt: 14 * fast/forms/input-valueasnumber-range-expected.txt: 15 * fast/forms/script-tests/ValidityState-stepMismatch.js: 16 * fast/forms/script-tests/input-stepup-stepdown.js: 17 * fast/forms/script-tests/input-valueasnumber-number.js: 18 * fast/forms/script-tests/input-valueasnumber-range.js: 19 1 20 2010-10-26 Simon Fraser <simon.fraser@apple.com> 2 21 -
trunk/LayoutTests/fast/forms/ValidityState-stepMismatch-expected.txt
r66355 r70549 132 132 PASS stepMismatchFor("-3", undefined, "-4") is false 133 133 Huge numbers and small step; uncomparable 134 PASS stepMismatchFor(" 1.7976931348623157e+308", "3", "") is false135 PASS stepMismatchFor(" 1.7976931348623156e+308", "3", "") is false136 PASS stepMismatchFor(" 1.7976931348623155e+308", "3", "") is false134 PASS stepMismatchFor("3.40282347e+38", "3", "") is false 135 PASS stepMismatchFor("3.40282346e+38", "3", "") is false 136 PASS stepMismatchFor("3.40282345e+38", "3", "") is false 137 137 Huge numbers and huge step 138 PASS stepMismatchFor(" 1.60e+308", "0.20e+308", "") is false139 PASS stepMismatchFor(" 1.60e+308", "0.22e+308", "") is true138 PASS stepMismatchFor("3.20e+38", "0.20e+38", "") is false 139 PASS stepMismatchFor("3.20e+38", "0.22e+38", "") is true 140 140 Fractional numbers 141 141 PASS stepMismatchFor("0.9", "0.1", "") is false … … 158 158 PASS stepMismatchFor("-3", undefined, "-4") is false 159 159 Huge numbers and small step; uncomparable 160 PASS stepMismatchFor(" 1.7976931348623157e+308", "3", "") is false161 PASS stepMismatchFor(" 1.7976931348623156e+308", "3", "") is false162 PASS stepMismatchFor(" 1.7976931348623155e+308", "3", "") is false160 PASS stepMismatchFor("3.40282347e+38", "3", "") is false 161 PASS stepMismatchFor("3.40282346e+38", "3", "") is false 162 PASS stepMismatchFor("3.40282345e+38", "3", "") is false 163 163 Huge numbers and huge step 164 PASS stepMismatchFor(" 1.60e+308", "0.20e+308", "") is false165 PASS stepMismatchFor(" 1.60e+308", "0.22e+308", "") is false164 PASS stepMismatchFor("3.20e+38", "0.20e+38", "") is false 165 PASS stepMismatchFor("3.20e+38", "0.22e+38", "") is false 166 166 Fractional numbers 167 167 PASS stepMismatchFor("0.9", "0.1", "") is false -
trunk/LayoutTests/fast/forms/input-stepup-stepdown-expected.txt
r56242 r70549 26 26 PASS stepDown("2010-02-10", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 27 27 Overflow/underflow 28 PASS stepUp("2010-02-10", " 1.7976931348623156e+308", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.29 PASS stepDown("2010-02-10", " 1.7976931348623156e+308", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.28 PASS stepUp("2010-02-10", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 29 PASS stepDown("2010-02-10", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 30 30 PASS stepUp("2010-02-10", "1", "2010-02-10") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 31 31 PASS stepDown("2010-02-10", "1", "2010-02-10") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. … … 53 53 PASS stepDown("2010-02-10T20:13Z", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 54 54 Overflow/underflow 55 PASS stepUp("2010-02-10T20:13Z", " 1.7976931348623156e+308", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.56 PASS stepDown("2010-02-10T20:13Z", " 1.7976931348623156e+308", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.55 PASS stepUp("2010-02-10T20:13Z", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 56 PASS stepDown("2010-02-10T20:13Z", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 57 57 PASS stepUp("2010-02-10T20:13Z", "1", "2010-02-10T20:13Z") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 58 58 PASS stepDown("2010-02-10T20:13Z", "1", "2010-02-10T20:13Z") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. … … 80 80 PASS stepDown("2010-02-10T20:13", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 81 81 Overflow/underflow 82 PASS stepUp("2010-02-10T20:13", " 1.7976931348623156e+308", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.83 PASS stepDown("2010-02-10T20:13", " 1.7976931348623156e+308", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.82 PASS stepUp("2010-02-10T20:13", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 83 PASS stepDown("2010-02-10T20:13", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 84 84 PASS stepUp("2010-02-10T20:13", "1", "2010-02-10T20:13") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 85 85 PASS stepDown("2010-02-10T20:13", "1", "2010-02-10T20:13") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. … … 107 107 PASS stepDown("2010-02", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 108 108 Overflow/underflow 109 PASS stepUp("2010-02", " 1.7976931348623156e+308", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.110 PASS stepDown("2010-02", " 1.7976931348623156e+308", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.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 111 PASS stepUp("2010-02", "1", "2010-02") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 112 112 PASS stepDown("2010-02", "1", "2010-02") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. … … 145 145 PASS stepDown("1", "1", "0", 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 146 146 PASS input.value is "1" 147 PASS stepDown("1", " 1.7976931348623156e+308", "", 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.147 PASS stepDown("1", "3.40282346e+38", "", 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 148 148 PASS stepUp("-1", "1", "0") is "0" 149 149 PASS stepUp("0", "1", "0") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 150 150 PASS stepUp("-1", "1", "0", 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 151 151 PASS input.value is "-1" 152 PASS stepUp("1", " 1.7976931348623156e+308", "", 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.152 PASS stepUp("1", "3.40282346e+38", "", 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 153 153 stepDown()/stepUp() for stepMismatch values 154 154 PASS stepUp("1", "2", "") is "4" … … 158 158 PASS stepUp("89", "10", "99") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 159 159 Huge value and small step 160 PASS input.min = ""; stepUp("1e+3 08", "1", "", 999999) is "1e+308"161 PASS input.max = ""; stepDown("1e+3 08", "1", "", 999999) is "1e+308"160 PASS input.min = ""; stepUp("1e+38", "1", "", 999999) is "1e+38" 161 PASS input.max = ""; stepDown("1e+38", "1", "", 999999) is "1e+38" 162 162 Fractional numbers 163 163 PASS input.min = ""; stepUp("0", "0.33333333333333333", "", 3) is "1" … … 210 210 PASS stepDownExplicitBounds("0", null, "1", "1", "2") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 211 211 PASS input.value is "1" 212 PASS stepDownExplicitBounds(null, null, " 1.7976931348623156e+308", "1", "2") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.212 PASS stepDownExplicitBounds(null, null, "3.40282346e+38", "1", "2") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 213 213 PASS stepUpExplicitBounds(-100, 0, 1, -1) is "0" 214 214 PASS stepUpExplicitBounds(null, 0, 1, 0) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 215 215 PASS stepUpExplicitBounds(-100, 0, 1, -1, 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 216 216 PASS input.value is "-1" 217 PASS stepUpExplicitBounds(null, null, " 1.7976931348623156e+308", "1", "2") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.217 PASS stepUpExplicitBounds(null, null, "3.40282346e+38", "1", "2") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 218 218 stepDown()/stepUp() for stepMismatch values 219 219 PASS stepUpExplicitBounds(null, null, 2, 1) is "4" … … 224 224 PASS stepUpExplicitBounds(null, 99, 10, 89) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 225 225 Huge value and small step 226 PASS stepUpExplicitBounds(0, 1e3 08, 1, 1e308, 999999) is "1e+308"227 PASS stepDownExplicitBounds(0, 1e3 08, 1, 1e308, 999999) is "1e+308"226 PASS stepUpExplicitBounds(0, 1e38, 1, 1e38, 999999) is "1e+38" 227 PASS stepDownExplicitBounds(0, 1e38, 1, 1e38, 999999) is "1e+38" 228 228 Fractional numbers 229 229 PASS stepUpExplicitBounds(null, null, 0.33333333333333333, 0, 3) is "1" … … 259 259 PASS stepDown("20:13", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 260 260 Overflow/underflow 261 PASS stepUp("20:13", " 1.7976931348623156e+308", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.262 PASS stepDown("20:13", " 1.7976931348623156e+308", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.261 PASS stepUp("20:13", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 262 PASS stepDown("20:13", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 263 263 PASS stepUp("20:13", "1", "20:13") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 264 264 PASS stepDown("20:13", "1", "20:13") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. … … 288 288 PASS stepDown("2010-W02", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 289 289 Overflow/underflow 290 PASS stepUp("2010-W02", " 1.7976931348623156e+308", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.291 PASS stepDown("2010-W02", " 1.7976931348623156e+308", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.290 PASS stepUp("2010-W02", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 291 PASS stepDown("2010-W02", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 292 292 PASS stepUp("2010-W02", "1", "2010-W02") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 293 293 PASS stepDown("2010-W02", "1", "2010-W02") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. -
trunk/LayoutTests/fast/forms/input-valueasnumber-number-expected.txt
r53893 r70549 12 12 PASS valueAsNumberFor("1.2E-10") is 1.2E-10 13 13 PASS valueAsNumberFor("1.2E+10") is 1.2E10 14 PASS valueAsNumberFor("123456789012345678901234567890123456789 01234567890") is 1.2345678901234567E+4914 PASS valueAsNumberFor("123456789012345678901234567890123456789") is 1.2345678901234568E+38 15 15 PASS valueAsNumberFor("0.12345678901234567890123456789012345678901234567890") is 0.123456789012345678 16 16 valueAsNumber for invalid string values: … … 39 39 PASS setValueAsNumberAndGetValue(1.2e10) is "12000000000" 40 40 PASS setValueAsNumberAndGetValue(1.2e-10) is "1.2e-10" 41 PASS setValueAsNumberAndGetValue(1.2345678901234567e+49) is "1.2345678901234567e+49" 41 PASS setValueAsNumberAndGetValue(1.2345678901234567e+38) is "1.2345678901234567e+38" 42 PASS setValueAsNumberAndGetValue("-3.40282346e+38") is "-3.40282346e+38" 43 PASS setValueAsNumberAndGetValue("-3.40282348e+38") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 44 PASS setValueAsNumberAndGetValue("3.40282346e+38") is "3.40282346e+38" 45 PASS setValueAsNumberAndGetValue("3.40282348e+38") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 42 46 Tests to set invalid values to valueAsNumber: 43 47 PASS setValueAsNumberAndGetValue(null) is "0" -
trunk/LayoutTests/fast/forms/input-valueasnumber-range-expected.txt
r53893 r70549 12 12 PASS valueAsNumberFor("1.2E-10") is 0 13 13 PASS valueAsNumberFor("1.2E+10") is 100 14 PASS valueAsNumberFor("123456789012345678901234567890123456789 01234567890") is 10014 PASS valueAsNumberFor("123456789012345678901234567890123456789") is 100 15 15 PASS valueAsNumberFor("0.12345678901234567890123456789012345678901234567890") is 0 16 16 valueAsNumber for invalid string values: … … 39 39 PASS setValueAsNumberAndGetValue(1.2e10) is "100" 40 40 PASS setValueAsNumberAndGetValue(1.2e-10) is "0" 41 PASS setValueAsNumberAndGetValue(1.2345678901234567e+ 49) is "100"41 PASS setValueAsNumberAndGetValue(1.2345678901234567e+38) is "100" 42 42 Tests to set invalid values to valueAsNumber: 43 43 PASS setValueAsNumberAndGetValue(null) is "0" -
trunk/LayoutTests/fast/forms/script-tests/ValidityState-stepMismatch.js
r66355 r70549 149 149 shouldBe('stepMismatchFor("-3", undefined, "-4")', 'false'); 150 150 debug('Huge numbers and small step; uncomparable'); 151 shouldBe('stepMismatchFor(" 1.7976931348623157e+308", "3", "")', 'false');152 shouldBe('stepMismatchFor(" 1.7976931348623156e+308", "3", "")', 'false');153 shouldBe('stepMismatchFor(" 1.7976931348623155e+308", "3", "")', 'false');151 shouldBe('stepMismatchFor("3.40282347e+38", "3", "")', 'false'); 152 shouldBe('stepMismatchFor("3.40282346e+38", "3", "")', 'false'); 153 shouldBe('stepMismatchFor("3.40282345e+38", "3", "")', 'false'); 154 154 debug('Huge numbers and huge step'); 155 shouldBe('stepMismatchFor(" 1.60e+308", "0.20e+308", "")', 'false');156 shouldBe('stepMismatchFor(" 1.60e+308", "0.22e+308", "")', 'true');155 shouldBe('stepMismatchFor("3.20e+38", "0.20e+38", "")', 'false'); 156 shouldBe('stepMismatchFor("3.20e+38", "0.22e+38", "")', 'true'); 157 157 debug('Fractional numbers'); 158 158 shouldBe('stepMismatchFor("0.9", "0.1", "")', 'false'); … … 180 180 shouldBe('stepMismatchFor("-3", undefined, "-4")', 'false'); 181 181 debug('Huge numbers and small step; uncomparable'); 182 shouldBe('stepMismatchFor(" 1.7976931348623157e+308", "3", "")', 'false');183 shouldBe('stepMismatchFor(" 1.7976931348623156e+308", "3", "")', 'false');184 shouldBe('stepMismatchFor(" 1.7976931348623155e+308", "3", "")', 'false');182 shouldBe('stepMismatchFor("3.40282347e+38", "3", "")', 'false'); 183 shouldBe('stepMismatchFor("3.40282346e+38", "3", "")', 'false'); 184 shouldBe('stepMismatchFor("3.40282345e+38", "3", "")', 'false'); 185 185 debug('Huge numbers and huge step'); 186 shouldBe('stepMismatchFor(" 1.60e+308", "0.20e+308", "")', 'false');187 shouldBe('stepMismatchFor(" 1.60e+308", "0.22e+308", "")', 'false');186 shouldBe('stepMismatchFor("3.20e+38", "0.20e+38", "")', 'false'); 187 shouldBe('stepMismatchFor("3.20e+38", "0.22e+38", "")', 'false'); 188 188 debug('Fractional numbers'); 189 189 shouldBe('stepMismatchFor("0.9", "0.1", "")', 'false'); -
trunk/LayoutTests/fast/forms/script-tests/input-stepup-stepdown.js
r56242 r70549 73 73 shouldThrow('stepDown("2010-02-10", "any", null)', invalidStateErr); 74 74 debug('Overflow/underflow'); 75 shouldThrow('stepUp("2010-02-10", " 1.7976931348623156e+308", null)', invalidStateErr);76 shouldThrow('stepDown("2010-02-10", " 1.7976931348623156e+308", null)', invalidStateErr);75 shouldThrow('stepUp("2010-02-10", "3.40282346e+38", null)', invalidStateErr); 76 shouldThrow('stepDown("2010-02-10", "3.40282346e+38", null)', invalidStateErr); 77 77 shouldThrow('stepUp("2010-02-10", "1", "2010-02-10")', invalidStateErr); 78 78 shouldThrow('stepDown("2010-02-10", "1", "2010-02-10")', invalidStateErr); … … 102 102 shouldThrow('stepDown("2010-02-10T20:13Z", "any", null)', invalidStateErr); 103 103 debug('Overflow/underflow'); 104 shouldThrow('stepUp("2010-02-10T20:13Z", " 1.7976931348623156e+308", null)', invalidStateErr);105 shouldThrow('stepDown("2010-02-10T20:13Z", " 1.7976931348623156e+308", null)', invalidStateErr);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 106 shouldThrow('stepUp("2010-02-10T20:13Z", "1", "2010-02-10T20:13Z")', invalidStateErr); 107 107 shouldThrow('stepDown("2010-02-10T20:13Z", "1", "2010-02-10T20:13Z")', invalidStateErr); … … 131 131 shouldThrow('stepDown("2010-02-10T20:13", "any", null)', invalidStateErr); 132 132 debug('Overflow/underflow'); 133 shouldThrow('stepUp("2010-02-10T20:13", " 1.7976931348623156e+308", null)', invalidStateErr);134 shouldThrow('stepDown("2010-02-10T20:13", " 1.7976931348623156e+308", null)', invalidStateErr);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 135 shouldThrow('stepUp("2010-02-10T20:13", "1", "2010-02-10T20:13")', invalidStateErr); 136 136 shouldThrow('stepDown("2010-02-10T20:13", "1", "2010-02-10T20:13")', invalidStateErr); … … 160 160 shouldThrow('stepDown("2010-02", "any", null)', invalidStateErr); 161 161 debug('Overflow/underflow'); 162 shouldThrow('stepUp("2010-02", " 1.7976931348623156e+308", null)', invalidStateErr);163 shouldThrow('stepDown("2010-02", " 1.7976931348623156e+308", null)', invalidStateErr);162 shouldThrow('stepUp("2010-02", "3.40282346e+38", null)', invalidStateErr); 163 shouldThrow('stepDown("2010-02", "3.40282346e+38", null)', invalidStateErr); 164 164 shouldThrow('stepUp("2010-02", "1", "2010-02")', invalidStateErr); 165 165 shouldThrow('stepDown("2010-02", "1", "2010-02")', invalidStateErr); … … 200 200 shouldThrow('stepDown("1", "1", "0", 2)', invalidStateErr); 201 201 shouldBe('input.value', '"1"'); 202 shouldThrow('stepDown("1", " 1.7976931348623156e+308", "", 2)', invalidStateErr);202 shouldThrow('stepDown("1", "3.40282346e+38", "", 2)', invalidStateErr); 203 203 shouldBe('stepUp("-1", "1", "0")', '"0"'); 204 204 shouldThrow('stepUp("0", "1", "0")', invalidStateErr); 205 205 shouldThrow('stepUp("-1", "1", "0", 2)', invalidStateErr); 206 206 shouldBe('input.value', '"-1"'); 207 shouldThrow('stepUp("1", " 1.7976931348623156e+308", "", 2)', invalidStateErr);207 shouldThrow('stepUp("1", "3.40282346e+38", "", 2)', invalidStateErr); 208 208 debug('stepDown()/stepUp() for stepMismatch values'); 209 209 shouldBe('stepUp("1", "2", "")', '"4"'); … … 214 214 shouldThrow('stepUp("89", "10", "99")', invalidStateErr); 215 215 debug('Huge value and small step'); 216 shouldBe('input.min = ""; stepUp("1e+3 08", "1", "", 999999)', '"1e+308"');217 shouldBe('input.max = ""; stepDown("1e+3 08", "1", "", 999999)', '"1e+308"');216 shouldBe('input.min = ""; stepUp("1e+38", "1", "", 999999)', '"1e+38"'); 217 shouldBe('input.max = ""; stepDown("1e+38", "1", "", 999999)', '"1e+38"'); 218 218 debug('Fractional numbers'); 219 219 shouldBe('input.min = ""; stepUp("0", "0.33333333333333333", "", 3)', '"1"'); … … 268 268 shouldThrow('stepDownExplicitBounds("0", null, "1", "1", "2")', invalidStateErr); 269 269 shouldBe('input.value', '"1"'); 270 shouldThrow('stepDownExplicitBounds(null, null, " 1.7976931348623156e+308", "1", "2")', invalidStateErr);270 shouldThrow('stepDownExplicitBounds(null, null, "3.40282346e+38", "1", "2")', invalidStateErr); 271 271 shouldBe('stepUpExplicitBounds(-100, 0, 1, -1)', '"0"'); 272 272 shouldThrow('stepUpExplicitBounds(null, 0, 1, 0)', invalidStateErr); 273 273 shouldThrow('stepUpExplicitBounds(-100, 0, 1, -1, 2)', invalidStateErr); 274 274 shouldBe('input.value', '"-1"'); 275 shouldThrow('stepUpExplicitBounds(null, null, " 1.7976931348623156e+308", "1", "2")', invalidStateErr);275 shouldThrow('stepUpExplicitBounds(null, null, "3.40282346e+38", "1", "2")', invalidStateErr); 276 276 debug('stepDown()/stepUp() for stepMismatch values'); 277 277 shouldBe('stepUpExplicitBounds(null, null, 2, 1)', '"4"'); … … 282 282 shouldThrow('stepUpExplicitBounds(null, 99, 10, 89)', invalidStateErr); 283 283 debug('Huge value and small step'); 284 shouldBe('stepUpExplicitBounds(0, 1e3 08, 1, 1e308, 999999)', '"1e+308"');285 shouldBe('stepDownExplicitBounds(0, 1e3 08, 1, 1e308, 999999)', '"1e+308"');284 shouldBe('stepUpExplicitBounds(0, 1e38, 1, 1e38, 999999)', '"1e+38"'); 285 shouldBe('stepDownExplicitBounds(0, 1e38, 1, 1e38, 999999)', '"1e+38"'); 286 286 debug('Fractional numbers'); 287 287 shouldBe('stepUpExplicitBounds(null, null, 0.33333333333333333, 0, 3)', '"1"'); … … 319 319 shouldThrow('stepDown("20:13", "any", null)', invalidStateErr); 320 320 debug('Overflow/underflow'); 321 shouldThrow('stepUp("20:13", " 1.7976931348623156e+308", null)', invalidStateErr);322 shouldThrow('stepDown("20:13", " 1.7976931348623156e+308", null)', invalidStateErr);321 shouldThrow('stepUp("20:13", "3.40282346e+38", null)', invalidStateErr); 322 shouldThrow('stepDown("20:13", "3.40282346e+38", null)', invalidStateErr); 323 323 shouldThrow('stepUp("20:13", "1", "20:13")', invalidStateErr); 324 324 shouldThrow('stepDown("20:13", "1", "20:13")', invalidStateErr); … … 350 350 shouldThrow('stepDown("2010-W02", "any", null)', invalidStateErr); 351 351 debug('Overflow/underflow'); 352 shouldThrow('stepUp("2010-W02", " 1.7976931348623156e+308", null)', invalidStateErr);353 shouldThrow('stepDown("2010-W02", " 1.7976931348623156e+308", null)', invalidStateErr);352 shouldThrow('stepUp("2010-W02", "3.40282346e+38", null)', invalidStateErr); 353 shouldThrow('stepDown("2010-W02", "3.40282346e+38", null)', invalidStateErr); 354 354 shouldThrow('stepUp("2010-W02", "1", "2010-W02")', invalidStateErr); 355 355 shouldThrow('stepDown("2010-W02", "1", "2010-W02")', invalidStateErr); -
trunk/LayoutTests/fast/forms/script-tests/input-valueasnumber-number.js
r53893 r70549 22 22 shouldBe('valueAsNumberFor("1.2E-10")', '1.2E-10'); 23 23 shouldBe('valueAsNumberFor("1.2E+10")', '1.2E10'); 24 shouldBe('valueAsNumberFor("123456789012345678901234567890123456789 01234567890")', '1.2345678901234567E+49');24 shouldBe('valueAsNumberFor("123456789012345678901234567890123456789")', '1.2345678901234568E+38'); 25 25 shouldBe('valueAsNumberFor("0.12345678901234567890123456789012345678901234567890")', '0.123456789012345678'); 26 26 … … 52 52 shouldBe('setValueAsNumberAndGetValue(1.2e10)', '"12000000000"'); 53 53 shouldBe('setValueAsNumberAndGetValue(1.2e-10)', '"1.2e-10"'); 54 shouldBe('setValueAsNumberAndGetValue(1.2345678901234567e+49)', '"1.2345678901234567e+49"'); 54 shouldBe('setValueAsNumberAndGetValue(1.2345678901234567e+38)', '"1.2345678901234567e+38"'); 55 shouldBe('setValueAsNumberAndGetValue("-3.40282346e+38")', '"-3.40282346e+38"'); 56 shouldThrow('setValueAsNumberAndGetValue("-3.40282348e+38")', '"Error: INVALID_STATE_ERR: DOM Exception 11"'); 57 shouldBe('setValueAsNumberAndGetValue("3.40282346e+38")', '"3.40282346e+38"'); 58 shouldThrow('setValueAsNumberAndGetValue("3.40282348e+38")', '"Error: INVALID_STATE_ERR: DOM Exception 11"'); 55 59 56 60 debug('Tests to set invalid values to valueAsNumber:'); -
trunk/LayoutTests/fast/forms/script-tests/input-valueasnumber-range.js
r53893 r70549 27 27 shouldBe('valueAsNumberFor("1.2E-10")', '0'); 28 28 shouldBe('valueAsNumberFor("1.2E+10")', '100'); 29 shouldBe('valueAsNumberFor("123456789012345678901234567890123456789 01234567890")', '100');29 shouldBe('valueAsNumberFor("123456789012345678901234567890123456789")', '100'); 30 30 shouldBe('valueAsNumberFor("0.12345678901234567890123456789012345678901234567890")', '0'); 31 31 … … 57 57 shouldBe('setValueAsNumberAndGetValue(1.2e10)', '"100"'); 58 58 shouldBe('setValueAsNumberAndGetValue(1.2e-10)', '"0"'); 59 shouldBe('setValueAsNumberAndGetValue(1.2345678901234567e+ 49)', '"100"');59 shouldBe('setValueAsNumberAndGetValue(1.2345678901234567e+38)', '"100"'); 60 60 61 61 debug('Tests to set invalid values to valueAsNumber:'); -
trunk/WebCore/ChangeLog
r70546 r70549 1 2010-10-26 Dai Mikurube <dmikurube@google.com> 2 3 Reviewed by Kent Tamura. 4 5 Number values should be in the range of IEEE 754 single-precision floating point number 6 https://bugs.webkit.org/show_bug.cgi?id=48221 7 8 Changed the range of number values to fit in IEEE 754 single-precision 9 10 * html/parser/HTMLParserIdioms.cpp: 11 (WebCore::parseToDoubleForNumberType): 12 * html/NumberInputType.cpp: 13 1 14 2010-10-26 David Hyatt <hyatt@apple.com> 2 15 -
trunk/WebCore/html/NumberInputType.cpp
r69445 r70549 44 44 using namespace std; 45 45 46 // FIXME: Number values should be in the range of IEEE 754 single-precision 47 // floating point number. 48 // http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#real-numbers 49 static const double numberDefaultMinimum = -DBL_MAX; 50 static const double numberDefaultMaximum = DBL_MAX; 46 static const double numberDefaultMinimum = -FLT_MAX; 47 static const double numberDefaultMaximum = FLT_MAX; 51 48 52 49 static const double numberDefaultStep = 1.0; … … 68 65 } 69 66 70 void NumberInputType::setValueAsNumber(double newValue, ExceptionCode& ) const67 void NumberInputType::setValueAsNumber(double newValue, ExceptionCode& ec) const 71 68 { 69 if (newValue < numberDefaultMinimum) { 70 ec = INVALID_STATE_ERR; 71 return; 72 } 73 if (newValue > numberDefaultMaximum) { 74 ec = INVALID_STATE_ERR; 75 return; 76 } 72 77 element()->setValue(serialize(newValue)); 73 78 } -
trunk/WebCore/html/parser/HTMLParserIdioms.cpp
r68854 r70549 84 84 return false; 85 85 86 // Numbers are considered finite IEEE 754 single-precision floating point values. 87 // See HTML5 2.4.4.3 `Real numbers.' 88 if (-FLT_MAX > value || value > FLT_MAX) 89 return false; 90 86 91 if (result) { 87 92 // The following expression converts -0 to +0.
Note: See TracChangeset
for help on using the changeset viewer.