[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 14:58:22 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 64f00a241f61f0e348cfe78a5ffaf7bb04cc39fe
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Oct 26 18:47:46 2010 +0000
2010-10-26 Dai Mikurube <dmikurube at google.com>
Reviewed by Kent Tamura.
Number values should be in the range of IEEE 754 single-precision floating point number
https://bugs.webkit.org/show_bug.cgi?id=48221
Changed tests and test expectations for number values to fit in the
range of IEEE 754 single-precision
* fast/forms/ValidityState-stepMismatch-expected.txt:
* fast/forms/input-stepup-stepdown-expected.txt:
* fast/forms/input-valueasnumber-number-expected.txt:
* fast/forms/input-valueasnumber-range-expected.txt:
* fast/forms/script-tests/ValidityState-stepMismatch.js:
* fast/forms/script-tests/input-stepup-stepdown.js:
* fast/forms/script-tests/input-valueasnumber-number.js:
* fast/forms/script-tests/input-valueasnumber-range.js:
2010-10-26 Dai Mikurube <dmikurube at google.com>
Reviewed by Kent Tamura.
Number values should be in the range of IEEE 754 single-precision floating point number
https://bugs.webkit.org/show_bug.cgi?id=48221
Changed the range of number values to fit in IEEE 754 single-precision
* html/parser/HTMLParserIdioms.cpp:
(WebCore::parseToDoubleForNumberType):
* html/NumberInputType.cpp:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70549 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 9e4c2d5..0a5bbed 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,22 @@
+2010-10-26 Dai Mikurube <dmikurube at google.com>
+
+ Reviewed by Kent Tamura.
+
+ Number values should be in the range of IEEE 754 single-precision floating point number
+ https://bugs.webkit.org/show_bug.cgi?id=48221
+
+ Changed tests and test expectations for number values to fit in the
+ range of IEEE 754 single-precision
+
+ * fast/forms/ValidityState-stepMismatch-expected.txt:
+ * fast/forms/input-stepup-stepdown-expected.txt:
+ * fast/forms/input-valueasnumber-number-expected.txt:
+ * fast/forms/input-valueasnumber-range-expected.txt:
+ * fast/forms/script-tests/ValidityState-stepMismatch.js:
+ * fast/forms/script-tests/input-stepup-stepdown.js:
+ * fast/forms/script-tests/input-valueasnumber-number.js:
+ * fast/forms/script-tests/input-valueasnumber-range.js:
+
2010-10-26 Simon Fraser <simon.fraser at apple.com>
Reviewed by Sam Weinig.
diff --git a/LayoutTests/fast/forms/ValidityState-stepMismatch-expected.txt b/LayoutTests/fast/forms/ValidityState-stepMismatch-expected.txt
index 7b76075..f072640 100644
--- a/LayoutTests/fast/forms/ValidityState-stepMismatch-expected.txt
+++ b/LayoutTests/fast/forms/ValidityState-stepMismatch-expected.txt
@@ -131,12 +131,12 @@ PASS stepMismatchFor("-3", "-2", "-4") is false
PASS stepMismatchFor("-3", null, "-4") is false
PASS stepMismatchFor("-3", undefined, "-4") is false
Huge numbers and small step; uncomparable
-PASS stepMismatchFor("1.7976931348623157e+308", "3", "") is false
-PASS stepMismatchFor("1.7976931348623156e+308", "3", "") is false
-PASS stepMismatchFor("1.7976931348623155e+308", "3", "") is false
+PASS stepMismatchFor("3.40282347e+38", "3", "") is false
+PASS stepMismatchFor("3.40282346e+38", "3", "") is false
+PASS stepMismatchFor("3.40282345e+38", "3", "") is false
Huge numbers and huge step
-PASS stepMismatchFor("1.60e+308", "0.20e+308", "") is false
-PASS stepMismatchFor("1.60e+308", "0.22e+308", "") is true
+PASS stepMismatchFor("3.20e+38", "0.20e+38", "") is false
+PASS stepMismatchFor("3.20e+38", "0.22e+38", "") is true
Fractional numbers
PASS stepMismatchFor("0.9", "0.1", "") is false
PASS stepMismatchFor("0.9", "0.1000001", "") is true
@@ -157,12 +157,12 @@ PASS stepMismatchFor("-3", "-2", "-4") is false
PASS stepMismatchFor("-3", null, "-4") is false
PASS stepMismatchFor("-3", undefined, "-4") is false
Huge numbers and small step; uncomparable
-PASS stepMismatchFor("1.7976931348623157e+308", "3", "") is false
-PASS stepMismatchFor("1.7976931348623156e+308", "3", "") is false
-PASS stepMismatchFor("1.7976931348623155e+308", "3", "") is false
+PASS stepMismatchFor("3.40282347e+38", "3", "") is false
+PASS stepMismatchFor("3.40282346e+38", "3", "") is false
+PASS stepMismatchFor("3.40282345e+38", "3", "") is false
Huge numbers and huge step
-PASS stepMismatchFor("1.60e+308", "0.20e+308", "") is false
-PASS stepMismatchFor("1.60e+308", "0.22e+308", "") is false
+PASS stepMismatchFor("3.20e+38", "0.20e+38", "") is false
+PASS stepMismatchFor("3.20e+38", "0.22e+38", "") is false
Fractional numbers
PASS stepMismatchFor("0.9", "0.1", "") is false
PASS stepMismatchFor("0.9", "0.1000001", "") is false
diff --git a/LayoutTests/fast/forms/input-stepup-stepdown-expected.txt b/LayoutTests/fast/forms/input-stepup-stepdown-expected.txt
index c181b23..fabb787 100644
--- a/LayoutTests/fast/forms/input-stepup-stepdown-expected.txt
+++ b/LayoutTests/fast/forms/input-stepup-stepdown-expected.txt
@@ -25,8 +25,8 @@ Step=any
PASS stepUp("2010-02-10", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS stepDown("2010-02-10", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
Overflow/underflow
-PASS stepUp("2010-02-10", "1.7976931348623156e+308", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
-PASS stepDown("2010-02-10", "1.7976931348623156e+308", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
+PASS stepUp("2010-02-10", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
+PASS stepDown("2010-02-10", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS stepUp("2010-02-10", "1", "2010-02-10") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS stepDown("2010-02-10", "1", "2010-02-10") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
@@ -52,8 +52,8 @@ Step=any
PASS stepUp("2010-02-10T20:13Z", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS stepDown("2010-02-10T20:13Z", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
Overflow/underflow
-PASS stepUp("2010-02-10T20:13Z", "1.7976931348623156e+308", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
-PASS stepDown("2010-02-10T20:13Z", "1.7976931348623156e+308", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
+PASS stepUp("2010-02-10T20:13Z", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
+PASS stepDown("2010-02-10T20:13Z", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS stepUp("2010-02-10T20:13Z", "1", "2010-02-10T20:13Z") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS stepDown("2010-02-10T20:13Z", "1", "2010-02-10T20:13Z") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
@@ -79,8 +79,8 @@ Step=any
PASS stepUp("2010-02-10T20:13", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS stepDown("2010-02-10T20:13", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
Overflow/underflow
-PASS stepUp("2010-02-10T20:13", "1.7976931348623156e+308", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
-PASS stepDown("2010-02-10T20:13", "1.7976931348623156e+308", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
+PASS stepUp("2010-02-10T20:13", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
+PASS stepDown("2010-02-10T20:13", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS stepUp("2010-02-10T20:13", "1", "2010-02-10T20:13") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS stepDown("2010-02-10T20:13", "1", "2010-02-10T20:13") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
@@ -106,8 +106,8 @@ Step=any
PASS stepUp("2010-02", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS stepDown("2010-02", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
Overflow/underflow
-PASS stepUp("2010-02", "1.7976931348623156e+308", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
-PASS stepDown("2010-02", "1.7976931348623156e+308", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
+PASS stepUp("2010-02", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
+PASS stepDown("2010-02", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS stepUp("2010-02", "1", "2010-02") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS stepDown("2010-02", "1", "2010-02") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
@@ -144,12 +144,12 @@ PASS stepDown("1", "1", "0") is "0"
PASS stepDown("0", "1", "0") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS stepDown("1", "1", "0", 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS input.value is "1"
-PASS stepDown("1", "1.7976931348623156e+308", "", 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
+PASS stepDown("1", "3.40282346e+38", "", 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS stepUp("-1", "1", "0") is "0"
PASS stepUp("0", "1", "0") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS stepUp("-1", "1", "0", 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS input.value is "-1"
-PASS stepUp("1", "1.7976931348623156e+308", "", 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
+PASS stepUp("1", "3.40282346e+38", "", 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
stepDown()/stepUp() for stepMismatch values
PASS stepUp("1", "2", "") is "4"
PASS input.stepDown(); input.value is "2"
@@ -157,8 +157,8 @@ PASS input.min = "0"; stepUp("9", "10", "", 9) is "100"
PASS stepDown("19", "10", "0") is "10"
PASS stepUp("89", "10", "99") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
Huge value and small step
-PASS input.min = ""; stepUp("1e+308", "1", "", 999999) is "1e+308"
-PASS input.max = ""; stepDown("1e+308", "1", "", 999999) is "1e+308"
+PASS input.min = ""; stepUp("1e+38", "1", "", 999999) is "1e+38"
+PASS input.max = ""; stepDown("1e+38", "1", "", 999999) is "1e+38"
Fractional numbers
PASS input.min = ""; stepUp("0", "0.33333333333333333", "", 3) is "1"
PASS stepUp("1", "0.1", "", 10) is "2"
@@ -209,12 +209,12 @@ PASS stepDownExplicitBounds("0", null, "1", "0") threw exception Error: INVALID_
PASS input.value is "0"
PASS stepDownExplicitBounds("0", null, "1", "1", "2") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS input.value is "1"
-PASS stepDownExplicitBounds(null, null, "1.7976931348623156e+308", "1", "2") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
+PASS stepDownExplicitBounds(null, null, "3.40282346e+38", "1", "2") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS stepUpExplicitBounds(-100, 0, 1, -1) is "0"
PASS stepUpExplicitBounds(null, 0, 1, 0) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS stepUpExplicitBounds(-100, 0, 1, -1, 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS input.value is "-1"
-PASS stepUpExplicitBounds(null, null, "1.7976931348623156e+308", "1", "2") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
+PASS stepUpExplicitBounds(null, null, "3.40282346e+38", "1", "2") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
stepDown()/stepUp() for stepMismatch values
PASS stepUpExplicitBounds(null, null, 2, 1) is "4"
PASS input.stepDown(); input.value is "2"
@@ -223,8 +223,8 @@ PASS stepDownExplicitBounds(0, null, 10, 19) is "10"
value + step is <= max, but rounded result would be > max.
PASS stepUpExplicitBounds(null, 99, 10, 89) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
Huge value and small step
-PASS stepUpExplicitBounds(0, 1e308, 1, 1e308, 999999) is "1e+308"
-PASS stepDownExplicitBounds(0, 1e308, 1, 1e308, 999999) is "1e+308"
+PASS stepUpExplicitBounds(0, 1e38, 1, 1e38, 999999) is "1e+38"
+PASS stepDownExplicitBounds(0, 1e38, 1, 1e38, 999999) is "1e+38"
Fractional numbers
PASS stepUpExplicitBounds(null, null, 0.33333333333333333, 0, 3) is "1"
PASS stepUpExplicitBounds(null, null, 0.1, 1) is "1.1"
@@ -258,8 +258,8 @@ Step=any
PASS stepUp("20:13", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS stepDown("20:13", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
Overflow/underflow
-PASS stepUp("20:13", "1.7976931348623156e+308", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
-PASS stepDown("20:13", "1.7976931348623156e+308", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
+PASS stepUp("20:13", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
+PASS stepDown("20:13", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS stepUp("20:13", "1", "20:13") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS stepDown("20:13", "1", "20:13") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS stepUp("23:59", null, null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
@@ -287,8 +287,8 @@ Step=any
PASS stepUp("2010-W02", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS stepDown("2010-W02", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
Overflow/underflow
-PASS stepUp("2010-W02", "1.7976931348623156e+308", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
-PASS stepDown("2010-W02", "1.7976931348623156e+308", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
+PASS stepUp("2010-W02", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
+PASS stepDown("2010-W02", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS stepUp("2010-W02", "1", "2010-W02") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS stepDown("2010-W02", "1", "2010-W02") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
diff --git a/LayoutTests/fast/forms/input-valueasnumber-number-expected.txt b/LayoutTests/fast/forms/input-valueasnumber-number-expected.txt
index 0d2030c..71147fd 100644
--- a/LayoutTests/fast/forms/input-valueasnumber-number-expected.txt
+++ b/LayoutTests/fast/forms/input-valueasnumber-number-expected.txt
@@ -11,7 +11,7 @@ PASS valueAsNumberFor("-1.2") is -1.2
PASS valueAsNumberFor("1.2E10") is 1.2E10
PASS valueAsNumberFor("1.2E-10") is 1.2E-10
PASS valueAsNumberFor("1.2E+10") is 1.2E10
-PASS valueAsNumberFor("12345678901234567890123456789012345678901234567890") is 1.2345678901234567E+49
+PASS valueAsNumberFor("123456789012345678901234567890123456789") is 1.2345678901234568E+38
PASS valueAsNumberFor("0.12345678901234567890123456789012345678901234567890") is 0.123456789012345678
valueAsNumber for invalid string values:
PASS isNaN(valueAsNumberFor("")) is true
@@ -38,7 +38,11 @@ PASS setValueAsNumberAndGetValue(-0) is "0"
PASS setValueAsNumberAndGetValue(-1.2) is "-1.2"
PASS setValueAsNumberAndGetValue(1.2e10) is "12000000000"
PASS setValueAsNumberAndGetValue(1.2e-10) is "1.2e-10"
-PASS setValueAsNumberAndGetValue(1.2345678901234567e+49) is "1.2345678901234567e+49"
+PASS setValueAsNumberAndGetValue(1.2345678901234567e+38) is "1.2345678901234567e+38"
+PASS setValueAsNumberAndGetValue("-3.40282346e+38") is "-3.40282346e+38"
+PASS setValueAsNumberAndGetValue("-3.40282348e+38") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
+PASS setValueAsNumberAndGetValue("3.40282346e+38") is "3.40282346e+38"
+PASS setValueAsNumberAndGetValue("3.40282348e+38") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
Tests to set invalid values to valueAsNumber:
PASS setValueAsNumberAndGetValue(null) is "0"
PASS setValueAsNumberAndGetValue("foo") threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
diff --git a/LayoutTests/fast/forms/input-valueasnumber-range-expected.txt b/LayoutTests/fast/forms/input-valueasnumber-range-expected.txt
index 4fbe286..3be7794 100644
--- a/LayoutTests/fast/forms/input-valueasnumber-range-expected.txt
+++ b/LayoutTests/fast/forms/input-valueasnumber-range-expected.txt
@@ -11,7 +11,7 @@ PASS valueAsNumberFor("-1.2") is 0
PASS valueAsNumberFor("1.2E10") is 100
PASS valueAsNumberFor("1.2E-10") is 0
PASS valueAsNumberFor("1.2E+10") is 100
-PASS valueAsNumberFor("12345678901234567890123456789012345678901234567890") is 100
+PASS valueAsNumberFor("123456789012345678901234567890123456789") is 100
PASS valueAsNumberFor("0.12345678901234567890123456789012345678901234567890") is 0
valueAsNumber for invalid string values:
PASS valueAsNumberFor("") is 50
@@ -38,7 +38,7 @@ PASS setValueAsNumberAndGetValue(-0) is "0"
PASS setValueAsNumberAndGetValue(-1.2) is "0"
PASS setValueAsNumberAndGetValue(1.2e10) is "100"
PASS setValueAsNumberAndGetValue(1.2e-10) is "0"
-PASS setValueAsNumberAndGetValue(1.2345678901234567e+49) is "100"
+PASS setValueAsNumberAndGetValue(1.2345678901234567e+38) is "100"
Tests to set invalid values to valueAsNumber:
PASS setValueAsNumberAndGetValue(null) is "0"
PASS setValueAsNumberAndGetValue("foo") threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
diff --git a/LayoutTests/fast/forms/script-tests/ValidityState-stepMismatch.js b/LayoutTests/fast/forms/script-tests/ValidityState-stepMismatch.js
index 61faec9..6322e96 100644
--- a/LayoutTests/fast/forms/script-tests/ValidityState-stepMismatch.js
+++ b/LayoutTests/fast/forms/script-tests/ValidityState-stepMismatch.js
@@ -148,12 +148,12 @@ shouldBe('stepMismatchFor("-3", "-2", "-4")', 'false');
shouldBe('stepMismatchFor("-3", null, "-4")', 'false');
shouldBe('stepMismatchFor("-3", undefined, "-4")', 'false');
debug('Huge numbers and small step; uncomparable');
-shouldBe('stepMismatchFor("1.7976931348623157e+308", "3", "")', 'false');
-shouldBe('stepMismatchFor("1.7976931348623156e+308", "3", "")', 'false');
-shouldBe('stepMismatchFor("1.7976931348623155e+308", "3", "")', 'false');
+shouldBe('stepMismatchFor("3.40282347e+38", "3", "")', 'false');
+shouldBe('stepMismatchFor("3.40282346e+38", "3", "")', 'false');
+shouldBe('stepMismatchFor("3.40282345e+38", "3", "")', 'false');
debug('Huge numbers and huge step');
-shouldBe('stepMismatchFor("1.60e+308", "0.20e+308", "")', 'false');
-shouldBe('stepMismatchFor("1.60e+308", "0.22e+308", "")', 'true');
+shouldBe('stepMismatchFor("3.20e+38", "0.20e+38", "")', 'false');
+shouldBe('stepMismatchFor("3.20e+38", "0.22e+38", "")', 'true');
debug('Fractional numbers');
shouldBe('stepMismatchFor("0.9", "0.1", "")', 'false');
shouldBe('stepMismatchFor("0.9", "0.1000001", "")', 'true');
@@ -179,12 +179,12 @@ shouldBe('stepMismatchFor("-3", "-2", "-4")', 'false');
shouldBe('stepMismatchFor("-3", null, "-4")', 'false');
shouldBe('stepMismatchFor("-3", undefined, "-4")', 'false');
debug('Huge numbers and small step; uncomparable');
-shouldBe('stepMismatchFor("1.7976931348623157e+308", "3", "")', 'false');
-shouldBe('stepMismatchFor("1.7976931348623156e+308", "3", "")', 'false');
-shouldBe('stepMismatchFor("1.7976931348623155e+308", "3", "")', 'false');
+shouldBe('stepMismatchFor("3.40282347e+38", "3", "")', 'false');
+shouldBe('stepMismatchFor("3.40282346e+38", "3", "")', 'false');
+shouldBe('stepMismatchFor("3.40282345e+38", "3", "")', 'false');
debug('Huge numbers and huge step');
-shouldBe('stepMismatchFor("1.60e+308", "0.20e+308", "")', 'false');
-shouldBe('stepMismatchFor("1.60e+308", "0.22e+308", "")', 'false');
+shouldBe('stepMismatchFor("3.20e+38", "0.20e+38", "")', 'false');
+shouldBe('stepMismatchFor("3.20e+38", "0.22e+38", "")', 'false');
debug('Fractional numbers');
shouldBe('stepMismatchFor("0.9", "0.1", "")', 'false');
shouldBe('stepMismatchFor("0.9", "0.1000001", "")', 'false');
diff --git a/LayoutTests/fast/forms/script-tests/input-stepup-stepdown.js b/LayoutTests/fast/forms/script-tests/input-stepup-stepdown.js
index 732077c..cd4a07c 100644
--- a/LayoutTests/fast/forms/script-tests/input-stepup-stepdown.js
+++ b/LayoutTests/fast/forms/script-tests/input-stepup-stepdown.js
@@ -72,8 +72,8 @@ debug('Step=any');
shouldThrow('stepUp("2010-02-10", "any", null)', invalidStateErr);
shouldThrow('stepDown("2010-02-10", "any", null)', invalidStateErr);
debug('Overflow/underflow');
-shouldThrow('stepUp("2010-02-10", "1.7976931348623156e+308", null)', invalidStateErr);
-shouldThrow('stepDown("2010-02-10", "1.7976931348623156e+308", null)', invalidStateErr);
+shouldThrow('stepUp("2010-02-10", "3.40282346e+38", null)', invalidStateErr);
+shouldThrow('stepDown("2010-02-10", "3.40282346e+38", null)', invalidStateErr);
shouldThrow('stepUp("2010-02-10", "1", "2010-02-10")', invalidStateErr);
shouldThrow('stepDown("2010-02-10", "1", "2010-02-10")', invalidStateErr);
@@ -101,8 +101,8 @@ debug('Step=any');
shouldThrow('stepUp("2010-02-10T20:13Z", "any", null)', invalidStateErr);
shouldThrow('stepDown("2010-02-10T20:13Z", "any", null)', invalidStateErr);
debug('Overflow/underflow');
-shouldThrow('stepUp("2010-02-10T20:13Z", "1.7976931348623156e+308", null)', invalidStateErr);
-shouldThrow('stepDown("2010-02-10T20:13Z", "1.7976931348623156e+308", null)', invalidStateErr);
+shouldThrow('stepUp("2010-02-10T20:13Z", "3.40282346e+38", null)', invalidStateErr);
+shouldThrow('stepDown("2010-02-10T20:13Z", "3.40282346e+38", null)', invalidStateErr);
shouldThrow('stepUp("2010-02-10T20:13Z", "1", "2010-02-10T20:13Z")', invalidStateErr);
shouldThrow('stepDown("2010-02-10T20:13Z", "1", "2010-02-10T20:13Z")', invalidStateErr);
@@ -130,8 +130,8 @@ debug('Step=any');
shouldThrow('stepUp("2010-02-10T20:13", "any", null)', invalidStateErr);
shouldThrow('stepDown("2010-02-10T20:13", "any", null)', invalidStateErr);
debug('Overflow/underflow');
-shouldThrow('stepUp("2010-02-10T20:13", "1.7976931348623156e+308", null)', invalidStateErr);
-shouldThrow('stepDown("2010-02-10T20:13", "1.7976931348623156e+308", null)', invalidStateErr);
+shouldThrow('stepUp("2010-02-10T20:13", "3.40282346e+38", null)', invalidStateErr);
+shouldThrow('stepDown("2010-02-10T20:13", "3.40282346e+38", null)', invalidStateErr);
shouldThrow('stepUp("2010-02-10T20:13", "1", "2010-02-10T20:13")', invalidStateErr);
shouldThrow('stepDown("2010-02-10T20:13", "1", "2010-02-10T20:13")', invalidStateErr);
@@ -159,8 +159,8 @@ debug('Step=any');
shouldThrow('stepUp("2010-02", "any", null)', invalidStateErr);
shouldThrow('stepDown("2010-02", "any", null)', invalidStateErr);
debug('Overflow/underflow');
-shouldThrow('stepUp("2010-02", "1.7976931348623156e+308", null)', invalidStateErr);
-shouldThrow('stepDown("2010-02", "1.7976931348623156e+308", null)', invalidStateErr);
+shouldThrow('stepUp("2010-02", "3.40282346e+38", null)', invalidStateErr);
+shouldThrow('stepDown("2010-02", "3.40282346e+38", null)', invalidStateErr);
shouldThrow('stepUp("2010-02", "1", "2010-02")', invalidStateErr);
shouldThrow('stepDown("2010-02", "1", "2010-02")', invalidStateErr);
@@ -199,12 +199,12 @@ shouldBe('stepDown("1", "1", "0")', '"0"');
shouldThrow('stepDown("0", "1", "0")', invalidStateErr);
shouldThrow('stepDown("1", "1", "0", 2)', invalidStateErr);
shouldBe('input.value', '"1"');
-shouldThrow('stepDown("1", "1.7976931348623156e+308", "", 2)', invalidStateErr);
+shouldThrow('stepDown("1", "3.40282346e+38", "", 2)', invalidStateErr);
shouldBe('stepUp("-1", "1", "0")', '"0"');
shouldThrow('stepUp("0", "1", "0")', invalidStateErr);
shouldThrow('stepUp("-1", "1", "0", 2)', invalidStateErr);
shouldBe('input.value', '"-1"');
-shouldThrow('stepUp("1", "1.7976931348623156e+308", "", 2)', invalidStateErr);
+shouldThrow('stepUp("1", "3.40282346e+38", "", 2)', invalidStateErr);
debug('stepDown()/stepUp() for stepMismatch values');
shouldBe('stepUp("1", "2", "")', '"4"');
shouldBe('input.stepDown(); input.value', '"2"');
@@ -213,8 +213,8 @@ shouldBe('stepDown("19", "10", "0")', '"10"');
// value + step is <= max, but rounded result would be > max.
shouldThrow('stepUp("89", "10", "99")', invalidStateErr);
debug('Huge value and small step');
-shouldBe('input.min = ""; stepUp("1e+308", "1", "", 999999)', '"1e+308"');
-shouldBe('input.max = ""; stepDown("1e+308", "1", "", 999999)', '"1e+308"');
+shouldBe('input.min = ""; stepUp("1e+38", "1", "", 999999)', '"1e+38"');
+shouldBe('input.max = ""; stepDown("1e+38", "1", "", 999999)', '"1e+38"');
debug('Fractional numbers');
shouldBe('input.min = ""; stepUp("0", "0.33333333333333333", "", 3)', '"1"');
shouldBe('stepUp("1", "0.1", "", 10)', '"2"');
@@ -267,12 +267,12 @@ shouldThrow('stepDownExplicitBounds("0", null, "1", "0")', invalidStateErr);
shouldBe('input.value', '"0"');
shouldThrow('stepDownExplicitBounds("0", null, "1", "1", "2")', invalidStateErr);
shouldBe('input.value', '"1"');
-shouldThrow('stepDownExplicitBounds(null, null, "1.7976931348623156e+308", "1", "2")', invalidStateErr);
+shouldThrow('stepDownExplicitBounds(null, null, "3.40282346e+38", "1", "2")', invalidStateErr);
shouldBe('stepUpExplicitBounds(-100, 0, 1, -1)', '"0"');
shouldThrow('stepUpExplicitBounds(null, 0, 1, 0)', invalidStateErr);
shouldThrow('stepUpExplicitBounds(-100, 0, 1, -1, 2)', invalidStateErr);
shouldBe('input.value', '"-1"');
-shouldThrow('stepUpExplicitBounds(null, null, "1.7976931348623156e+308", "1", "2")', invalidStateErr);
+shouldThrow('stepUpExplicitBounds(null, null, "3.40282346e+38", "1", "2")', invalidStateErr);
debug('stepDown()/stepUp() for stepMismatch values');
shouldBe('stepUpExplicitBounds(null, null, 2, 1)', '"4"');
shouldBe('input.stepDown(); input.value', '"2"');
@@ -281,8 +281,8 @@ shouldBe('stepDownExplicitBounds(0, null, 10, 19)', '"10"');
debug('value + step is <= max, but rounded result would be > max.');
shouldThrow('stepUpExplicitBounds(null, 99, 10, 89)', invalidStateErr);
debug('Huge value and small step');
-shouldBe('stepUpExplicitBounds(0, 1e308, 1, 1e308, 999999)', '"1e+308"');
-shouldBe('stepDownExplicitBounds(0, 1e308, 1, 1e308, 999999)', '"1e+308"');
+shouldBe('stepUpExplicitBounds(0, 1e38, 1, 1e38, 999999)', '"1e+38"');
+shouldBe('stepDownExplicitBounds(0, 1e38, 1, 1e38, 999999)', '"1e+38"');
debug('Fractional numbers');
shouldBe('stepUpExplicitBounds(null, null, 0.33333333333333333, 0, 3)', '"1"');
shouldBe('stepUpExplicitBounds(null, null, 0.1, 1)', '"1.1"');
@@ -318,8 +318,8 @@ debug('Step=any');
shouldThrow('stepUp("20:13", "any", null)', invalidStateErr);
shouldThrow('stepDown("20:13", "any", null)', invalidStateErr);
debug('Overflow/underflow');
-shouldThrow('stepUp("20:13", "1.7976931348623156e+308", null)', invalidStateErr);
-shouldThrow('stepDown("20:13", "1.7976931348623156e+308", null)', invalidStateErr);
+shouldThrow('stepUp("20:13", "3.40282346e+38", null)', invalidStateErr);
+shouldThrow('stepDown("20:13", "3.40282346e+38", null)', invalidStateErr);
shouldThrow('stepUp("20:13", "1", "20:13")', invalidStateErr);
shouldThrow('stepDown("20:13", "1", "20:13")', invalidStateErr);
shouldThrow('stepUp("23:59", null, null)', invalidStateErr);
@@ -349,8 +349,8 @@ debug('Step=any');
shouldThrow('stepUp("2010-W02", "any", null)', invalidStateErr);
shouldThrow('stepDown("2010-W02", "any", null)', invalidStateErr);
debug('Overflow/underflow');
-shouldThrow('stepUp("2010-W02", "1.7976931348623156e+308", null)', invalidStateErr);
-shouldThrow('stepDown("2010-W02", "1.7976931348623156e+308", null)', invalidStateErr);
+shouldThrow('stepUp("2010-W02", "3.40282346e+38", null)', invalidStateErr);
+shouldThrow('stepDown("2010-W02", "3.40282346e+38", null)', invalidStateErr);
shouldThrow('stepUp("2010-W02", "1", "2010-W02")', invalidStateErr);
shouldThrow('stepDown("2010-W02", "1", "2010-W02")', invalidStateErr);
diff --git a/LayoutTests/fast/forms/script-tests/input-valueasnumber-number.js b/LayoutTests/fast/forms/script-tests/input-valueasnumber-number.js
index b166937..2797591 100644
--- a/LayoutTests/fast/forms/script-tests/input-valueasnumber-number.js
+++ b/LayoutTests/fast/forms/script-tests/input-valueasnumber-number.js
@@ -21,7 +21,7 @@ shouldBe('valueAsNumberFor("-1.2")', '-1.2');
shouldBe('valueAsNumberFor("1.2E10")', '1.2E10');
shouldBe('valueAsNumberFor("1.2E-10")', '1.2E-10');
shouldBe('valueAsNumberFor("1.2E+10")', '1.2E10');
-shouldBe('valueAsNumberFor("12345678901234567890123456789012345678901234567890")', '1.2345678901234567E+49');
+shouldBe('valueAsNumberFor("123456789012345678901234567890123456789")', '1.2345678901234568E+38');
shouldBe('valueAsNumberFor("0.12345678901234567890123456789012345678901234567890")', '0.123456789012345678');
debug('valueAsNumber for invalid string values:');
@@ -51,7 +51,11 @@ shouldBe('setValueAsNumberAndGetValue(-0)', '"0"');
shouldBe('setValueAsNumberAndGetValue(-1.2)', '"-1.2"');
shouldBe('setValueAsNumberAndGetValue(1.2e10)', '"12000000000"');
shouldBe('setValueAsNumberAndGetValue(1.2e-10)', '"1.2e-10"');
-shouldBe('setValueAsNumberAndGetValue(1.2345678901234567e+49)', '"1.2345678901234567e+49"');
+shouldBe('setValueAsNumberAndGetValue(1.2345678901234567e+38)', '"1.2345678901234567e+38"');
+shouldBe('setValueAsNumberAndGetValue("-3.40282346e+38")', '"-3.40282346e+38"');
+shouldThrow('setValueAsNumberAndGetValue("-3.40282348e+38")', '"Error: INVALID_STATE_ERR: DOM Exception 11"');
+shouldBe('setValueAsNumberAndGetValue("3.40282346e+38")', '"3.40282346e+38"');
+shouldThrow('setValueAsNumberAndGetValue("3.40282348e+38")', '"Error: INVALID_STATE_ERR: DOM Exception 11"');
debug('Tests to set invalid values to valueAsNumber:');
shouldBe('setValueAsNumberAndGetValue(null)', '"0"');
diff --git a/LayoutTests/fast/forms/script-tests/input-valueasnumber-range.js b/LayoutTests/fast/forms/script-tests/input-valueasnumber-range.js
index 97d17e8..0da6d0f 100644
--- a/LayoutTests/fast/forms/script-tests/input-valueasnumber-range.js
+++ b/LayoutTests/fast/forms/script-tests/input-valueasnumber-range.js
@@ -26,7 +26,7 @@ shouldBe('valueAsNumberFor("-1.2")', '0');
shouldBe('valueAsNumberFor("1.2E10")', '100');
shouldBe('valueAsNumberFor("1.2E-10")', '0');
shouldBe('valueAsNumberFor("1.2E+10")', '100');
-shouldBe('valueAsNumberFor("12345678901234567890123456789012345678901234567890")', '100');
+shouldBe('valueAsNumberFor("123456789012345678901234567890123456789")', '100');
shouldBe('valueAsNumberFor("0.12345678901234567890123456789012345678901234567890")', '0');
debug('valueAsNumber for invalid string values:');
@@ -56,7 +56,7 @@ shouldBe('setValueAsNumberAndGetValue(-0)', '"0"');
shouldBe('setValueAsNumberAndGetValue(-1.2)', '"0"');
shouldBe('setValueAsNumberAndGetValue(1.2e10)', '"100"');
shouldBe('setValueAsNumberAndGetValue(1.2e-10)', '"0"');
-shouldBe('setValueAsNumberAndGetValue(1.2345678901234567e+49)', '"100"');
+shouldBe('setValueAsNumberAndGetValue(1.2345678901234567e+38)', '"100"');
debug('Tests to set invalid values to valueAsNumber:');
shouldBe('setValueAsNumberAndGetValue(null)', '"0"');
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 0320dbf..aa3447c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-10-26 Dai Mikurube <dmikurube at google.com>
+
+ Reviewed by Kent Tamura.
+
+ Number values should be in the range of IEEE 754 single-precision floating point number
+ https://bugs.webkit.org/show_bug.cgi?id=48221
+
+ Changed the range of number values to fit in IEEE 754 single-precision
+
+ * html/parser/HTMLParserIdioms.cpp:
+ (WebCore::parseToDoubleForNumberType):
+ * html/NumberInputType.cpp:
+
2010-10-26 David Hyatt <hyatt at apple.com>
Reviewed by Sam Weinig.
diff --git a/WebCore/html/NumberInputType.cpp b/WebCore/html/NumberInputType.cpp
index a4e118c..b60e2ee 100644
--- a/WebCore/html/NumberInputType.cpp
+++ b/WebCore/html/NumberInputType.cpp
@@ -43,11 +43,8 @@ namespace WebCore {
using namespace HTMLNames;
using namespace std;
-// FIXME: Number values should be in the range of IEEE 754 single-precision
-// floating point number.
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#real-numbers
-static const double numberDefaultMinimum = -DBL_MAX;
-static const double numberDefaultMaximum = DBL_MAX;
+static const double numberDefaultMinimum = -FLT_MAX;
+static const double numberDefaultMaximum = FLT_MAX;
static const double numberDefaultStep = 1.0;
static const double numberStepScaleFactor = 1.0;
@@ -67,8 +64,16 @@ double NumberInputType::valueAsNumber() const
return parseToDouble(element()->value(), numeric_limits<double>::quiet_NaN());
}
-void NumberInputType::setValueAsNumber(double newValue, ExceptionCode&) const
+void NumberInputType::setValueAsNumber(double newValue, ExceptionCode& ec) const
{
+ if (newValue < numberDefaultMinimum) {
+ ec = INVALID_STATE_ERR;
+ return;
+ }
+ if (newValue > numberDefaultMaximum) {
+ ec = INVALID_STATE_ERR;
+ return;
+ }
element()->setValue(serialize(newValue));
}
diff --git a/WebCore/html/parser/HTMLParserIdioms.cpp b/WebCore/html/parser/HTMLParserIdioms.cpp
index f093eb2..0ce5e4d 100644
--- a/WebCore/html/parser/HTMLParserIdioms.cpp
+++ b/WebCore/html/parser/HTMLParserIdioms.cpp
@@ -83,6 +83,11 @@ bool parseToDoubleForNumberType(const String& string, double* result)
if (!isfinite(value))
return false;
+ // Numbers are considered finite IEEE 754 single-precision floating point values.
+ // See HTML5 2.4.4.3 `Real numbers.'
+ if (-FLT_MAX > value || value > FLT_MAX)
+ return false;
+
if (result) {
// The following expression converts -0 to +0.
*result = value ? value : 0;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list