[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 16:10:38 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit b771a2dcaac8263b78acd24096790119e40c66e0
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Nov 19 12:13:44 2010 +0000

    2010-11-19  Dai Mikurube  <dmikurube at google.com>
    
            Reviewed by Kent Tamura.
    
            stepUp/stepDown for values in step-mismatching state for input elements
            https://bugs.webkit.org/show_bug.cgi?id=48976
    
            * fast/forms/input-stepup-stepdown-expected.txt:
            * fast/forms/script-tests/input-stepup-stepdown.js:
    2010-11-19  Dai Mikurube  <dmikurube at google.com>
    
            Reviewed by Kent Tamura.
    
            stepUp/stepDown for values in step-mismatching state for input elements
            https://bugs.webkit.org/show_bug.cgi?id=48976
    
            Fixed stepUp/stepDown behaviors for step-mismatching values to follow the specification of
            HTML5 4.10.7.3 Common input element APIs. In details, disabled any stepwise adjustment for
            step-mismatching values.
    
            * html/HTMLInputElement.cpp:
            (WebCore::HTMLInputElement::applyStep):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72377 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index c0e1d3a..460f755 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-11-19  Dai Mikurube  <dmikurube at google.com>
+
+        Reviewed by Kent Tamura.
+
+        stepUp/stepDown for values in step-mismatching state for input elements
+        https://bugs.webkit.org/show_bug.cgi?id=48976
+
+        * fast/forms/input-stepup-stepdown-expected.txt:
+        * fast/forms/script-tests/input-stepup-stepdown.js:
+
 2010-11-19  Mike Lawther  <mikelawther at chromium.org>
 
         Reviewed by James Robinson.
diff --git a/LayoutTests/fast/forms/input-stepup-stepdown-expected.txt b/LayoutTests/fast/forms/input-stepup-stepdown-expected.txt
index 1ded86d..40f7041 100644
--- a/LayoutTests/fast/forms/input-stepup-stepdown-expected.txt
+++ b/LayoutTests/fast/forms/input-stepup-stepdown-expected.txt
@@ -151,11 +151,11 @@ PASS stepUp("-1", "1", "0", 2) threw exception Error: INVALID_STATE_ERR: DOM Exc
 PASS input.value is "-1"
 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"
-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.
+PASS stepUp("1", "2", "") is "3"
+PASS input.stepDown(); input.value is "1"
+PASS input.min = "0"; stepUp("9", "10", "", 9) is "99"
+PASS stepDown("19", "10", "0") is "9"
+PASS stepUp("89", "10", "99") is "99"
 Huge value and small step
 PASS input.min = ""; stepUp("1e+38", "1", "", 999999) is "1e+38"
 PASS input.max = ""; stepDown("1e+38", "1", "", 999999) is "1e+38"
diff --git a/LayoutTests/fast/forms/script-tests/input-stepup-stepdown.js b/LayoutTests/fast/forms/script-tests/input-stepup-stepdown.js
index 1bbc978..f604365 100644
--- a/LayoutTests/fast/forms/script-tests/input-stepup-stepdown.js
+++ b/LayoutTests/fast/forms/script-tests/input-stepup-stepdown.js
@@ -206,12 +206,11 @@ shouldThrow('stepUp("-1", "1", "0", 2)', invalidStateErr);
 shouldBe('input.value', '"-1"');
 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"');
-shouldBe('input.min = "0"; stepUp("9", "10", "", 9)', '"100"');
-shouldBe('stepDown("19", "10", "0")', '"10"');
-// value + step is <= max, but rounded result would be > max.
-shouldThrow('stepUp("89", "10", "99")', invalidStateErr);
+shouldBe('stepUp("1", "2", "")', '"3"');
+shouldBe('input.stepDown(); input.value', '"1"');
+shouldBe('input.min = "0"; stepUp("9", "10", "", 9)', '"99"');
+shouldBe('stepDown("19", "10", "0")', '"9"');
+shouldBe('stepUp("89", "10", "99")', '"99"');
 debug('Huge value and small step');
 shouldBe('input.min = ""; stepUp("1e+38", "1", "", 999999)', '"1e+38"');
 shouldBe('input.max = ""; stepDown("1e+38", "1", "", 999999)', '"1e+38"');
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8dcdf20..adba9cd 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-11-19  Dai Mikurube  <dmikurube at google.com>
+
+        Reviewed by Kent Tamura.
+
+        stepUp/stepDown for values in step-mismatching state for input elements
+        https://bugs.webkit.org/show_bug.cgi?id=48976
+
+        Fixed stepUp/stepDown behaviors for step-mismatching values to follow the specification of
+        HTML5 4.10.7.3 Common input element APIs. In details, disabled any stepwise adjustment for
+        step-mismatching values.
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::applyStep):
+
 2010-11-19  Pavel Feldman  <pfeldman at chromium.org>
 
         Not reviewed. Rolled out build failures introduced in r72373.
diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp
index 4939f8c..954aab2 100644
--- a/WebCore/html/HTMLInputElement.cpp
+++ b/WebCore/html/HTMLInputElement.cpp
@@ -334,13 +334,13 @@ bool HTMLInputElement::getAllowedValueStepWithDecimalPlaces(double* step, unsign
 void HTMLInputElement::applyStep(double count, ExceptionCode& ec)
 {
     double step;
-    unsigned stepDecimalPlaces;
+    unsigned stepDecimalPlaces, currentDecimalPlaces;
     if (!getAllowedValueStepWithDecimalPlaces(&step, &stepDecimalPlaces)) {
         ec = INVALID_STATE_ERR;
         return;
     }
     const double nan = numeric_limits<double>::quiet_NaN();
-    double current = m_inputType->parseToDouble(value(), nan);
+    double current = m_inputType->parseToDoubleWithDecimalPlaces(value(), nan, &currentDecimalPlaces);
     if (!isfinite(current)) {
         ec = INVALID_STATE_ERR;
         return;
@@ -361,8 +361,13 @@ void HTMLInputElement::applyStep(double count, ExceptionCode& ec)
     double base = m_inputType->stepBaseWithDecimalPlaces(&baseDecimalPlaces);
     baseDecimalPlaces = min(baseDecimalPlaces, 16u);
     if (newValue < pow(10.0, 21.0)) {
-        double scale = pow(10.0, static_cast<double>(max(stepDecimalPlaces, baseDecimalPlaces)));
-        newValue = round((base + round((newValue - base) / step) * step) * scale) / scale;
+      if (stepMismatch(value())) {
+            double scale = pow(10.0, static_cast<double>(max(stepDecimalPlaces, currentDecimalPlaces)));
+            newValue = round(newValue * scale) / scale;
+        } else {
+            double scale = pow(10.0, static_cast<double>(max(stepDecimalPlaces, baseDecimalPlaces)));
+            newValue = round((base + round((newValue - base) / step) * step) * scale) / scale;
+        }
     }
     if (newValue - m_inputType->maximum() > acceptableError) {
         ec = INVALID_STATE_ERR;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list