<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[191940] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/191940">191940</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-11-02 23:21:41 -0800 (Mon, 02 Nov 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>input[type=number] does not increment/decrement integers with trailing decimal characters
https://bugs.webkit.org/show_bug.cgi?id=148867
rdar://problem/22589693

Patch by Keith Rollin &lt;krollin@apple.com&gt; on 2015-11-02
Reviewed by Chris Dumez.

Source/WebCore:

Support input[type=number].value attributes of the form &quot;###.&quot; (that
is, leading digits with a decimal but no trailing digits). This form
was supported in the setting of the attribute, but not when changing
it through stepUp/Down.

Testing turned up similarly incorrect processing of -.###, so
addressed that, too.

Test: fast/forms/range/input-appearance-range-decimals.html

Updated the following tests:
- fast/forms/number/number-stepup-stepdown-from-renderer.html
- fast/forms/number/number-stepup-stepdown.html
- fast/forms/range/range-stepup-stepdown-from-renderer.html
- fast/forms/range/range-stepup-stepdown.html

* html/InputType.cpp:
(WebCore::InputType::stepUpFromRenderer):
* platform/Decimal.cpp:
(WebCore::Decimal::fromString):

LayoutTests:

New tests for input[type=number].skipUp/Down when .value ends in a
decimal point (with no additional trailing digits). Also some coverage
for input[type=range] which shares some same code.

* fast/forms/number/number-stepup-stepdown-expected.txt:
* fast/forms/number/number-stepup-stepdown-from-renderer-expected.txt:
* fast/forms/number/number-stepup-stepdown-from-renderer.html:
* fast/forms/number/number-stepup-stepdown.html:
* fast/forms/range/range-stepup-stepdown-expected.txt:
* fast/forms/range/range-stepup-stepdown-from-renderer-expected.txt:
* fast/forms/range/range-stepup-stepdown-from-renderer.html:
* fast/forms/range/range-stepup-stepdown.html:
* fast/forms/range/input-appearance-range-decimals-expected.html: Added
* fast/forms/range/input-appearance-range-decimals.html: Added</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastformsnumbernumberstepupstepdownexpectedtxt">trunk/LayoutTests/fast/forms/number/number-stepup-stepdown-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastformsnumbernumberstepupstepdownfromrendererexpectedtxt">trunk/LayoutTests/fast/forms/number/number-stepup-stepdown-from-renderer-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastformsnumbernumberstepupstepdownfromrendererhtml">trunk/LayoutTests/fast/forms/number/number-stepup-stepdown-from-renderer.html</a></li>
<li><a href="#trunkLayoutTestsfastformsnumbernumberstepupstepdownhtml">trunk/LayoutTests/fast/forms/number/number-stepup-stepdown.html</a></li>
<li><a href="#trunkLayoutTestsfastformsrangerangestepupstepdownexpectedtxt">trunk/LayoutTests/fast/forms/range/range-stepup-stepdown-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastformsrangerangestepupstepdownfromrendererexpectedtxt">trunk/LayoutTests/fast/forms/range/range-stepup-stepdown-from-renderer-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastformsrangerangestepupstepdownfromrendererhtml">trunk/LayoutTests/fast/forms/range/range-stepup-stepdown-from-renderer.html</a></li>
<li><a href="#trunkLayoutTestsfastformsrangerangestepupstepdownhtml">trunk/LayoutTests/fast/forms/range/range-stepup-stepdown.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlInputTypecpp">trunk/Source/WebCore/html/InputType.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformDecimalcpp">trunk/Source/WebCore/platform/Decimal.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastformsrangeinputappearancerangedecimalsexpectedhtml">trunk/LayoutTests/fast/forms/range/input-appearance-range-decimals-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastformsrangeinputappearancerangedecimalshtml">trunk/LayoutTests/fast/forms/range/input-appearance-range-decimals.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (191939 => 191940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-11-03 06:16:26 UTC (rev 191939)
+++ trunk/LayoutTests/ChangeLog        2015-11-03 07:21:41 UTC (rev 191940)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2015-11-02  Keith Rollin  &lt;krollin@apple.com&gt;
+
+        input[type=number] does not increment/decrement integers with trailing decimal characters
+        https://bugs.webkit.org/show_bug.cgi?id=148867
+        rdar://problem/22589693
+
+        Reviewed by Chris Dumez.
+
+        New tests for input[type=number].skipUp/Down when .value ends in a
+        decimal point (with no additional trailing digits). Also some coverage
+        for input[type=range] which shares some same code.
+
+        * fast/forms/number/number-stepup-stepdown-expected.txt:
+        * fast/forms/number/number-stepup-stepdown-from-renderer-expected.txt:
+        * fast/forms/number/number-stepup-stepdown-from-renderer.html:
+        * fast/forms/number/number-stepup-stepdown.html:
+        * fast/forms/range/range-stepup-stepdown-expected.txt:
+        * fast/forms/range/range-stepup-stepdown-from-renderer-expected.txt:
+        * fast/forms/range/range-stepup-stepdown-from-renderer.html:
+        * fast/forms/range/range-stepup-stepdown.html:
+        * fast/forms/range/input-appearance-range-decimals-expected.html: Added
+        * fast/forms/range/input-appearance-range-decimals.html: Added
+
</ins><span class="cx"> 2015-11-02  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Cocoa] Fix tests
</span></span></pre></div>
<a id="trunkLayoutTestsfastformsnumbernumberstepupstepdownexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/forms/number/number-stepup-stepdown-expected.txt (191939 => 191940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/number/number-stepup-stepdown-expected.txt        2015-11-03 06:16:26 UTC (rev 191939)
+++ trunk/LayoutTests/fast/forms/number/number-stepup-stepdown-expected.txt        2015-11-03 07:21:41 UTC (rev 191940)
</span><span class="lines">@@ -4,9 +4,11 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> Number type
</span><ins>+
</ins><span class="cx"> Invalid value
</span><span class="cx"> PASS stepUp(&quot;&quot;, null, null) threw exception Error: InvalidStateError: DOM Exception 11.
</span><span class="cx"> PASS stepDown(&quot;&quot;, null, null) threw exception Error: InvalidStateError: DOM Exception 11.
</span><ins>+
</ins><span class="cx"> Non-number arguments
</span><span class="cx"> PASS stepUp(&quot;0&quot;, null, null, &quot;0&quot;) is &quot;0&quot;
</span><span class="cx"> PASS stepDown(&quot;0&quot;, null, null, &quot;0&quot;) is &quot;0&quot;
</span><span class="lines">@@ -14,6 +16,7 @@
</span><span class="cx"> PASS stepDown(&quot;0&quot;, null, null, &quot;foo&quot;) is &quot;0&quot;
</span><span class="cx"> PASS stepUp(&quot;0&quot;, null, null, null) is &quot;0&quot;
</span><span class="cx"> PASS stepDown(&quot;0&quot;, null, null, null) is &quot;0&quot;
</span><ins>+
</ins><span class="cx"> Normal cases
</span><span class="cx"> PASS stepUp(&quot;0&quot;, null, null) is &quot;1&quot;
</span><span class="cx"> PASS stepUp(&quot;1&quot;, null, null, 2) is &quot;3&quot;
</span><span class="lines">@@ -21,19 +24,121 @@
</span><span class="cx"> PASS stepDown(&quot;2&quot;, null, null) is &quot;1&quot;
</span><span class="cx"> PASS stepDown(&quot;1&quot;, null, null, 2) is &quot;-1&quot;
</span><span class="cx"> PASS stepDown(&quot;-1&quot;, null, null, -1) is &quot;0&quot;
</span><ins>+
+Fractional cases
+PASS stepUp(&quot;0.1&quot;, 1, null) is &quot;1.1&quot;
+PASS stepUp(&quot;0.2&quot;, 1, null) is &quot;1.2&quot;
+PASS stepUp(&quot;1.0&quot;, 1, null) is &quot;2&quot;
+PASS stepUp(&quot;1.1&quot;, 1, null) is &quot;2.1&quot;
+PASS stepUp(&quot;1.2&quot;, 1, null) is &quot;2.2&quot;
+PASS stepUp(&quot;2.0&quot;, 1, null) is &quot;3&quot;
+
+PASS stepUp(&quot;-0.1&quot;, 1, null) is &quot;0.9&quot;
+PASS stepUp(&quot;-0.2&quot;, 1, null) is &quot;0.8&quot;
+PASS stepUp(&quot;-1.0&quot;, 1, null) is &quot;0&quot;
+PASS stepUp(&quot;-1.1&quot;, 1, null) is &quot;-0.1&quot;
+PASS stepUp(&quot;-1.2&quot;, 1, null) is &quot;-0.2&quot;
+PASS stepUp(&quot;-2.0&quot;, 1, null) is &quot;-1&quot;
+
+PASS stepDown(&quot;0.1&quot;, 1, null) is &quot;-0.9&quot;
+PASS stepDown(&quot;0.2&quot;, 1, null) is &quot;-0.8&quot;
+PASS stepDown(&quot;1.0&quot;, 1, null) is &quot;0&quot;
+PASS stepDown(&quot;1.1&quot;, 1, null) is &quot;0.1&quot;
+PASS stepDown(&quot;1.2&quot;, 1, null) is &quot;0.2&quot;
+PASS stepDown(&quot;2.0&quot;, 1, null) is &quot;1&quot;
+
+PASS stepDown(&quot;-0.1&quot;, 1, null) is &quot;-1.1&quot;
+PASS stepDown(&quot;-0.2&quot;, 1, null) is &quot;-1.2&quot;
+PASS stepDown(&quot;-1.0&quot;, 1, null) is &quot;-2&quot;
+PASS stepDown(&quot;-1.1&quot;, 1, null) is &quot;-2.1&quot;
+PASS stepDown(&quot;-1.2&quot;, 1, null) is &quot;-2.2&quot;
+PASS stepDown(&quot;-2.0&quot;, 1, null) is &quot;-3&quot;
+
+PASS stepUp(&quot;.1&quot;, 1, null) is &quot;1.1&quot;
+PASS stepUp(&quot;.2&quot;, 1, null) is &quot;1.2&quot;
+PASS stepUp(&quot;1.&quot;, 1, null) is &quot;2&quot;
+PASS stepUp(&quot;2.&quot;, 1, null) is &quot;3&quot;
+
+PASS stepUp(&quot;-.1&quot;, 1, null) is &quot;0.9&quot;
+PASS stepUp(&quot;-.2&quot;, 1, null) is &quot;0.8&quot;
+PASS stepUp(&quot;-1.&quot;, 1, null) is &quot;0&quot;
+PASS stepUp(&quot;-2.&quot;, 1, null) is &quot;-1&quot;
+
+PASS stepDown(&quot;.1&quot;, 1, null) is &quot;-0.9&quot;
+PASS stepDown(&quot;.2&quot;, 1, null) is &quot;-0.8&quot;
+PASS stepDown(&quot;1.&quot;, 1, null) is &quot;0&quot;
+PASS stepDown(&quot;2.&quot;, 1, null) is &quot;1&quot;
+
+PASS stepDown(&quot;-.1&quot;, 1, null) is &quot;-1.1&quot;
+PASS stepDown(&quot;-.2&quot;, 1, null) is &quot;-1.2&quot;
+PASS stepDown(&quot;-1.&quot;, 1, null) is &quot;-2&quot;
+PASS stepDown(&quot;-2.&quot;, 1, null) is &quot;-3&quot;
+
+PASS stepUp(&quot;0.1&quot;, .1, null) is &quot;0.2&quot;
+PASS stepUp(&quot;0.2&quot;, .1, null) is &quot;0.3&quot;
+PASS stepUp(&quot;1.0&quot;, .1, null) is &quot;1.1&quot;
+PASS stepUp(&quot;1.1&quot;, .1, null) is &quot;1.2&quot;
+PASS stepUp(&quot;1.2&quot;, .1, null) is &quot;1.3&quot;
+PASS stepUp(&quot;2.0&quot;, .1, null) is &quot;2.1&quot;
+
+PASS stepUp(&quot;-0.1&quot;, .1, null) is &quot;0&quot;
+PASS stepUp(&quot;-0.2&quot;, .1, null) is &quot;-0.1&quot;
+PASS stepUp(&quot;-1.0&quot;, .1, null) is &quot;-0.9&quot;
+PASS stepUp(&quot;-1.1&quot;, .1, null) is &quot;-1&quot;
+PASS stepUp(&quot;-1.2&quot;, .1, null) is &quot;-1.1&quot;
+PASS stepUp(&quot;-2.0&quot;, .1, null) is &quot;-1.9&quot;
+
+PASS stepDown(&quot;0.1&quot;, .1, null) is &quot;0&quot;
+PASS stepDown(&quot;0.2&quot;, .1, null) is &quot;0.1&quot;
+PASS stepDown(&quot;1.0&quot;, .1, null) is &quot;0.9&quot;
+PASS stepDown(&quot;1.1&quot;, .1, null) is &quot;1&quot;
+PASS stepDown(&quot;1.2&quot;, .1, null) is &quot;1.1&quot;
+PASS stepDown(&quot;2.0&quot;, .1, null) is &quot;1.9&quot;
+
+PASS stepDown(&quot;-0.1&quot;, .1, null) is &quot;-0.2&quot;
+PASS stepDown(&quot;-0.2&quot;, .1, null) is &quot;-0.3&quot;
+PASS stepDown(&quot;-1.0&quot;, .1, null) is &quot;-1.1&quot;
+PASS stepDown(&quot;-1.1&quot;, .1, null) is &quot;-1.2&quot;
+PASS stepDown(&quot;-1.2&quot;, .1, null) is &quot;-1.3&quot;
+PASS stepDown(&quot;-2.0&quot;, .1, null) is &quot;-2.1&quot;
+
+PASS stepUp(&quot;.1&quot;, .1, null) is &quot;0.2&quot;
+PASS stepUp(&quot;.2&quot;, .1, null) is &quot;0.3&quot;
+PASS stepUp(&quot;1.&quot;, .1, null) is &quot;1.1&quot;
+PASS stepUp(&quot;2.&quot;, .1, null) is &quot;2.1&quot;
+
+PASS stepUp(&quot;-.1&quot;, .1, null) is &quot;0&quot;
+PASS stepUp(&quot;-.2&quot;, .1, null) is &quot;-0.1&quot;
+PASS stepUp(&quot;-1.&quot;, .1, null) is &quot;-0.9&quot;
+PASS stepUp(&quot;-2.&quot;, .1, null) is &quot;-1.9&quot;
+
+PASS stepDown(&quot;.1&quot;, .1, null) is &quot;0&quot;
+PASS stepDown(&quot;.2&quot;, .1, null) is &quot;0.1&quot;
+PASS stepDown(&quot;1.&quot;, .1, null) is &quot;0.9&quot;
+PASS stepDown(&quot;2.&quot;, .1, null) is &quot;1.9&quot;
+
+PASS stepDown(&quot;-.1&quot;, .1, null) is &quot;-0.2&quot;
+PASS stepDown(&quot;-.2&quot;, .1, null) is &quot;-0.3&quot;
+PASS stepDown(&quot;-1.&quot;, .1, null) is &quot;-1.1&quot;
+PASS stepDown(&quot;-2.&quot;, .1, null) is &quot;-2.1&quot;
+
</ins><span class="cx"> Extra arguments
</span><span class="cx"> PASS input.value = &quot;0&quot;; input.min = null; input.step = null; input.stepUp(1, 2); input.value is &quot;1&quot;
</span><span class="cx"> PASS input.value = &quot;1&quot;; input.stepDown(1, 3); input.value is &quot;0&quot;
</span><ins>+
</ins><span class="cx"> Invalid step value
</span><span class="cx"> PASS stepUp(&quot;0&quot;, &quot;foo&quot;, null) is &quot;1&quot;
</span><span class="cx"> PASS stepUp(&quot;1&quot;, &quot;0&quot;, null) is &quot;2&quot;
</span><span class="cx"> PASS stepUp(&quot;2&quot;, &quot;-1&quot;, null) is &quot;3&quot;
</span><ins>+
</ins><span class="cx"> Step=any
</span><span class="cx"> PASS stepUp(&quot;0&quot;, &quot;any&quot;, null) threw exception Error: InvalidStateError: DOM Exception 11.
</span><span class="cx"> PASS stepDown(&quot;0&quot;, &quot;any&quot;, null) threw exception Error: InvalidStateError: DOM Exception 11.
</span><ins>+
</ins><span class="cx"> Step=any corner case
</span><span class="cx"> PASS stepUpExplicitBounds(&quot;0&quot;, &quot;100&quot;, &quot;any&quot;, &quot;1.5&quot;, &quot;1&quot;) threw exception Error: InvalidStateError: DOM Exception 11.
</span><span class="cx"> PASS stepDownExplicitBounds(&quot;0&quot;, &quot;100&quot;, &quot;any&quot;, &quot;1.5&quot;, &quot;1&quot;) threw exception Error: InvalidStateError: DOM Exception 11.
</span><ins>+
</ins><span class="cx"> Overflow/underflow
</span><span class="cx"> PASS stepDown(&quot;1&quot;, &quot;1&quot;, &quot;0&quot;) is &quot;0&quot;
</span><span class="cx"> PASS stepDown(&quot;0&quot;, &quot;1&quot;, &quot;0&quot;) threw exception Error: InvalidStateError: DOM Exception 11.
</span><span class="lines">@@ -45,21 +150,25 @@
</span><span class="cx"> PASS stepUp(&quot;-1&quot;, &quot;1&quot;, &quot;0&quot;, 2) threw exception Error: InvalidStateError: DOM Exception 11.
</span><span class="cx"> PASS input.value is &quot;-1&quot;
</span><span class="cx"> PASS stepUp(&quot;1&quot;, &quot;3.40282346e+38&quot;, &quot;&quot;, 2) threw exception Error: InvalidStateError: DOM Exception 11.
</span><ins>+
</ins><span class="cx"> stepDown()/stepUp() for stepMismatch values
</span><span class="cx"> PASS stepUp(&quot;1&quot;, &quot;2&quot;, &quot;&quot;) is &quot;3&quot;
</span><span class="cx"> PASS input.stepDown(); input.value is &quot;1&quot;
</span><span class="cx"> PASS input.min = &quot;0&quot;; stepUp(&quot;9&quot;, &quot;10&quot;, &quot;&quot;, 9) is &quot;99&quot;
</span><span class="cx"> PASS stepDown(&quot;19&quot;, &quot;10&quot;, &quot;0&quot;) is &quot;9&quot;
</span><span class="cx"> PASS stepUp(&quot;89&quot;, &quot;10&quot;, &quot;99&quot;) is &quot;99&quot;
</span><ins>+
</ins><span class="cx"> Huge value and small step
</span><span class="cx"> PASS input.min = &quot;&quot;; stepUp(&quot;1e+38&quot;, &quot;1&quot;, &quot;&quot;, 999999) is &quot;1e+38&quot;
</span><span class="cx"> PASS input.max = &quot;&quot;; stepDown(&quot;1e+38&quot;, &quot;1&quot;, &quot;&quot;, 999999) is &quot;1e+38&quot;
</span><ins>+
</ins><span class="cx"> Fractional numbers
</span><span class="cx"> PASS input.min = &quot;&quot;; stepUp(&quot;0&quot;, &quot;0.33333333333333333&quot;, &quot;&quot;, 3) is &quot;1&quot;
</span><span class="cx"> PASS stepUp(&quot;1&quot;, &quot;0.1&quot;, &quot;&quot;, 10) is &quot;2&quot;
</span><span class="cx"> PASS input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.value is &quot;3&quot;
</span><span class="cx"> PASS input.min = &quot;0&quot;; stepUp(&quot;0&quot;, &quot;0.003921568627450980&quot;, &quot;1&quot;, 255) is &quot;1&quot;
</span><span class="cx"> PASS for (var i = 0; i &lt; 255; i++) { input.stepDown(); }; input.value is &quot;0&quot;
</span><ins>+
</ins><span class="cx"> Rounding
</span><span class="cx"> PASS stepUp(&quot;5.005&quot;, &quot;0.005&quot;, &quot;&quot;, 2) is &quot;5.015&quot;
</span><span class="cx"> PASS stepUp(&quot;5.005&quot;, &quot;0.005&quot;, &quot;&quot;, 11) is &quot;5.06&quot;
</span><span class="lines">@@ -67,6 +176,7 @@
</span><span class="cx"> PASS stepUpExplicitBounds(&quot;4&quot;, &quot;9&quot;, &quot;0.005&quot;, &quot;5.005&quot;, 2) is &quot;5.015&quot;
</span><span class="cx"> PASS stepUpExplicitBounds(&quot;4&quot;, &quot;9&quot;, &quot;0.005&quot;, &quot;5.005&quot;, 11) is &quot;5.06&quot;
</span><span class="cx"> PASS stepUpExplicitBounds(&quot;4&quot;, &quot;9&quot;, &quot;0.005&quot;, &quot;5.005&quot;, 12) is &quot;5.065&quot;
</span><ins>+
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastformsnumbernumberstepupstepdownfromrendererexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/forms/number/number-stepup-stepdown-from-renderer-expected.txt (191939 => 191940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/number/number-stepup-stepdown-from-renderer-expected.txt        2015-11-03 06:16:26 UTC (rev 191939)
+++ trunk/LayoutTests/fast/forms/number/number-stepup-stepdown-from-renderer-expected.txt        2015-11-03 07:21:41 UTC (rev 191940)
</span><span class="lines">@@ -5,6 +5,7 @@
</span><span class="cx"> 
</span><span class="cx"> Number type
</span><span class="cx"> Function arguments are (value, step, {min or max}, [stepCount]).
</span><ins>+
</ins><span class="cx"> Invalid value
</span><span class="cx"> PASS stepUp(&quot;&quot;, null, null) is &quot;1&quot;
</span><span class="cx"> PASS stepDown(&quot;&quot;, null, null) is &quot;-1&quot;
</span><span class="lines">@@ -18,6 +19,7 @@
</span><span class="cx"> PASS stepDown(&quot;foo&quot;, &quot;any&quot;, null) is &quot;-1&quot;
</span><span class="cx"> PASS stepUp(&quot;foo&quot;, &quot;foo&quot;, null) is &quot;1&quot;
</span><span class="cx"> PASS stepDown(&quot;foo&quot;, &quot;foo&quot;, null) is &quot;-1&quot;
</span><ins>+
</ins><span class="cx"> Normal cases
</span><span class="cx"> PASS stepUp(&quot;0&quot;, null, null) is &quot;1&quot;
</span><span class="cx"> PASS stepUp(&quot;1&quot;, null, null, 2) is &quot;3&quot;
</span><span class="lines">@@ -25,16 +27,116 @@
</span><span class="cx"> PASS stepDown(&quot;2&quot;, null, null) is &quot;1&quot;
</span><span class="cx"> PASS stepDown(&quot;1&quot;, null, null, 2) is &quot;-1&quot;
</span><span class="cx"> PASS stepDown(&quot;-1&quot;, null, null, -1) is &quot;0&quot;
</span><ins>+
+Fractional cases
+PASS stepUp(&quot;0.1&quot;, 1, null) is &quot;1&quot;
+PASS stepUp(&quot;0.2&quot;, 1, null) is &quot;1&quot;
+PASS stepUp(&quot;1.0&quot;, 1, null) is &quot;2&quot;
+PASS stepUp(&quot;1.1&quot;, 1, null) is &quot;2&quot;
+PASS stepUp(&quot;1.2&quot;, 1, null) is &quot;2&quot;
+PASS stepUp(&quot;2.0&quot;, 1, null) is &quot;3&quot;
+
+PASS stepUp(&quot;-0.1&quot;, 1, null) is &quot;0&quot;
+PASS stepUp(&quot;-0.2&quot;, 1, null) is &quot;0&quot;
+PASS stepUp(&quot;-1.0&quot;, 1, null) is &quot;0&quot;
+PASS stepUp(&quot;-1.1&quot;, 1, null) is &quot;-1&quot;
+PASS stepUp(&quot;-1.2&quot;, 1, null) is &quot;-1&quot;
+PASS stepUp(&quot;-2.0&quot;, 1, null) is &quot;-1&quot;
+
+PASS stepDown(&quot;0.1&quot;, 1, null) is &quot;0&quot;
+PASS stepDown(&quot;0.2&quot;, 1, null) is &quot;0&quot;
+PASS stepDown(&quot;1.0&quot;, 1, null) is &quot;0&quot;
+PASS stepDown(&quot;1.1&quot;, 1, null) is &quot;1&quot;
+PASS stepDown(&quot;1.2&quot;, 1, null) is &quot;1&quot;
+PASS stepDown(&quot;2.0&quot;, 1, null) is &quot;1&quot;
+
+PASS stepDown(&quot;-0.1&quot;, 1, null) is &quot;-1&quot;
+PASS stepDown(&quot;-0.2&quot;, 1, null) is &quot;-1&quot;
+PASS stepDown(&quot;-1.0&quot;, 1, null) is &quot;-2&quot;
+PASS stepDown(&quot;-1.1&quot;, 1, null) is &quot;-2&quot;
+PASS stepDown(&quot;-1.2&quot;, 1, null) is &quot;-2&quot;
+PASS stepDown(&quot;-2.0&quot;, 1, null) is &quot;-3&quot;
+
+PASS stepUp(&quot;.1&quot;, 1, null) is &quot;1&quot;
+PASS stepUp(&quot;.2&quot;, 1, null) is &quot;1&quot;
+PASS stepUp(&quot;1.&quot;, 1, null) is &quot;2&quot;
+PASS stepUp(&quot;2.&quot;, 1, null) is &quot;3&quot;
+
+PASS stepUp(&quot;-.1&quot;, 1, null) is &quot;0&quot;
+PASS stepUp(&quot;-.2&quot;, 1, null) is &quot;0&quot;
+PASS stepUp(&quot;-1.&quot;, 1, null) is &quot;0&quot;
+PASS stepUp(&quot;-2.&quot;, 1, null) is &quot;-1&quot;
+
+PASS stepDown(&quot;.1&quot;, 1, null) is &quot;0&quot;
+PASS stepDown(&quot;.2&quot;, 1, null) is &quot;0&quot;
+PASS stepDown(&quot;1.&quot;, 1, null) is &quot;0&quot;
+PASS stepDown(&quot;2.&quot;, 1, null) is &quot;1&quot;
+
+PASS stepDown(&quot;-.1&quot;, 1, null) is &quot;-1&quot;
+PASS stepDown(&quot;-.2&quot;, 1, null) is &quot;-1&quot;
+PASS stepDown(&quot;-1.&quot;, 1, null) is &quot;-2&quot;
+PASS stepDown(&quot;-2.&quot;, 1, null) is &quot;-3&quot;
+
+PASS stepUp(&quot;0.1&quot;, .1, null) is &quot;0.2&quot;
+PASS stepUp(&quot;0.2&quot;, .1, null) is &quot;0.3&quot;
+PASS stepUp(&quot;1.0&quot;, .1, null) is &quot;1.1&quot;
+PASS stepUp(&quot;1.1&quot;, .1, null) is &quot;1.2&quot;
+PASS stepUp(&quot;1.2&quot;, .1, null) is &quot;1.3&quot;
+PASS stepUp(&quot;2.0&quot;, .1, null) is &quot;2.1&quot;
+
+PASS stepUp(&quot;-0.1&quot;, .1, null) is &quot;0&quot;
+PASS stepUp(&quot;-0.2&quot;, .1, null) is &quot;-0.1&quot;
+PASS stepUp(&quot;-1.0&quot;, .1, null) is &quot;-0.9&quot;
+PASS stepUp(&quot;-1.1&quot;, .1, null) is &quot;-1&quot;
+PASS stepUp(&quot;-1.2&quot;, .1, null) is &quot;-1.1&quot;
+PASS stepUp(&quot;-2.0&quot;, .1, null) is &quot;-1.9&quot;
+
+PASS stepDown(&quot;0.1&quot;, .1, null) is &quot;0&quot;
+PASS stepDown(&quot;0.2&quot;, .1, null) is &quot;0.1&quot;
+PASS stepDown(&quot;1.0&quot;, .1, null) is &quot;0.9&quot;
+PASS stepDown(&quot;1.1&quot;, .1, null) is &quot;1&quot;
+PASS stepDown(&quot;1.2&quot;, .1, null) is &quot;1.1&quot;
+PASS stepDown(&quot;2.0&quot;, .1, null) is &quot;1.9&quot;
+
+PASS stepDown(&quot;-0.1&quot;, .1, null) is &quot;-0.2&quot;
+PASS stepDown(&quot;-0.2&quot;, .1, null) is &quot;-0.3&quot;
+PASS stepDown(&quot;-1.0&quot;, .1, null) is &quot;-1.1&quot;
+PASS stepDown(&quot;-1.1&quot;, .1, null) is &quot;-1.2&quot;
+PASS stepDown(&quot;-1.2&quot;, .1, null) is &quot;-1.3&quot;
+PASS stepDown(&quot;-2.0&quot;, .1, null) is &quot;-2.1&quot;
+
+PASS stepUp(&quot;.1&quot;, .1, null) is &quot;0.2&quot;
+PASS stepUp(&quot;.2&quot;, .1, null) is &quot;0.3&quot;
+PASS stepUp(&quot;1.&quot;, .1, null) is &quot;1.1&quot;
+PASS stepUp(&quot;2.&quot;, .1, null) is &quot;2.1&quot;
+
+PASS stepUp(&quot;-.1&quot;, .1, null) is &quot;0&quot;
+PASS stepUp(&quot;-.2&quot;, .1, null) is &quot;-0.1&quot;
+PASS stepUp(&quot;-1.&quot;, .1, null) is &quot;-0.9&quot;
+PASS stepUp(&quot;-2.&quot;, .1, null) is &quot;-1.9&quot;
+PASS stepDown(&quot;.1&quot;, .1, null) is &quot;0&quot;
+PASS stepDown(&quot;.2&quot;, .1, null) is &quot;0.1&quot;
+PASS stepDown(&quot;1.&quot;, .1, null) is &quot;0.9&quot;
+PASS stepDown(&quot;2.&quot;, .1, null) is &quot;1.9&quot;
+
+PASS stepDown(&quot;-.1&quot;, .1, null) is &quot;-0.2&quot;
+PASS stepDown(&quot;-.2&quot;, .1, null) is &quot;-0.3&quot;
+PASS stepDown(&quot;-1.&quot;, .1, null) is &quot;-1.1&quot;
+PASS stepDown(&quot;-2.&quot;, .1, null) is &quot;-2.1&quot;
+
</ins><span class="cx"> Invalid step value
</span><span class="cx"> PASS stepUp(&quot;0&quot;, &quot;foo&quot;, null) is &quot;1&quot;
</span><span class="cx"> PASS stepUp(&quot;1&quot;, &quot;0&quot;, null) is &quot;2&quot;
</span><span class="cx"> PASS stepUp(&quot;2&quot;, &quot;-1&quot;, null) is &quot;3&quot;
</span><ins>+
</ins><span class="cx"> Step=any
</span><span class="cx"> PASS stepUp(&quot;0&quot;, &quot;any&quot;, null) is &quot;1&quot;
</span><span class="cx"> PASS stepDown(&quot;0&quot;, &quot;any&quot;, null) is &quot;-1&quot;
</span><ins>+
</ins><span class="cx"> Step=any corner case
</span><span class="cx"> PASS stepUpExplicitBounds(&quot;0&quot;, &quot;100&quot;, &quot;any&quot;, &quot;1.5&quot;, &quot;1&quot;) is &quot;2.5&quot;
</span><span class="cx"> PASS stepDownExplicitBounds(&quot;0&quot;, &quot;100&quot;, &quot;any&quot;, &quot;1.5&quot;, &quot;1&quot;) is &quot;0.5&quot;
</span><ins>+
</ins><span class="cx"> Overflow/underflow
</span><span class="cx"> PASS stepDown(&quot;1&quot;, &quot;1&quot;, &quot;0&quot;) is &quot;0&quot;
</span><span class="cx"> PASS stepDown(&quot;0&quot;, &quot;1&quot;, &quot;0&quot;) is &quot;0&quot;
</span><span class="lines">@@ -44,6 +146,7 @@
</span><span class="cx"> PASS stepUp(&quot;0&quot;, &quot;1&quot;, &quot;0&quot;) is &quot;0&quot;
</span><span class="cx"> PASS stepUp(&quot;-1&quot;, &quot;1&quot;, &quot;0&quot;, 2) is &quot;0&quot;
</span><span class="cx"> PASS stepUp(&quot;1&quot;, &quot;3.40282346e+38&quot;, &quot;&quot;, 2) is &quot;3.40282346e+38&quot;
</span><ins>+
</ins><span class="cx"> stepDown()/stepUp() for stepMismatch values
</span><span class="cx"> PASS stepUp(&quot;1&quot;, &quot;2&quot;, &quot;&quot;) is &quot;2&quot;
</span><span class="cx"> PASS input.min = &quot;0&quot;; stepUp(&quot;9&quot;, &quot;10&quot;, &quot;&quot;) is &quot;10&quot;
</span><span class="lines">@@ -53,13 +156,16 @@
</span><span class="cx"> PASS stepUp(&quot;-7&quot;, &quot;300&quot;, &quot;&quot;) is &quot;0&quot;
</span><span class="cx"> PASS stepDown(&quot;7&quot;, &quot;300&quot;, &quot;&quot;) is &quot;0&quot;
</span><span class="cx"> PASS stepDown(&quot;-7&quot;, &quot;300&quot;, &quot;&quot;) is &quot;-300&quot;
</span><ins>+
</ins><span class="cx"> Huge value and small step
</span><span class="cx"> PASS input.min = &quot;&quot;; stepUp(&quot;1e+38&quot;, &quot;1&quot;, &quot;&quot;, 999) is &quot;1e+38&quot;
</span><span class="cx"> PASS input.max = &quot;&quot;; stepDown(&quot;1e+38&quot;, &quot;1&quot;, &quot;&quot;, 999) is &quot;1e+38&quot;
</span><ins>+
</ins><span class="cx"> Fractional numbers
</span><span class="cx"> PASS input.min = &quot;&quot;; stepUp(&quot;0&quot;, &quot;0.33333333333333333&quot;, &quot;&quot;, 3) is &quot;1&quot;
</span><span class="cx"> PASS stepUp(&quot;1&quot;, &quot;0.1&quot;, &quot;&quot;, 10) is &quot;2&quot;
</span><span class="cx"> PASS input.min = &quot;0&quot;; stepUp(&quot;0&quot;, &quot;0.003921568627450980&quot;, &quot;1&quot;, 255) is &quot;1&quot;
</span><ins>+
</ins><span class="cx"> Rounding
</span><span class="cx"> PASS stepUp(&quot;5.005&quot;, &quot;0.005&quot;, &quot;&quot;, 2) is &quot;5.015&quot;
</span><span class="cx"> PASS stepUp(&quot;5.005&quot;, &quot;0.005&quot;, &quot;&quot;, 11) is &quot;5.06&quot;
</span></span></pre></div>
<a id="trunkLayoutTestsfastformsnumbernumberstepupstepdownfromrendererhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/forms/number/number-stepup-stepdown-from-renderer.html (191939 => 191940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/number/number-stepup-stepdown-from-renderer.html        2015-11-03 06:16:26 UTC (rev 191939)
+++ trunk/LayoutTests/fast/forms/number/number-stepup-stepdown-from-renderer.html        2015-11-03 07:21:41 UTC (rev 191940)
</span><span class="lines">@@ -87,6 +87,8 @@
</span><span class="cx"> debug('Number type');
</span><span class="cx"> input.type = 'number';
</span><span class="cx"> debug('Function arguments are (value, step, {min or max}, [stepCount]).');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Invalid value');
</span><span class="cx"> shouldBe('stepUp(&quot;&quot;, null, null)', '&quot;1&quot;');
</span><span class="cx"> shouldBe('stepDown(&quot;&quot;, null, null)', '&quot;-1&quot;');
</span><span class="lines">@@ -100,6 +102,8 @@
</span><span class="cx"> shouldBe('stepDown(&quot;foo&quot;, &quot;any&quot;, null)', '&quot;-1&quot;');
</span><span class="cx"> shouldBe('stepUp(&quot;foo&quot;, &quot;foo&quot;, null)', '&quot;1&quot;');
</span><span class="cx"> shouldBe('stepDown(&quot;foo&quot;, &quot;foo&quot;, null)', '&quot;-1&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Normal cases');
</span><span class="cx"> shouldBe('stepUp(&quot;0&quot;, null, null)', '&quot;1&quot;');
</span><span class="cx"> shouldBe('stepUp(&quot;1&quot;, null, null, 2)', '&quot;3&quot;');
</span><span class="lines">@@ -107,16 +111,160 @@
</span><span class="cx"> shouldBe('stepDown(&quot;2&quot;, null, null)', '&quot;1&quot;');
</span><span class="cx"> shouldBe('stepDown(&quot;1&quot;, null, null, 2)', '&quot;-1&quot;');
</span><span class="cx"> shouldBe('stepDown(&quot;-1&quot;, null, null, -1)', '&quot;0&quot;');
</span><ins>+
+debug('');
+debug('Fractional cases')
+
+// Note: these tests also appear in number-stepup-stepdown.html. However, the
+// results here differ from the results there. According to:
+//
+//      https://html.spec.whatwg.org/multipage/forms.html#number-state-(type=number)
+//
+// The browser is allowed to clamp resulting values to the nearest multiple of
+// the [step] value:
+//
+//      When the element is suffering from a step mismatch, the user agent may
+//      round the element's value to the nearest number for which the element
+//      would not suffer from a step mismatch. If there are two such numbers,
+//      user agents are encouraged to pick the one nearest positive infinity.
+//
+// WebKit seesm to perform this clamping when stepping from the UI, but not
+// from the API.
+//
+// See also the function comment for InputType::stepUpFromRenderer.
+
+// Base/model/template tests
+shouldBe('stepUp(&quot;0.1&quot;, 1, null)', '&quot;1&quot;')       // Is 1.1 in non-render test
+shouldBe('stepUp(&quot;0.2&quot;, 1, null)', '&quot;1&quot;');      // Is 1.1 in non-render test
+shouldBe('stepUp(&quot;1.0&quot;, 1, null)', '&quot;2&quot;');
+shouldBe('stepUp(&quot;1.1&quot;, 1, null)', '&quot;2&quot;');      // Is 2.1 in non-render test
+shouldBe('stepUp(&quot;1.2&quot;, 1, null)', '&quot;2&quot;');      // Is 2.2 in non-render test
+shouldBe('stepUp(&quot;2.0&quot;, 1, null)', '&quot;3&quot;');
+
+debug('');
+// Same as above, but with negative numbers.
+shouldBe('stepUp(&quot;-0.1&quot;, 1, null)', '&quot;0&quot;');     // Is 0.9 in non-render test
+shouldBe('stepUp(&quot;-0.2&quot;, 1, null)', '&quot;0&quot;');     // Is 0.8 in non-render test
+shouldBe('stepUp(&quot;-1.0&quot;, 1, null)', '&quot;0&quot;');
+shouldBe('stepUp(&quot;-1.1&quot;, 1, null)', '&quot;-1&quot;');    // Is -0.1 in non-render test
+shouldBe('stepUp(&quot;-1.2&quot;, 1, null)', '&quot;-1&quot;');    // Is -0.2 in non-render test
+shouldBe('stepUp(&quot;-2.0&quot;, 1, null)', '&quot;-1&quot;');
+
+debug('');
+// Same as above, but stepping down rather than up.
+shouldBe('stepDown(&quot;0.1&quot;, 1, null)', '&quot;0&quot;');    // Is -0.9 in non-render test
+shouldBe('stepDown(&quot;0.2&quot;, 1, null)', '&quot;0&quot;');    // Is -0.8 in non-render test
+shouldBe('stepDown(&quot;1.0&quot;, 1, null)', '&quot;0&quot;');
+shouldBe('stepDown(&quot;1.1&quot;, 1, null)', '&quot;1&quot;');    // Is 0.1 in non-render test
+shouldBe('stepDown(&quot;1.2&quot;, 1, null)', '&quot;1&quot;');    // Is 0.2 in non-render test
+shouldBe('stepDown(&quot;2.0&quot;, 1, null)', '&quot;1&quot;');
+
+debug('');
+shouldBe('stepDown(&quot;-0.1&quot;, 1, null)', '&quot;-1&quot;');  // Is -1.1 in non-render test
+shouldBe('stepDown(&quot;-0.2&quot;, 1, null)', '&quot;-1&quot;');  // Is -1.2 in non-render test
+shouldBe('stepDown(&quot;-1.0&quot;, 1, null)', '&quot;-2&quot;');
+shouldBe('stepDown(&quot;-1.1&quot;, 1, null)', '&quot;-2&quot;');  // Is -2.1 in non-render test
+shouldBe('stepDown(&quot;-1.2&quot;, 1, null)', '&quot;-2&quot;');  // Is -2.2 in non-render test
+shouldBe('stepDown(&quot;-2.0&quot;, 1, null)', '&quot;-3&quot;');
+
+// Same as above, but with leading/trailing zeros removed.
+debug('');
+shouldBe('stepUp(&quot;.1&quot;, 1, null)', '&quot;1&quot;');       // Is 1.1 in non-render test
+shouldBe('stepUp(&quot;.2&quot;, 1, null)', '&quot;1&quot;');       // Is 1.2 in non-render test
+shouldBe('stepUp(&quot;1.&quot;, 1, null)', '&quot;2&quot;');
+shouldBe('stepUp(&quot;2.&quot;, 1, null)', '&quot;3&quot;');
+
+debug('');
+shouldBe('stepUp(&quot;-.1&quot;, 1, null)', '&quot;0&quot;');      // Is 0.9 in non-render test
+shouldBe('stepUp(&quot;-.2&quot;, 1, null)', '&quot;0&quot;');      // Is 0.8 in non-render test
+shouldBe('stepUp(&quot;-1.&quot;, 1, null)', '&quot;0&quot;');
+shouldBe('stepUp(&quot;-2.&quot;, 1, null)', '&quot;-1&quot;');
+
+debug('');
+shouldBe('stepDown(&quot;.1&quot;, 1, null)', '&quot;0&quot;');     // Is -0.9 in non-render test
+shouldBe('stepDown(&quot;.2&quot;, 1, null)', '&quot;0&quot;');     // Is -0.8 in non-render test
+shouldBe('stepDown(&quot;1.&quot;, 1, null)', '&quot;0&quot;');
+shouldBe('stepDown(&quot;2.&quot;, 1, null)', '&quot;1&quot;');
+
+debug('');
+shouldBe('stepDown(&quot;-.1&quot;, 1, null)', '&quot;-1&quot;');   // Is -1.1 in non-render test
+shouldBe('stepDown(&quot;-.2&quot;, 1, null)', '&quot;-1&quot;');   // Is -1.2 in non-render test
+shouldBe('stepDown(&quot;-1.&quot;, 1, null)', '&quot;-2&quot;');
+shouldBe('stepDown(&quot;-2.&quot;, 1, null)', '&quot;-3&quot;');
+
+// Same as above, but stepping by .1 rather than 1.
+debug('');
+shouldBe('stepUp(&quot;0.1&quot;, .1, null)', '&quot;0.2&quot;');
+shouldBe('stepUp(&quot;0.2&quot;, .1, null)', '&quot;0.3&quot;');
+shouldBe('stepUp(&quot;1.0&quot;, .1, null)', '&quot;1.1&quot;');
+shouldBe('stepUp(&quot;1.1&quot;, .1, null)', '&quot;1.2&quot;');
+shouldBe('stepUp(&quot;1.2&quot;, .1, null)', '&quot;1.3&quot;');
+shouldBe('stepUp(&quot;2.0&quot;, .1, null)', '&quot;2.1&quot;');
+
+debug('');
+shouldBe('stepUp(&quot;-0.1&quot;, .1, null)', '&quot;0&quot;');
+shouldBe('stepUp(&quot;-0.2&quot;, .1, null)', '&quot;-0.1&quot;');
+shouldBe('stepUp(&quot;-1.0&quot;, .1, null)', '&quot;-0.9&quot;');
+shouldBe('stepUp(&quot;-1.1&quot;, .1, null)', '&quot;-1&quot;');
+shouldBe('stepUp(&quot;-1.2&quot;, .1, null)', '&quot;-1.1&quot;');
+shouldBe('stepUp(&quot;-2.0&quot;, .1, null)', '&quot;-1.9&quot;');
+
+debug('');
+shouldBe('stepDown(&quot;0.1&quot;, .1, null)', '&quot;0&quot;');
+shouldBe('stepDown(&quot;0.2&quot;, .1, null)', '&quot;0.1&quot;');
+shouldBe('stepDown(&quot;1.0&quot;, .1, null)', '&quot;0.9&quot;');
+shouldBe('stepDown(&quot;1.1&quot;, .1, null)', '&quot;1&quot;');
+shouldBe('stepDown(&quot;1.2&quot;, .1, null)', '&quot;1.1&quot;');
+shouldBe('stepDown(&quot;2.0&quot;, .1, null)', '&quot;1.9&quot;');
+
+debug('');
+shouldBe('stepDown(&quot;-0.1&quot;, .1, null)', '&quot;-0.2&quot;');
+shouldBe('stepDown(&quot;-0.2&quot;, .1, null)', '&quot;-0.3&quot;');
+shouldBe('stepDown(&quot;-1.0&quot;, .1, null)', '&quot;-1.1&quot;');
+shouldBe('stepDown(&quot;-1.1&quot;, .1, null)', '&quot;-1.2&quot;');
+shouldBe('stepDown(&quot;-1.2&quot;, .1, null)', '&quot;-1.3&quot;');
+shouldBe('stepDown(&quot;-2.0&quot;, .1, null)', '&quot;-2.1&quot;');
+
+debug('');
+shouldBe('stepUp(&quot;.1&quot;, .1, null)', '&quot;0.2&quot;');
+shouldBe('stepUp(&quot;.2&quot;, .1, null)', '&quot;0.3&quot;');
+shouldBe('stepUp(&quot;1.&quot;, .1, null)', '&quot;1.1&quot;');
+shouldBe('stepUp(&quot;2.&quot;, .1, null)', '&quot;2.1&quot;');
+
+debug('');
+shouldBe('stepUp(&quot;-.1&quot;, .1, null)', '&quot;0&quot;');
+shouldBe('stepUp(&quot;-.2&quot;, .1, null)', '&quot;-0.1&quot;');
+shouldBe('stepUp(&quot;-1.&quot;, .1, null)', '&quot;-0.9&quot;');
+shouldBe('stepUp(&quot;-2.&quot;, .1, null)', '&quot;-1.9&quot;');
+
+shouldBe('stepDown(&quot;.1&quot;, .1, null)', '&quot;0&quot;');
+shouldBe('stepDown(&quot;.2&quot;, .1, null)', '&quot;0.1&quot;');
+shouldBe('stepDown(&quot;1.&quot;, .1, null)', '&quot;0.9&quot;');
+shouldBe('stepDown(&quot;2.&quot;, .1, null)', '&quot;1.9&quot;');
+
+debug('');
+shouldBe('stepDown(&quot;-.1&quot;, .1, null)', '&quot;-0.2&quot;');
+shouldBe('stepDown(&quot;-.2&quot;, .1, null)', '&quot;-0.3&quot;');
+shouldBe('stepDown(&quot;-1.&quot;, .1, null)', '&quot;-1.1&quot;');
+shouldBe('stepDown(&quot;-2.&quot;, .1, null)', '&quot;-2.1&quot;');
+
+debug('');
</ins><span class="cx"> debug('Invalid step value');
</span><span class="cx"> shouldBe('stepUp(&quot;0&quot;, &quot;foo&quot;, null)', '&quot;1&quot;');
</span><span class="cx"> shouldBe('stepUp(&quot;1&quot;, &quot;0&quot;, null)', '&quot;2&quot;');
</span><span class="cx"> shouldBe('stepUp(&quot;2&quot;, &quot;-1&quot;, null)', '&quot;3&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Step=any');
</span><span class="cx"> shouldBe('stepUp(&quot;0&quot;, &quot;any&quot;, null)', '&quot;1&quot;');
</span><span class="cx"> shouldBe('stepDown(&quot;0&quot;, &quot;any&quot;, null)', '&quot;-1&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Step=any corner case');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(&quot;0&quot;, &quot;100&quot;, &quot;any&quot;, &quot;1.5&quot;, &quot;1&quot;)', '&quot;2.5&quot;');
</span><span class="cx"> shouldBe('stepDownExplicitBounds(&quot;0&quot;, &quot;100&quot;, &quot;any&quot;, &quot;1.5&quot;, &quot;1&quot;)', '&quot;0.5&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Overflow/underflow');
</span><span class="cx"> shouldBe('stepDown(&quot;1&quot;, &quot;1&quot;, &quot;0&quot;)', '&quot;0&quot;');
</span><span class="cx"> shouldBe('stepDown(&quot;0&quot;, &quot;1&quot;, &quot;0&quot;)', '&quot;0&quot;');
</span><span class="lines">@@ -126,6 +274,8 @@
</span><span class="cx"> shouldBe('stepUp(&quot;0&quot;, &quot;1&quot;, &quot;0&quot;)', '&quot;0&quot;');
</span><span class="cx"> shouldBe('stepUp(&quot;-1&quot;, &quot;1&quot;, &quot;0&quot;, 2)', '&quot;0&quot;');
</span><span class="cx"> shouldBe('stepUp(&quot;1&quot;, &quot;3.40282346e+38&quot;, &quot;&quot;, 2)', '&quot;3.40282346e+38&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('stepDown()/stepUp() for stepMismatch values');
</span><span class="cx"> shouldBe('stepUp(&quot;1&quot;, &quot;2&quot;, &quot;&quot;)', '&quot;2&quot;');
</span><span class="cx"> shouldBe('input.min = &quot;0&quot;; stepUp(&quot;9&quot;, &quot;10&quot;, &quot;&quot;)', '&quot;10&quot;');
</span><span class="lines">@@ -135,13 +285,19 @@
</span><span class="cx"> shouldBe('stepUp(&quot;-7&quot;, &quot;300&quot;, &quot;&quot;)', '&quot;0&quot;');
</span><span class="cx"> shouldBe('stepDown(&quot;7&quot;, &quot;300&quot;, &quot;&quot;)', '&quot;0&quot;');
</span><span class="cx"> shouldBe('stepDown(&quot;-7&quot;, &quot;300&quot;, &quot;&quot;)', '&quot;-300&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Huge value and small step');
</span><span class="cx"> shouldBe('input.min = &quot;&quot;; stepUp(&quot;1e+38&quot;, &quot;1&quot;, &quot;&quot;, 999)', '&quot;1e+38&quot;');
</span><span class="cx"> shouldBe('input.max = &quot;&quot;; stepDown(&quot;1e+38&quot;, &quot;1&quot;, &quot;&quot;, 999)', '&quot;1e+38&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Fractional numbers');
</span><span class="cx"> shouldBe('input.min = &quot;&quot;; stepUp(&quot;0&quot;, &quot;0.33333333333333333&quot;, &quot;&quot;, 3)', '&quot;1&quot;');
</span><span class="cx"> shouldBe('stepUp(&quot;1&quot;, &quot;0.1&quot;, &quot;&quot;, 10)', '&quot;2&quot;');
</span><span class="cx"> shouldBe('input.min = &quot;0&quot;; stepUp(&quot;0&quot;, &quot;0.003921568627450980&quot;, &quot;1&quot;, 255)', '&quot;1&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Rounding');
</span><span class="cx"> shouldBe('stepUp(&quot;5.005&quot;, &quot;0.005&quot;, &quot;&quot;, 2)', '&quot;5.015&quot;');
</span><span class="cx"> shouldBe('stepUp(&quot;5.005&quot;, &quot;0.005&quot;, &quot;&quot;, 11)', '&quot;5.06&quot;');
</span></span></pre></div>
<a id="trunkLayoutTestsfastformsnumbernumberstepupstepdownhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/forms/number/number-stepup-stepdown.html (191939 => 191940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/number/number-stepup-stepdown.html        2015-11-03 06:16:26 UTC (rev 191939)
+++ trunk/LayoutTests/fast/forms/number/number-stepup-stepdown.html        2015-11-03 07:21:41 UTC (rev 191940)
</span><span class="lines">@@ -55,9 +55,13 @@
</span><span class="cx"> 
</span><span class="cx"> debug('Number type');
</span><span class="cx"> input.type = 'number';
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Invalid value');
</span><span class="cx"> shouldThrow('stepUp(&quot;&quot;, null, null)', invalidStateErr);
</span><span class="cx"> shouldThrow('stepDown(&quot;&quot;, null, null)', invalidStateErr);
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Non-number arguments');
</span><span class="cx"> shouldBe('stepUp(&quot;0&quot;, null, null, &quot;0&quot;)', '&quot;0&quot;');
</span><span class="cx"> shouldBe('stepDown(&quot;0&quot;, null, null, &quot;0&quot;)', '&quot;0&quot;');
</span><span class="lines">@@ -65,6 +69,8 @@
</span><span class="cx"> shouldBe('stepDown(&quot;0&quot;, null, null, &quot;foo&quot;)', '&quot;0&quot;');
</span><span class="cx"> shouldBe('stepUp(&quot;0&quot;, null, null, null)', '&quot;0&quot;');
</span><span class="cx"> shouldBe('stepDown(&quot;0&quot;, null, null, null)', '&quot;0&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Normal cases');
</span><span class="cx"> shouldBe('stepUp(&quot;0&quot;, null, null)', '&quot;1&quot;');
</span><span class="cx"> shouldBe('stepUp(&quot;1&quot;, null, null, 2)', '&quot;3&quot;');
</span><span class="lines">@@ -72,19 +78,147 @@
</span><span class="cx"> shouldBe('stepDown(&quot;2&quot;, null, null)', '&quot;1&quot;');
</span><span class="cx"> shouldBe('stepDown(&quot;1&quot;, null, null, 2)', '&quot;-1&quot;');
</span><span class="cx"> shouldBe('stepDown(&quot;-1&quot;, null, null, -1)', '&quot;0&quot;');
</span><ins>+
+debug('');
+debug('Fractional cases')
+// Base/model/template tests
+shouldBe('stepUp(&quot;0.1&quot;, 1, null)', '&quot;1.1&quot;');
+shouldBe('stepUp(&quot;0.2&quot;, 1, null)', '&quot;1.2&quot;');
+shouldBe('stepUp(&quot;1.0&quot;, 1, null)', '&quot;2&quot;');
+shouldBe('stepUp(&quot;1.1&quot;, 1, null)', '&quot;2.1&quot;');
+shouldBe('stepUp(&quot;1.2&quot;, 1, null)', '&quot;2.2&quot;');
+shouldBe('stepUp(&quot;2.0&quot;, 1, null)', '&quot;3&quot;');
+
+// Same as above, but with negative numbers.
+debug('');
+shouldBe('stepUp(&quot;-0.1&quot;, 1, null)', '&quot;0.9&quot;');
+shouldBe('stepUp(&quot;-0.2&quot;, 1, null)', '&quot;0.8&quot;');
+shouldBe('stepUp(&quot;-1.0&quot;, 1, null)', '&quot;0&quot;');
+shouldBe('stepUp(&quot;-1.1&quot;, 1, null)', '&quot;-0.1&quot;');
+shouldBe('stepUp(&quot;-1.2&quot;, 1, null)', '&quot;-0.2&quot;');
+shouldBe('stepUp(&quot;-2.0&quot;, 1, null)', '&quot;-1&quot;');
+
+// Same as above, but stepping down rather than up.
+debug('');
+shouldBe('stepDown(&quot;0.1&quot;, 1, null)', '&quot;-0.9&quot;');
+shouldBe('stepDown(&quot;0.2&quot;, 1, null)', '&quot;-0.8&quot;');
+shouldBe('stepDown(&quot;1.0&quot;, 1, null)', '&quot;0&quot;');
+shouldBe('stepDown(&quot;1.1&quot;, 1, null)', '&quot;0.1&quot;');
+shouldBe('stepDown(&quot;1.2&quot;, 1, null)', '&quot;0.2&quot;');
+shouldBe('stepDown(&quot;2.0&quot;, 1, null)', '&quot;1&quot;');
+
+debug('');
+shouldBe('stepDown(&quot;-0.1&quot;, 1, null)', '&quot;-1.1&quot;');
+shouldBe('stepDown(&quot;-0.2&quot;, 1, null)', '&quot;-1.2&quot;');
+shouldBe('stepDown(&quot;-1.0&quot;, 1, null)', '&quot;-2&quot;');
+shouldBe('stepDown(&quot;-1.1&quot;, 1, null)', '&quot;-2.1&quot;');
+shouldBe('stepDown(&quot;-1.2&quot;, 1, null)', '&quot;-2.2&quot;');
+shouldBe('stepDown(&quot;-2.0&quot;, 1, null)', '&quot;-3&quot;');
+
+// Same as above, but with leading/trailing zeros removed.
+debug('');
+shouldBe('stepUp(&quot;.1&quot;, 1, null)', '&quot;1.1&quot;');
+shouldBe('stepUp(&quot;.2&quot;, 1, null)', '&quot;1.2&quot;');
+shouldBe('stepUp(&quot;1.&quot;, 1, null)', '&quot;2&quot;');
+shouldBe('stepUp(&quot;2.&quot;, 1, null)', '&quot;3&quot;');
+
+debug('');
+shouldBe('stepUp(&quot;-.1&quot;, 1, null)', '&quot;0.9&quot;');
+shouldBe('stepUp(&quot;-.2&quot;, 1, null)', '&quot;0.8&quot;');
+shouldBe('stepUp(&quot;-1.&quot;, 1, null)', '&quot;0&quot;');
+shouldBe('stepUp(&quot;-2.&quot;, 1, null)', '&quot;-1&quot;');
+
+debug('');
+shouldBe('stepDown(&quot;.1&quot;, 1, null)', '&quot;-0.9&quot;');
+shouldBe('stepDown(&quot;.2&quot;, 1, null)', '&quot;-0.8&quot;');
+shouldBe('stepDown(&quot;1.&quot;, 1, null)', '&quot;0&quot;');
+shouldBe('stepDown(&quot;2.&quot;, 1, null)', '&quot;1&quot;');
+
+debug('');
+shouldBe('stepDown(&quot;-.1&quot;, 1, null)', '&quot;-1.1&quot;');
+shouldBe('stepDown(&quot;-.2&quot;, 1, null)', '&quot;-1.2&quot;');
+shouldBe('stepDown(&quot;-1.&quot;, 1, null)', '&quot;-2&quot;');
+shouldBe('stepDown(&quot;-2.&quot;, 1, null)', '&quot;-3&quot;');
+
+// Same as above, but stepping by .1 rather than 1.
+debug('');
+shouldBe('stepUp(&quot;0.1&quot;, .1, null)', '&quot;0.2&quot;');
+shouldBe('stepUp(&quot;0.2&quot;, .1, null)', '&quot;0.3&quot;');
+shouldBe('stepUp(&quot;1.0&quot;, .1, null)', '&quot;1.1&quot;');
+shouldBe('stepUp(&quot;1.1&quot;, .1, null)', '&quot;1.2&quot;');
+shouldBe('stepUp(&quot;1.2&quot;, .1, null)', '&quot;1.3&quot;');
+shouldBe('stepUp(&quot;2.0&quot;, .1, null)', '&quot;2.1&quot;');
+
+debug('');
+shouldBe('stepUp(&quot;-0.1&quot;, .1, null)', '&quot;0&quot;');
+shouldBe('stepUp(&quot;-0.2&quot;, .1, null)', '&quot;-0.1&quot;');
+shouldBe('stepUp(&quot;-1.0&quot;, .1, null)', '&quot;-0.9&quot;');
+shouldBe('stepUp(&quot;-1.1&quot;, .1, null)', '&quot;-1&quot;');
+shouldBe('stepUp(&quot;-1.2&quot;, .1, null)', '&quot;-1.1&quot;');
+shouldBe('stepUp(&quot;-2.0&quot;, .1, null)', '&quot;-1.9&quot;');
+
+debug('');
+shouldBe('stepDown(&quot;0.1&quot;, .1, null)', '&quot;0&quot;');
+shouldBe('stepDown(&quot;0.2&quot;, .1, null)', '&quot;0.1&quot;');
+shouldBe('stepDown(&quot;1.0&quot;, .1, null)', '&quot;0.9&quot;');
+shouldBe('stepDown(&quot;1.1&quot;, .1, null)', '&quot;1&quot;');
+shouldBe('stepDown(&quot;1.2&quot;, .1, null)', '&quot;1.1&quot;');
+shouldBe('stepDown(&quot;2.0&quot;, .1, null)', '&quot;1.9&quot;');
+
+debug('');
+shouldBe('stepDown(&quot;-0.1&quot;, .1, null)', '&quot;-0.2&quot;');
+shouldBe('stepDown(&quot;-0.2&quot;, .1, null)', '&quot;-0.3&quot;');
+shouldBe('stepDown(&quot;-1.0&quot;, .1, null)', '&quot;-1.1&quot;');
+shouldBe('stepDown(&quot;-1.1&quot;, .1, null)', '&quot;-1.2&quot;');
+shouldBe('stepDown(&quot;-1.2&quot;, .1, null)', '&quot;-1.3&quot;');
+shouldBe('stepDown(&quot;-2.0&quot;, .1, null)', '&quot;-2.1&quot;');
+
+debug('');
+shouldBe('stepUp(&quot;.1&quot;, .1, null)', '&quot;0.2&quot;');
+shouldBe('stepUp(&quot;.2&quot;, .1, null)', '&quot;0.3&quot;');
+shouldBe('stepUp(&quot;1.&quot;, .1, null)', '&quot;1.1&quot;');
+shouldBe('stepUp(&quot;2.&quot;, .1, null)', '&quot;2.1&quot;');
+
+debug('');
+shouldBe('stepUp(&quot;-.1&quot;, .1, null)', '&quot;0&quot;');
+shouldBe('stepUp(&quot;-.2&quot;, .1, null)', '&quot;-0.1&quot;');
+shouldBe('stepUp(&quot;-1.&quot;, .1, null)', '&quot;-0.9&quot;');
+shouldBe('stepUp(&quot;-2.&quot;, .1, null)', '&quot;-1.9&quot;');
+
+debug('');
+shouldBe('stepDown(&quot;.1&quot;, .1, null)', '&quot;0&quot;');
+shouldBe('stepDown(&quot;.2&quot;, .1, null)', '&quot;0.1&quot;');
+shouldBe('stepDown(&quot;1.&quot;, .1, null)', '&quot;0.9&quot;');
+shouldBe('stepDown(&quot;2.&quot;, .1, null)', '&quot;1.9&quot;');
+
+debug('');
+shouldBe('stepDown(&quot;-.1&quot;, .1, null)', '&quot;-0.2&quot;');
+shouldBe('stepDown(&quot;-.2&quot;, .1, null)', '&quot;-0.3&quot;');
+shouldBe('stepDown(&quot;-1.&quot;, .1, null)', '&quot;-1.1&quot;');
+shouldBe('stepDown(&quot;-2.&quot;, .1, null)', '&quot;-2.1&quot;');
+
+debug('');
</ins><span class="cx"> debug('Extra arguments');
</span><span class="cx"> shouldBe('input.value = &quot;0&quot;; input.min = null; input.step = null; input.stepUp(1, 2); input.value', '&quot;1&quot;');
</span><span class="cx"> shouldBe('input.value = &quot;1&quot;; input.stepDown(1, 3); input.value', '&quot;0&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Invalid step value');
</span><span class="cx"> shouldBe('stepUp(&quot;0&quot;, &quot;foo&quot;, null)', '&quot;1&quot;');
</span><span class="cx"> shouldBe('stepUp(&quot;1&quot;, &quot;0&quot;, null)', '&quot;2&quot;');
</span><span class="cx"> shouldBe('stepUp(&quot;2&quot;, &quot;-1&quot;, null)', '&quot;3&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Step=any');
</span><span class="cx"> shouldThrow('stepUp(&quot;0&quot;, &quot;any&quot;, null)', invalidStateErr);
</span><span class="cx"> shouldThrow('stepDown(&quot;0&quot;, &quot;any&quot;, null)', invalidStateErr);
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Step=any corner case');
</span><span class="cx"> shouldThrow('stepUpExplicitBounds(&quot;0&quot;, &quot;100&quot;, &quot;any&quot;, &quot;1.5&quot;, &quot;1&quot;)', invalidStateErr);
</span><span class="cx"> shouldThrow('stepDownExplicitBounds(&quot;0&quot;, &quot;100&quot;, &quot;any&quot;, &quot;1.5&quot;, &quot;1&quot;)', invalidStateErr);
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Overflow/underflow');
</span><span class="cx"> shouldBe('stepDown(&quot;1&quot;, &quot;1&quot;, &quot;0&quot;)', '&quot;0&quot;');
</span><span class="cx"> shouldThrow('stepDown(&quot;0&quot;, &quot;1&quot;, &quot;0&quot;)', invalidStateErr);
</span><span class="lines">@@ -96,21 +230,29 @@
</span><span class="cx"> shouldThrow('stepUp(&quot;-1&quot;, &quot;1&quot;, &quot;0&quot;, 2)', invalidStateErr);
</span><span class="cx"> shouldBe('input.value', '&quot;-1&quot;');
</span><span class="cx"> shouldThrow('stepUp(&quot;1&quot;, &quot;3.40282346e+38&quot;, &quot;&quot;, 2)', invalidStateErr);
</span><ins>+
+debug('');
</ins><span class="cx"> debug('stepDown()/stepUp() for stepMismatch values');
</span><span class="cx"> shouldBe('stepUp(&quot;1&quot;, &quot;2&quot;, &quot;&quot;)', '&quot;3&quot;');
</span><span class="cx"> shouldBe('input.stepDown(); input.value', '&quot;1&quot;');
</span><span class="cx"> shouldBe('input.min = &quot;0&quot;; stepUp(&quot;9&quot;, &quot;10&quot;, &quot;&quot;, 9)', '&quot;99&quot;');
</span><span class="cx"> shouldBe('stepDown(&quot;19&quot;, &quot;10&quot;, &quot;0&quot;)', '&quot;9&quot;');
</span><span class="cx"> shouldBe('stepUp(&quot;89&quot;, &quot;10&quot;, &quot;99&quot;)', '&quot;99&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Huge value and small step');
</span><span class="cx"> shouldBe('input.min = &quot;&quot;; stepUp(&quot;1e+38&quot;, &quot;1&quot;, &quot;&quot;, 999999)', '&quot;1e+38&quot;');
</span><span class="cx"> shouldBe('input.max = &quot;&quot;; stepDown(&quot;1e+38&quot;, &quot;1&quot;, &quot;&quot;, 999999)', '&quot;1e+38&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Fractional numbers');
</span><span class="cx"> shouldBe('input.min = &quot;&quot;; stepUp(&quot;0&quot;, &quot;0.33333333333333333&quot;, &quot;&quot;, 3)', '&quot;1&quot;');
</span><span class="cx"> shouldBe('stepUp(&quot;1&quot;, &quot;0.1&quot;, &quot;&quot;, 10)', '&quot;2&quot;');
</span><span class="cx"> shouldBe('input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.value', '&quot;3&quot;');
</span><span class="cx"> shouldBe('input.min = &quot;0&quot;; stepUp(&quot;0&quot;, &quot;0.003921568627450980&quot;, &quot;1&quot;, 255)', '&quot;1&quot;');
</span><span class="cx"> shouldBe('for (var i = 0; i &lt; 255; i++) { input.stepDown(); }; input.value', '&quot;0&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Rounding');
</span><span class="cx"> shouldBe('stepUp(&quot;5.005&quot;, &quot;0.005&quot;, &quot;&quot;, 2)', '&quot;5.015&quot;');
</span><span class="cx"> shouldBe('stepUp(&quot;5.005&quot;, &quot;0.005&quot;, &quot;&quot;, 11)', '&quot;5.06&quot;');
</span><span class="lines">@@ -118,6 +260,8 @@
</span><span class="cx"> shouldBe('stepUpExplicitBounds(&quot;4&quot;, &quot;9&quot;, &quot;0.005&quot;, &quot;5.005&quot;, 2)', '&quot;5.015&quot;');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(&quot;4&quot;, &quot;9&quot;, &quot;0.005&quot;, &quot;5.005&quot;, 11)', '&quot;5.06&quot;');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(&quot;4&quot;, &quot;9&quot;, &quot;0.005&quot;, &quot;5.005&quot;, 12)', '&quot;5.065&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;/body&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastformsrangeinputappearancerangedecimalsexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/forms/range/input-appearance-range-decimals-expected.html (0 => 191940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/range/input-appearance-range-decimals-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/forms/range/input-appearance-range-decimals-expected.html        2015-11-03 07:21:41 UTC (rev 191940)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;body&gt;
+&lt;input type=range value=&quot;0.4&quot; min=&quot;-0.4&quot; max=&quot;1.0&quot;&gt;
+&lt;body&gt;
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastformsrangeinputappearancerangedecimalshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/forms/range/input-appearance-range-decimals.html (0 => 191940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/range/input-appearance-range-decimals.html                                (rev 0)
+++ trunk/LayoutTests/fast/forms/range/input-appearance-range-decimals.html        2015-11-03 07:21:41 UTC (rev 191940)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;body&gt;
+&lt;!-- These numbers should parse the same as 0.4, -0.4, and 1.0 --&gt;
+&lt;input type=range value=&quot;.4&quot; min=&quot;-.4&quot; max=&quot;1.&quot;&gt;
+&lt;body&gt;
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastformsrangerangestepupstepdownexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/forms/range/range-stepup-stepdown-expected.txt (191939 => 191940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/range/range-stepup-stepdown-expected.txt        2015-11-03 06:16:26 UTC (rev 191939)
+++ trunk/LayoutTests/fast/forms/range/range-stepup-stepdown-expected.txt        2015-11-03 07:21:41 UTC (rev 191940)
</span><span class="lines">@@ -7,6 +7,7 @@
</span><span class="cx"> Using the default values
</span><span class="cx"> PASS stepUpExplicitBounds(null, null, null, &quot;&quot;) is &quot;51&quot;
</span><span class="cx"> PASS stepDownExplicitBounds(null, null, null, &quot;&quot;) is &quot;49&quot;
</span><ins>+
</ins><span class="cx"> Non-number arguments (stepCount)
</span><span class="cx"> PASS stepUpExplicitBounds(null, null, null, &quot;0&quot;, &quot;0&quot;) is &quot;0&quot;
</span><span class="cx"> PASS stepDownExplicitBounds(null, null, null, &quot;0&quot;, &quot;0&quot;) is &quot;0&quot;
</span><span class="lines">@@ -14,6 +15,7 @@
</span><span class="cx"> PASS stepDownExplicitBounds(null, null, null, &quot;0&quot;, &quot;foo&quot;) is &quot;0&quot;
</span><span class="cx"> PASS stepUpExplicitBounds(null, null, null, &quot;0&quot;, null) is &quot;0&quot;
</span><span class="cx"> PASS stepDownExplicitBounds(null, null, null, &quot;0&quot;, null) is &quot;0&quot;
</span><ins>+
</ins><span class="cx"> Normal cases
</span><span class="cx"> PASS stepUpExplicitBounds(null, null, null, &quot;0&quot;) is &quot;1&quot;
</span><span class="cx"> PASS stepUpExplicitBounds(null, null, null, &quot;1&quot;, 2) is &quot;3&quot;
</span><span class="lines">@@ -21,9 +23,108 @@
</span><span class="cx"> PASS stepDownExplicitBounds(&quot;-100&quot;, null, null, &quot;2&quot;) is &quot;1&quot;
</span><span class="cx"> PASS stepDownExplicitBounds(&quot;-100&quot;, null, null, &quot;1&quot;, 2) is &quot;-1&quot;
</span><span class="cx"> PASS stepDownExplicitBounds(&quot;-100&quot;, null, null, &quot;-1&quot;, -1) is &quot;0&quot;
</span><ins>+
+Fractional cases
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;0.1&quot;) is &quot;1&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;0.2&quot;) is &quot;1&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;1.0&quot;) is &quot;2&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;1.1&quot;) is &quot;2&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;1.2&quot;) is &quot;2&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;2.0&quot;) is &quot;3&quot;
+
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;-0.1&quot;) is &quot;1&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;-0.2&quot;) is &quot;1&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;-1.0&quot;) is &quot;0&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;-1.1&quot;) is &quot;0&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;-1.2&quot;) is &quot;0&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;-2.0&quot;) is &quot;-1&quot;
+
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;0.1&quot;) is &quot;-1&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;0.2&quot;) is &quot;-1&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;1.0&quot;) is &quot;0&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;1.1&quot;) is &quot;0&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;1.2&quot;) is &quot;0&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;2.0&quot;) is &quot;1&quot;
+
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;-0.1&quot;) is &quot;-1&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;-0.2&quot;) is &quot;-1&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;-1.0&quot;) is &quot;-2&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;-1.1&quot;) is &quot;-2&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;-1.2&quot;) is &quot;-2&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;-2.0&quot;) is &quot;-3&quot;
+
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;.1&quot;) is &quot;1&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;.2&quot;) is &quot;1&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;1.&quot;) is &quot;2&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;2.&quot;) is &quot;3&quot;
+
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;-.1&quot;) is &quot;1&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;-.2&quot;) is &quot;1&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;-1.&quot;) is &quot;0&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;-2.&quot;) is &quot;-1&quot;
+
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;.1&quot;) is &quot;-1&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;.2&quot;) is &quot;-1&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;1.&quot;) is &quot;0&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;2.&quot;) is &quot;1&quot;
+
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;-.1&quot;) is &quot;-1&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;-.2&quot;) is &quot;-1&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;-1.&quot;) is &quot;-2&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;-2.&quot;) is &quot;-3&quot;
+
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;0.1&quot;) is &quot;0.2&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;0.2&quot;) is &quot;0.3&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;1.0&quot;) is &quot;1.1&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;1.1&quot;) is &quot;1.2&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;1.2&quot;) is &quot;1.3&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;2.0&quot;) is &quot;2.1&quot;
+
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;-0.1&quot;) is &quot;0&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;-0.2&quot;) is &quot;-0.1&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;-1.0&quot;) is &quot;-0.9&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;-1.1&quot;) is &quot;-1&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;-1.2&quot;) is &quot;-1.1&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;-2.0&quot;) is &quot;-1.9&quot;
+
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;0.1&quot;) is &quot;0&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;0.2&quot;) is &quot;0.1&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;1.0&quot;) is &quot;0.9&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;1.1&quot;) is &quot;1&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;1.2&quot;) is &quot;1.1&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;2.0&quot;) is &quot;1.9&quot;
+
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;-0.1&quot;) is &quot;-0.2&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;-0.2&quot;) is &quot;-0.3&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;-1.0&quot;) is &quot;-1.1&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;-1.1&quot;) is &quot;-1.2&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;-1.2&quot;) is &quot;-1.3&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;-2.0&quot;) is &quot;-2.1&quot;
+
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;.1&quot;) is &quot;0.2&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;.2&quot;) is &quot;0.3&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;1.&quot;) is &quot;1.1&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;2.&quot;) is &quot;2.1&quot;
+
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;-.1&quot;) is &quot;0&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;-.2&quot;) is &quot;-0.1&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;-1.&quot;) is &quot;-0.9&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;-2.&quot;) is &quot;-1.9&quot;
+
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;.1&quot;) is &quot;0&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;.2&quot;) is &quot;0.1&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;1.&quot;) is &quot;0.9&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;2.&quot;) is &quot;1.9&quot;
+
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;-.1&quot;) is &quot;-0.2&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;-.2&quot;) is &quot;-0.3&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;-1.&quot;) is &quot;-1.1&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;-2.&quot;) is &quot;-2.1&quot;
+
</ins><span class="cx"> Extra arguments
</span><span class="cx"> PASS setInputAttributes(null, null, null, &quot;0&quot;); input.stepUp(1,2); input.value is &quot;1&quot;
</span><span class="cx"> PASS setInputAttributes(null, null, null, &quot;1&quot;); input.stepDown(1,3); input.value is &quot;0&quot;
</span><ins>+
</ins><span class="cx"> Invalid step value
</span><span class="cx"> PASS stepUpExplicitBounds(null, null, &quot;foo&quot;, &quot;0&quot;) is &quot;1&quot;
</span><span class="cx"> PASS stepUpExplicitBounds(null, null, &quot;0&quot;, &quot;1&quot;) is &quot;2&quot;
</span><span class="lines">@@ -31,9 +132,11 @@
</span><span class="cx"> PASS stepDownExplicitBounds(null, null, &quot;foo&quot;, &quot;1&quot;) is &quot;0&quot;
</span><span class="cx"> PASS stepDownExplicitBounds(null, null, &quot;0&quot;, &quot;2&quot;) is &quot;1&quot;
</span><span class="cx"> PASS stepDownExplicitBounds(null, null, &quot;-1&quot;, &quot;3&quot;) is &quot;2&quot;
</span><ins>+
</ins><span class="cx"> Step=any
</span><span class="cx"> PASS stepUpExplicitBounds(null, null, &quot;any&quot;, &quot;1&quot;) threw exception Error: InvalidStateError: DOM Exception 11.
</span><span class="cx"> PASS stepDownExplicitBounds(null, null, &quot;any&quot;, &quot;1&quot;) threw exception Error: InvalidStateError: DOM Exception 11.
</span><ins>+
</ins><span class="cx"> Overflow/underflow
</span><span class="cx"> PASS stepUpExplicitBounds(null, &quot;100&quot;, &quot;1&quot;, &quot;99&quot;) is &quot;100&quot;
</span><span class="cx"> PASS stepUpExplicitBounds(null, &quot;100&quot;, &quot;1&quot;, &quot;100&quot;) threw exception Error: InvalidStateError: DOM Exception 11.
</span><span class="lines">@@ -51,16 +154,20 @@
</span><span class="cx"> PASS stepUpExplicitBounds(-100, 0, 1, -1, 2) threw exception Error: InvalidStateError: DOM Exception 11.
</span><span class="cx"> PASS input.value is &quot;-1&quot;
</span><span class="cx"> PASS stepUpExplicitBounds(null, null, &quot;3.40282346e+38&quot;, &quot;1&quot;, &quot;2&quot;) threw exception Error: InvalidStateError: DOM Exception 11.
</span><ins>+
</ins><span class="cx"> stepDown()/stepUp() for stepMismatch values
</span><span class="cx"> PASS stepUpExplicitBounds(null, null, 2, 1) is &quot;4&quot;
</span><span class="cx"> PASS input.stepDown(); input.value is &quot;2&quot;
</span><span class="cx"> PASS stepUpExplicitBounds(0, null, 10, 9, 9) is &quot;100&quot;
</span><span class="cx"> PASS stepDownExplicitBounds(0, null, 10, 19) is &quot;10&quot;
</span><ins>+
</ins><span class="cx"> value + step is &lt;= max, but rounded result would be &gt; max.
</span><span class="cx"> PASS stepUpExplicitBounds(null, 99, 10, 89) threw exception Error: InvalidStateError: DOM Exception 11.
</span><ins>+
</ins><span class="cx"> Huge value and small step
</span><span class="cx"> PASS stepUpExplicitBounds(0, 1e38, 1, 1e38, 999999) is &quot;1e+38&quot;
</span><span class="cx"> PASS stepDownExplicitBounds(0, 1e38, 1, 1e38, 999999) is &quot;1e+38&quot;
</span><ins>+
</ins><span class="cx"> Fractional numbers
</span><span class="cx"> PASS stepUpExplicitBounds(null, null, 0.33333333333333333, 0, 3) is &quot;1&quot;
</span><span class="cx"> PASS stepUpExplicitBounds(null, null, 0.1, 1) is &quot;1.1&quot;
</span><span class="lines">@@ -71,6 +178,7 @@
</span><span class="cx"> PASS for (var i = 0; i &lt; 255; i++) { input.stepDown(); }; input.value is &quot;0&quot;
</span><span class="cx"> PASS stepDownExplicitBounds(null, null, 0.1, 1, 8) is &quot;0.2&quot;
</span><span class="cx"> PASS stepDownExplicitBounds(null, null, 0.1, 1) is &quot;0.9&quot;
</span><ins>+
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastformsrangerangestepupstepdownfromrendererexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/forms/range/range-stepup-stepdown-from-renderer-expected.txt (191939 => 191940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/range/range-stepup-stepdown-from-renderer-expected.txt        2015-11-03 06:16:26 UTC (rev 191939)
+++ trunk/LayoutTests/fast/forms/range/range-stepup-stepdown-from-renderer-expected.txt        2015-11-03 07:21:41 UTC (rev 191940)
</span><span class="lines">@@ -17,6 +17,7 @@
</span><span class="cx"> PASS stepDownExplicitBounds(null, null, &quot;any&quot;, &quot;foo&quot;) is &quot;49&quot;
</span><span class="cx"> PASS stepUpExplicitBounds(null, null, &quot;foo&quot;, &quot;foo&quot;) is &quot;51&quot;
</span><span class="cx"> PASS stepDownExplicitBounds(null, null, &quot;foo&quot;, &quot;foo&quot;) is &quot;49&quot;
</span><ins>+
</ins><span class="cx"> Normal cases
</span><span class="cx"> PASS stepUpExplicitBounds(null, null, null, &quot;0&quot;) is &quot;1&quot;
</span><span class="cx"> PASS stepUpExplicitBounds(null, null, null, &quot;1&quot;, 2) is &quot;3&quot;
</span><span class="lines">@@ -24,6 +25,103 @@
</span><span class="cx"> PASS stepDownExplicitBounds(&quot;-100&quot;, null, null, &quot;2&quot;) is &quot;1&quot;
</span><span class="cx"> PASS stepDownExplicitBounds(&quot;-100&quot;, null, null, &quot;1&quot;, 2) is &quot;-1&quot;
</span><span class="cx"> PASS stepDownExplicitBounds(&quot;-100&quot;, null, null, &quot;-1&quot;, -1) is &quot;0&quot;
</span><ins>+
+Fractional cases
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;0.1&quot;) is &quot;1&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;0.2&quot;) is &quot;1&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;1.0&quot;) is &quot;2&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;1.1&quot;) is &quot;2&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;1.2&quot;) is &quot;2&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;2.0&quot;) is &quot;3&quot;
+
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;-0.1&quot;) is &quot;1&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;-0.2&quot;) is &quot;1&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;-1.0&quot;) is &quot;0&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;-1.1&quot;) is &quot;0&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;-1.2&quot;) is &quot;0&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;-2.0&quot;) is &quot;-1&quot;
+
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;0.1&quot;) is &quot;-1&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;0.2&quot;) is &quot;-1&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;1.0&quot;) is &quot;0&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;1.1&quot;) is &quot;0&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;1.2&quot;) is &quot;0&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;2.0&quot;) is &quot;1&quot;
+
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;-0.1&quot;) is &quot;-1&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;-0.2&quot;) is &quot;-1&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;-1.0&quot;) is &quot;-2&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;-1.1&quot;) is &quot;-2&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;-1.2&quot;) is &quot;-2&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;-2.0&quot;) is &quot;-3&quot;
+
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;.1&quot;) is &quot;1&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;.2&quot;) is &quot;1&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;1.&quot;) is &quot;2&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;2.&quot;) is &quot;3&quot;
+
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;-.1&quot;) is &quot;1&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;-.2&quot;) is &quot;1&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;-1.&quot;) is &quot;0&quot;
+PASS stepUpExplicitBounds(-10, 10, 1, &quot;-2.&quot;) is &quot;-1&quot;
+
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;.1&quot;) is &quot;-1&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;.2&quot;) is &quot;-1&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;1.&quot;) is &quot;0&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;2.&quot;) is &quot;1&quot;
+
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;-.1&quot;) is &quot;-1&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;-.2&quot;) is &quot;-1&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;-1.&quot;) is &quot;-2&quot;
+PASS stepDownExplicitBounds(-10, 10, 1, &quot;-2.&quot;) is &quot;-3&quot;
+
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;0.1&quot;) is &quot;0.2&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;0.2&quot;) is &quot;0.3&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;1.0&quot;) is &quot;1.1&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;1.1&quot;) is &quot;1.2&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;1.2&quot;) is &quot;1.3&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;2.0&quot;) is &quot;2.1&quot;
+
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;-0.1&quot;) is &quot;0&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;-0.2&quot;) is &quot;-0.1&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;-1.0&quot;) is &quot;-0.9&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;-1.1&quot;) is &quot;-1&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;-1.2&quot;) is &quot;-1.1&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;-2.0&quot;) is &quot;-1.9&quot;
+
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;0.1&quot;) is &quot;0&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;0.2&quot;) is &quot;0.1&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;1.0&quot;) is &quot;0.9&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;1.1&quot;) is &quot;1&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;1.2&quot;) is &quot;1.1&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;2.0&quot;) is &quot;1.9&quot;
+
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;-0.1&quot;) is &quot;-0.2&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;-0.2&quot;) is &quot;-0.3&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;-1.0&quot;) is &quot;-1.1&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;-1.1&quot;) is &quot;-1.2&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;-1.2&quot;) is &quot;-1.3&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;-2.0&quot;) is &quot;-2.1&quot;
+
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;.1&quot;) is &quot;0.2&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;.2&quot;) is &quot;0.3&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;1.&quot;) is &quot;1.1&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;2.&quot;) is &quot;2.1&quot;
+
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;-.1&quot;) is &quot;0&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;-.2&quot;) is &quot;-0.1&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;-1.&quot;) is &quot;-0.9&quot;
+PASS stepUpExplicitBounds(-10, 10, .1, &quot;-2.&quot;) is &quot;-1.9&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;.1&quot;) is &quot;0&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;.2&quot;) is &quot;0.1&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;1.&quot;) is &quot;0.9&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;2.&quot;) is &quot;1.9&quot;
+
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;-.1&quot;) is &quot;-0.2&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;-.2&quot;) is &quot;-0.3&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;-1.&quot;) is &quot;-1.1&quot;
+PASS stepDownExplicitBounds(-10, 10, .1, &quot;-2.&quot;) is &quot;-2.1&quot;
+
</ins><span class="cx"> Invalid step value
</span><span class="cx"> PASS stepUpExplicitBounds(null, null, &quot;foo&quot;, &quot;0&quot;) is &quot;1&quot;
</span><span class="cx"> PASS stepUpExplicitBounds(null, null, &quot;0&quot;, &quot;1&quot;) is &quot;2&quot;
</span><span class="lines">@@ -31,9 +129,11 @@
</span><span class="cx"> PASS stepDownExplicitBounds(null, null, &quot;foo&quot;, &quot;1&quot;) is &quot;0&quot;
</span><span class="cx"> PASS stepDownExplicitBounds(null, null, &quot;0&quot;, &quot;2&quot;) is &quot;1&quot;
</span><span class="cx"> PASS stepDownExplicitBounds(null, null, &quot;-1&quot;, &quot;3&quot;) is &quot;2&quot;
</span><ins>+
</ins><span class="cx"> Step=any
</span><span class="cx"> PASS stepUpExplicitBounds(null, null, &quot;any&quot;, &quot;1&quot;) is &quot;2&quot;
</span><span class="cx"> PASS stepDownExplicitBounds(null, null, &quot;any&quot;, &quot;1&quot;) is &quot;0&quot;
</span><ins>+
</ins><span class="cx"> Overflow/underflow
</span><span class="cx"> PASS stepUpExplicitBounds(null, &quot;100&quot;, &quot;1&quot;, &quot;99&quot;) is &quot;100&quot;
</span><span class="cx"> PASS stepUpExplicitBounds(null, &quot;100&quot;, &quot;1&quot;, &quot;100&quot;) is &quot;100&quot;
</span><span class="lines">@@ -46,15 +146,19 @@
</span><span class="cx"> PASS stepUpExplicitBounds(null, 0, 1, 0) is &quot;0&quot;
</span><span class="cx"> PASS stepUpExplicitBounds(-100, 0, 1, -1, 2) is &quot;0&quot;
</span><span class="cx"> PASS stepUpExplicitBounds(null, null, &quot;3.40282346e+38&quot;, &quot;1&quot;, 2) is &quot;0&quot;
</span><ins>+
</ins><span class="cx"> stepDown()/stepUp() for stepMismatch values
</span><span class="cx"> PASS stepUpExplicitBounds(null, null, 2, 1) is &quot;4&quot;
</span><span class="cx"> PASS stepUpExplicitBounds(0, null, 10, 9, 9) is &quot;100&quot;
</span><span class="cx"> PASS stepDownExplicitBounds(0, null, 10, 19) is &quot;10&quot;
</span><ins>+
</ins><span class="cx"> value + step is &lt;= max, but rounded result would be &gt; max.
</span><span class="cx"> PASS stepUpExplicitBounds(null, 99, 10, 89) is &quot;90&quot;
</span><ins>+
</ins><span class="cx"> Huge value and small step
</span><span class="cx"> PASS stepUpExplicitBounds(0, 1e38, 1, 1e38, 999) is &quot;1e+38&quot;
</span><span class="cx"> PASS stepDownExplicitBounds(0, 1e38, 1, 1e38, 999) is &quot;1e+38&quot;
</span><ins>+
</ins><span class="cx"> Fractional numbers
</span><span class="cx"> PASS stepUpExplicitBounds(null, null, 0.33333333333333333, 0, 3) is &quot;1&quot;
</span><span class="cx"> PASS stepUpExplicitBounds(null, null, 0.1, 1) is &quot;1.1&quot;
</span></span></pre></div>
<a id="trunkLayoutTestsfastformsrangerangestepupstepdownfromrendererhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/forms/range/range-stepup-stepdown-from-renderer.html (191939 => 191940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/range/range-stepup-stepdown-from-renderer.html        2015-11-03 06:16:26 UTC (rev 191939)
+++ trunk/LayoutTests/fast/forms/range/range-stepup-stepdown-from-renderer.html        2015-11-03 07:21:41 UTC (rev 191940)
</span><span class="lines">@@ -101,6 +101,8 @@
</span><span class="cx"> shouldBe('stepDownExplicitBounds(null, null, &quot;any&quot;, &quot;foo&quot;)', '&quot;49&quot;');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, null, &quot;foo&quot;, &quot;foo&quot;)', '&quot;51&quot;');
</span><span class="cx"> shouldBe('stepDownExplicitBounds(null, null, &quot;foo&quot;, &quot;foo&quot;)', '&quot;49&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Normal cases');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, null, null, &quot;0&quot;)', '&quot;1&quot;');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, null, null, &quot;1&quot;, 2)', '&quot;3&quot;');
</span><span class="lines">@@ -108,6 +110,134 @@
</span><span class="cx"> shouldBe('stepDownExplicitBounds(&quot;-100&quot;, null, null, &quot;2&quot;)', '&quot;1&quot;');
</span><span class="cx"> shouldBe('stepDownExplicitBounds(&quot;-100&quot;, null, null, &quot;1&quot;, 2)', '&quot;-1&quot;');
</span><span class="cx"> shouldBe('stepDownExplicitBounds(&quot;-100&quot;, null, null, &quot;-1&quot;, -1)', '&quot;0&quot;');
</span><ins>+
+
+debug('');
+debug('Fractional cases')
+// &quot;When the element is suffering from a step mismatch, the user agent must
+// round the element's value to the nearest number for which the element would
+// not suffer from a step mismatch, and which is greater than or equal to the
+// minimum, and, if the maximum is not less than the minimum, which is less
+// than or equal to the maximum, if there is a number that matches these
+// constraints. If two numbers match these constraints, then user agents must
+// use the one nearest to positive infinity.&quot;&quot;
+
+// Base/model/template tests
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;0.1&quot;)', '&quot;1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;0.2&quot;)', '&quot;1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;1.0&quot;)', '&quot;2&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;1.1&quot;)', '&quot;2&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;1.2&quot;)', '&quot;2&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;2.0&quot;)', '&quot;3&quot;');
+
+// Same as above, but with negative numbers.
+debug('');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;-0.1&quot;)', '&quot;1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;-0.2&quot;)', '&quot;1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;-1.0&quot;)', '&quot;0&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;-1.1&quot;)', '&quot;0&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;-1.2&quot;)', '&quot;0&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;-2.0&quot;)', '&quot;-1&quot;');
+
+// Same as above, but stepping down rather than up.
+debug('');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;0.1&quot;)', '&quot;-1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;0.2&quot;)', '&quot;-1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;1.0&quot;)', '&quot;0&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;1.1&quot;)', '&quot;0&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;1.2&quot;)', '&quot;0&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;2.0&quot;)', '&quot;1&quot;');
+
+debug('');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;-0.1&quot;)', '&quot;-1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;-0.2&quot;)', '&quot;-1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;-1.0&quot;)', '&quot;-2&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;-1.1&quot;)', '&quot;-2&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;-1.2&quot;)', '&quot;-2&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;-2.0&quot;)', '&quot;-3&quot;');
+
+// Same as above, but with leading/trailing zeros removed.
+debug('');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;.1&quot;)', '&quot;1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;.2&quot;)', '&quot;1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;1.&quot;)', '&quot;2&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;2.&quot;)', '&quot;3&quot;');
+
+debug('');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;-.1&quot;)', '&quot;1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;-.2&quot;)', '&quot;1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;-1.&quot;)', '&quot;0&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;-2.&quot;)', '&quot;-1&quot;');
+
+debug('');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;.1&quot;)', '&quot;-1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;.2&quot;)', '&quot;-1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;1.&quot;)', '&quot;0&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;2.&quot;)', '&quot;1&quot;');
+
+debug('');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;-.1&quot;)', '&quot;-1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;-.2&quot;)', '&quot;-1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;-1.&quot;)', '&quot;-2&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;-2.&quot;)', '&quot;-3&quot;');
+
+// Same as above, but stepping by .1 rather than 1.
+debug('');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;0.1&quot;)', '&quot;0.2&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;0.2&quot;)', '&quot;0.3&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;1.0&quot;)', '&quot;1.1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;1.1&quot;)', '&quot;1.2&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;1.2&quot;)', '&quot;1.3&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;2.0&quot;)', '&quot;2.1&quot;');
+
+debug('');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;-0.1&quot;)', '&quot;0&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;-0.2&quot;)', '&quot;-0.1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;-1.0&quot;)', '&quot;-0.9&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;-1.1&quot;)', '&quot;-1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;-1.2&quot;)', '&quot;-1.1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;-2.0&quot;)', '&quot;-1.9&quot;');
+
+debug('');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;0.1&quot;)', '&quot;0&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;0.2&quot;)', '&quot;0.1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;1.0&quot;)', '&quot;0.9&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;1.1&quot;)', '&quot;1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;1.2&quot;)', '&quot;1.1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;2.0&quot;)', '&quot;1.9&quot;');
+
+debug('');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;-0.1&quot;)', '&quot;-0.2&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;-0.2&quot;)', '&quot;-0.3&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;-1.0&quot;)', '&quot;-1.1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;-1.1&quot;)', '&quot;-1.2&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;-1.2&quot;)', '&quot;-1.3&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;-2.0&quot;)', '&quot;-2.1&quot;');
+
+debug('');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;.1&quot;)', '&quot;0.2&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;.2&quot;)', '&quot;0.3&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;1.&quot;)', '&quot;1.1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;2.&quot;)', '&quot;2.1&quot;');
+
+debug('');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;-.1&quot;)', '&quot;0&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;-.2&quot;)', '&quot;-0.1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;-1.&quot;)', '&quot;-0.9&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;-2.&quot;)', '&quot;-1.9&quot;');
+
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;.1&quot;)', '&quot;0&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;.2&quot;)', '&quot;0.1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;1.&quot;)', '&quot;0.9&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;2.&quot;)', '&quot;1.9&quot;');
+
+debug('');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;-.1&quot;)', '&quot;-0.2&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;-.2&quot;)', '&quot;-0.3&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;-1.&quot;)', '&quot;-1.1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;-2.&quot;)', '&quot;-2.1&quot;');
+
+debug('');
</ins><span class="cx"> debug('Invalid step value');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, null, &quot;foo&quot;, &quot;0&quot;)', '&quot;1&quot;');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, null, &quot;0&quot;, &quot;1&quot;)', '&quot;2&quot;');
</span><span class="lines">@@ -115,9 +245,13 @@
</span><span class="cx"> shouldBe('stepDownExplicitBounds(null, null, &quot;foo&quot;, &quot;1&quot;)', '&quot;0&quot;');
</span><span class="cx"> shouldBe('stepDownExplicitBounds(null, null, &quot;0&quot;, &quot;2&quot;)', '&quot;1&quot;');
</span><span class="cx"> shouldBe('stepDownExplicitBounds(null, null, &quot;-1&quot;, &quot;3&quot;)', '&quot;2&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Step=any');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, null, &quot;any&quot;, &quot;1&quot;)', '&quot;2&quot;');
</span><span class="cx"> shouldBe('stepDownExplicitBounds(null, null, &quot;any&quot;, &quot;1&quot;)', '&quot;0&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Overflow/underflow');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, &quot;100&quot;, &quot;1&quot;, &quot;99&quot;)', '&quot;100&quot;');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, &quot;100&quot;, &quot;1&quot;, &quot;100&quot;)', '&quot;100&quot;');
</span><span class="lines">@@ -130,15 +264,23 @@
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, 0, 1, 0)', '&quot;0&quot;');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(-100, 0, 1, -1, 2)', '&quot;0&quot;');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, null, &quot;3.40282346e+38&quot;, &quot;1&quot;, 2)', '&quot;0&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('stepDown()/stepUp() for stepMismatch values');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, null, 2, 1)', '&quot;4&quot;');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(0, null, 10, 9, 9)', '&quot;100&quot;');
</span><span class="cx"> shouldBe('stepDownExplicitBounds(0, null, 10, 19)', '&quot;10&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('value + step is &lt;= max, but rounded result would be &gt; max.');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, 99, 10, 89)', '&quot;90&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Huge value and small step');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(0, 1e38, 1, 1e38, 999)', '&quot;1e+38&quot;');
</span><span class="cx"> shouldBe('stepDownExplicitBounds(0, 1e38, 1, 1e38, 999)', '&quot;1e+38&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Fractional numbers');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, null, 0.33333333333333333, 0, 3)', '&quot;1&quot;');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, null, 0.1, 1)', '&quot;1.1&quot;');
</span></span></pre></div>
<a id="trunkLayoutTestsfastformsrangerangestepupstepdownhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/forms/range/range-stepup-stepdown.html (191939 => 191940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/range/range-stepup-stepdown.html        2015-11-03 06:16:26 UTC (rev 191939)
+++ trunk/LayoutTests/fast/forms/range/range-stepup-stepdown.html        2015-11-03 07:21:41 UTC (rev 191940)
</span><span class="lines">@@ -63,6 +63,8 @@
</span><span class="cx"> debug('Using the default values');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, null, null, &quot;&quot;)', '&quot;51&quot;');
</span><span class="cx"> shouldBe('stepDownExplicitBounds(null, null, null, &quot;&quot;)', '&quot;49&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Non-number arguments (stepCount)');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, null, null, &quot;0&quot;, &quot;0&quot;)', '&quot;0&quot;');
</span><span class="cx"> shouldBe('stepDownExplicitBounds(null, null, null, &quot;0&quot;, &quot;0&quot;)', '&quot;0&quot;');
</span><span class="lines">@@ -70,6 +72,8 @@
</span><span class="cx"> shouldBe('stepDownExplicitBounds(null, null, null, &quot;0&quot;, &quot;foo&quot;)', '&quot;0&quot;');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, null, null, &quot;0&quot;, null)', '&quot;0&quot;');
</span><span class="cx"> shouldBe('stepDownExplicitBounds(null, null, null, &quot;0&quot;, null)', '&quot;0&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Normal cases');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, null, null, &quot;0&quot;)', '&quot;1&quot;');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, null, null, &quot;1&quot;, 2)', '&quot;3&quot;');
</span><span class="lines">@@ -77,9 +81,139 @@
</span><span class="cx"> shouldBe('stepDownExplicitBounds(&quot;-100&quot;, null, null, &quot;2&quot;)', '&quot;1&quot;');
</span><span class="cx"> shouldBe('stepDownExplicitBounds(&quot;-100&quot;, null, null, &quot;1&quot;, 2)', '&quot;-1&quot;');
</span><span class="cx"> shouldBe('stepDownExplicitBounds(&quot;-100&quot;, null, null, &quot;-1&quot;, -1)', '&quot;0&quot;');
</span><ins>+
+debug('');
+debug('Fractional cases')
+// &quot;When the element is suffering from a step mismatch, the user agent must
+// round the element's value to the nearest number for which the element would
+// not suffer from a step mismatch, and which is greater than or equal to the
+// minimum, and, if the maximum is not less than the minimum, which is less
+// than or equal to the maximum, if there is a number that matches these
+// constraints. If two numbers match these constraints, then user agents must
+// use the one nearest to positive infinity.&quot;&quot;
+
+// Base/model/template tests
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;0.1&quot;)', '&quot;1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;0.2&quot;)', '&quot;1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;1.0&quot;)', '&quot;2&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;1.1&quot;)', '&quot;2&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;1.2&quot;)', '&quot;2&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;2.0&quot;)', '&quot;3&quot;');
+
+// Same as above, but with negative numbers.
+debug('');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;-0.1&quot;)', '&quot;1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;-0.2&quot;)', '&quot;1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;-1.0&quot;)', '&quot;0&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;-1.1&quot;)', '&quot;0&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;-1.2&quot;)', '&quot;0&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;-2.0&quot;)', '&quot;-1&quot;');
+
+// Same as above, but stepping down rather than up.
+debug('');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;0.1&quot;)', '&quot;-1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;0.2&quot;)', '&quot;-1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;1.0&quot;)', '&quot;0&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;1.1&quot;)', '&quot;0&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;1.2&quot;)', '&quot;0&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;2.0&quot;)', '&quot;1&quot;');
+
+debug('');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;-0.1&quot;)', '&quot;-1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;-0.2&quot;)', '&quot;-1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;-1.0&quot;)', '&quot;-2&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;-1.1&quot;)', '&quot;-2&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;-1.2&quot;)', '&quot;-2&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;-2.0&quot;)', '&quot;-3&quot;');
+
+// Same as above, but with leading/trailing zeros removed.
+debug('');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;.1&quot;)', '&quot;1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;.2&quot;)', '&quot;1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;1.&quot;)', '&quot;2&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;2.&quot;)', '&quot;3&quot;');
+
+debug('');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;-.1&quot;)', '&quot;1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;-.2&quot;)', '&quot;1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;-1.&quot;)', '&quot;0&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, 1, &quot;-2.&quot;)', '&quot;-1&quot;');
+
+debug('');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;.1&quot;)', '&quot;-1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;.2&quot;)', '&quot;-1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;1.&quot;)', '&quot;0&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;2.&quot;)', '&quot;1&quot;');
+
+debug('');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;-.1&quot;)', '&quot;-1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;-.2&quot;)', '&quot;-1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;-1.&quot;)', '&quot;-2&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, 1, &quot;-2.&quot;)', '&quot;-3&quot;');
+
+// Same as above, but stepping by .1 rather than 1.
+debug('');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;0.1&quot;)', '&quot;0.2&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;0.2&quot;)', '&quot;0.3&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;1.0&quot;)', '&quot;1.1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;1.1&quot;)', '&quot;1.2&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;1.2&quot;)', '&quot;1.3&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;2.0&quot;)', '&quot;2.1&quot;');
+
+debug('');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;-0.1&quot;)', '&quot;0&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;-0.2&quot;)', '&quot;-0.1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;-1.0&quot;)', '&quot;-0.9&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;-1.1&quot;)', '&quot;-1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;-1.2&quot;)', '&quot;-1.1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;-2.0&quot;)', '&quot;-1.9&quot;');
+
+debug('');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;0.1&quot;)', '&quot;0&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;0.2&quot;)', '&quot;0.1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;1.0&quot;)', '&quot;0.9&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;1.1&quot;)', '&quot;1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;1.2&quot;)', '&quot;1.1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;2.0&quot;)', '&quot;1.9&quot;');
+
+debug('');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;-0.1&quot;)', '&quot;-0.2&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;-0.2&quot;)', '&quot;-0.3&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;-1.0&quot;)', '&quot;-1.1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;-1.1&quot;)', '&quot;-1.2&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;-1.2&quot;)', '&quot;-1.3&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;-2.0&quot;)', '&quot;-2.1&quot;');
+
+debug('');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;.1&quot;)', '&quot;0.2&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;.2&quot;)', '&quot;0.3&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;1.&quot;)', '&quot;1.1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;2.&quot;)', '&quot;2.1&quot;');
+
+debug('');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;-.1&quot;)', '&quot;0&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;-.2&quot;)', '&quot;-0.1&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;-1.&quot;)', '&quot;-0.9&quot;');
+shouldBe('stepUpExplicitBounds(-10, 10, .1, &quot;-2.&quot;)', '&quot;-1.9&quot;');
+
+debug('');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;.1&quot;)', '&quot;0&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;.2&quot;)', '&quot;0.1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;1.&quot;)', '&quot;0.9&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;2.&quot;)', '&quot;1.9&quot;');
+
+debug('');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;-.1&quot;)', '&quot;-0.2&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;-.2&quot;)', '&quot;-0.3&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;-1.&quot;)', '&quot;-1.1&quot;');
+shouldBe('stepDownExplicitBounds(-10, 10, .1, &quot;-2.&quot;)', '&quot;-2.1&quot;');
+
+debug('');
</ins><span class="cx"> debug('Extra arguments');
</span><span class="cx"> shouldBe('setInputAttributes(null, null, null, &quot;0&quot;); input.stepUp(1,2); input.value', '&quot;1&quot;');
</span><span class="cx"> shouldBe('setInputAttributes(null, null, null, &quot;1&quot;); input.stepDown(1,3); input.value', '&quot;0&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Invalid step value');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, null, &quot;foo&quot;, &quot;0&quot;)', '&quot;1&quot;');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, null, &quot;0&quot;, &quot;1&quot;)', '&quot;2&quot;');
</span><span class="lines">@@ -87,9 +221,13 @@
</span><span class="cx"> shouldBe('stepDownExplicitBounds(null, null, &quot;foo&quot;, &quot;1&quot;)', '&quot;0&quot;');
</span><span class="cx"> shouldBe('stepDownExplicitBounds(null, null, &quot;0&quot;, &quot;2&quot;)', '&quot;1&quot;');
</span><span class="cx"> shouldBe('stepDownExplicitBounds(null, null, &quot;-1&quot;, &quot;3&quot;)', '&quot;2&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Step=any');
</span><span class="cx"> shouldThrow('stepUpExplicitBounds(null, null, &quot;any&quot;, &quot;1&quot;)', invalidStateErr);
</span><span class="cx"> shouldThrow('stepDownExplicitBounds(null, null, &quot;any&quot;, &quot;1&quot;)', invalidStateErr);
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Overflow/underflow');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, &quot;100&quot;, &quot;1&quot;, &quot;99&quot;)', '&quot;100&quot;');
</span><span class="cx"> shouldThrow('stepUpExplicitBounds(null, &quot;100&quot;, &quot;1&quot;, &quot;100&quot;)', invalidStateErr);
</span><span class="lines">@@ -107,16 +245,24 @@
</span><span class="cx"> shouldThrow('stepUpExplicitBounds(-100, 0, 1, -1, 2)', invalidStateErr);
</span><span class="cx"> shouldBe('input.value', '&quot;-1&quot;');
</span><span class="cx"> shouldThrow('stepUpExplicitBounds(null, null, &quot;3.40282346e+38&quot;, &quot;1&quot;, &quot;2&quot;)', invalidStateErr);
</span><ins>+
+debug('');
</ins><span class="cx"> debug('stepDown()/stepUp() for stepMismatch values');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, null, 2, 1)', '&quot;4&quot;');
</span><span class="cx"> shouldBe('input.stepDown(); input.value', '&quot;2&quot;');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(0, null, 10, 9, 9)', '&quot;100&quot;');
</span><span class="cx"> shouldBe('stepDownExplicitBounds(0, null, 10, 19)', '&quot;10&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('value + step is &lt;= max, but rounded result would be &gt; max.');
</span><span class="cx"> shouldThrow('stepUpExplicitBounds(null, 99, 10, 89)', invalidStateErr);
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Huge value and small step');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(0, 1e38, 1, 1e38, 999999)', '&quot;1e+38&quot;');
</span><span class="cx"> shouldBe('stepDownExplicitBounds(0, 1e38, 1, 1e38, 999999)', '&quot;1e+38&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> debug('Fractional numbers');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, null, 0.33333333333333333, 0, 3)', '&quot;1&quot;');
</span><span class="cx"> shouldBe('stepUpExplicitBounds(null, null, 0.1, 1)', '&quot;1.1&quot;');
</span><span class="lines">@@ -127,6 +273,8 @@
</span><span class="cx"> shouldBe('for (var i = 0; i &lt; 255; i++) { input.stepDown(); }; input.value', '&quot;0&quot;');
</span><span class="cx"> shouldBe('stepDownExplicitBounds(null, null, 0.1, 1, 8)', '&quot;0.2&quot;');
</span><span class="cx"> shouldBe('stepDownExplicitBounds(null, null, 0.1, 1)', '&quot;0.9&quot;');
</span><ins>+
+debug('');
</ins><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;/body&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (191939 => 191940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-11-03 06:16:26 UTC (rev 191939)
+++ trunk/Source/WebCore/ChangeLog        2015-11-03 07:21:41 UTC (rev 191940)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2015-11-02  Keith Rollin  &lt;krollin@apple.com&gt;
+
+        input[type=number] does not increment/decrement integers with trailing decimal characters
+        https://bugs.webkit.org/show_bug.cgi?id=148867
+        rdar://problem/22589693
+
+        Reviewed by Chris Dumez.
+
+        Support input[type=number].value attributes of the form &quot;###.&quot; (that
+        is, leading digits with a decimal but no trailing digits). This form
+        was supported in the setting of the attribute, but not when changing
+        it through stepUp/Down.
+
+        Testing turned up similarly incorrect processing of -.###, so
+        addressed that, too.
+
+        Test: fast/forms/range/input-appearance-range-decimals.html
+
+        Updated the following tests:
+        - fast/forms/number/number-stepup-stepdown-from-renderer.html
+        - fast/forms/number/number-stepup-stepdown.html
+        - fast/forms/range/range-stepup-stepdown-from-renderer.html
+        - fast/forms/range/range-stepup-stepdown.html
+
+        * html/InputType.cpp:
+        (WebCore::InputType::stepUpFromRenderer):
+        * platform/Decimal.cpp:
+        (WebCore::Decimal::fromString):
+
</ins><span class="cx"> 2015-11-02  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Null dereference loading Blink layout test fast/css/background-repeat-null-y-crash.html
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlInputTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/InputType.cpp (191939 => 191940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/InputType.cpp        2015-11-03 06:16:26 UTC (rev 191939)
+++ trunk/Source/WebCore/html/InputType.cpp        2015-11-03 07:21:41 UTC (rev 191940)
</span><span class="lines">@@ -1062,7 +1062,7 @@
</span><span class="cx">     //   * If 0 is in-range, but not matched to step value
</span><span class="cx">     //     - The value should be the larger matched value nearest to 0 if n &gt; 0
</span><span class="cx">     //       e.g. &lt;input type=number min=-100 step=3&gt; -&gt; 2
</span><del>-    //     - The value should be the smaler matched value nearest to 0 if n &lt; 0
</del><ins>+    //     - The value should be the smaller matched value nearest to 0 if n &lt; 0
</ins><span class="cx">     //       e.g. &lt;input type=number min=-100 step=3&gt; -&gt; -1
</span><span class="cx">     //   As for date/datetime-local/month/time/week types, the current value is assumed as &quot;the current local date/time&quot;.
</span><span class="cx">     //   As for datetime type, the current value is assumed as &quot;the current date/time in UTC&quot;.
</span><span class="lines">@@ -1077,7 +1077,7 @@
</span><span class="cx">     // If the current value is not matched to step value:
</span><span class="cx">     // - The value should be the larger matched value nearest to 0 if n &gt; 0
</span><span class="cx">     //   e.g. &lt;input type=number value=3 min=-100 step=3&gt; -&gt; 5
</span><del>-    // - The value should be the smaler matched value nearest to 0 if n &lt; 0
</del><ins>+    // - The value should be the smaller matched value nearest to 0 if n &lt; 0
</ins><span class="cx">     //   e.g. &lt;input type=number value=3 min=-100 step=3&gt; -&gt; 2
</span><span class="cx">     //
</span><span class="cx">     // n is assumed as -n if step &lt; 0.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformDecimalcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/Decimal.cpp (191939 => 191940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/Decimal.cpp        2015-11-03 06:16:26 UTC (rev 191939)
+++ trunk/Source/WebCore/platform/Decimal.cpp        2015-11-03 07:21:41 UTC (rev 191940)
</span><span class="lines">@@ -824,6 +824,7 @@
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             HandleCharAndBreak('0', StateZero);
</span><ins>+            HandleCharAndBreak('.', StateDot);
</ins><span class="cx">             return nan();
</span><span class="cx"> 
</span><span class="cx">         case StateStart:
</span><span class="lines">@@ -874,7 +875,7 @@
</span><span class="cx">     if (state == StateZero)
</span><span class="cx">         return zero(sign);
</span><span class="cx"> 
</span><del>-    if (state == StateDigit || state == StateEDigit || state == StateDotDigit) {
</del><ins>+    if (state == StateDigit || state == StateDot || state == StateDotDigit || state == StateEDigit) {
</ins><span class="cx">         int resultExponent = exponent * (exponentSign == Negative ? -1 : 1) - numberOfDigitsAfterDot + numberOfExtraDigits;
</span><span class="cx">         if (resultExponent &lt; ExponentMin)
</span><span class="cx">             return zero(Positive);
</span></span></pre>
</div>
</div>

</body>
</html>