| Differences between
and this patch
- a/LayoutTests/ChangeLog +17 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2009-10-30  Kent Tamura  <tkent@chromium.org>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        Add tests for HTMLInputElement::stepUp() and stepDown().
6
        https://bugs.webkit.org/show_bug.cgi?id=27451
7
8
        * fast/forms/input-step-number-expected.txt: Added.
9
        * fast/forms/input-step-number.html: Added.
10
        * fast/forms/input-step-range-expected.txt: Added.
11
        * fast/forms/input-step-range.html: Added.
12
        * fast/forms/input-step-unsupported-expected.txt: Added.
13
        * fast/forms/input-step-unsupported.html: Added.
14
        * fast/forms/script-tests/input-step-number.js: Added.
15
        * fast/forms/script-tests/input-step-range.js: Added.
16
        * fast/forms/script-tests/input-step-unsupported.js: Added.
17
1
2009-10-29  Kent Tamura  <tkent@chromium.org>
18
2009-10-29  Kent Tamura  <tkent@chromium.org>
2
19
3
        Reviewed by NOBODY (OOPS!).
20
        Reviewed by NOBODY (OOPS!).
- a/LayoutTests/fast/forms/input-step-number-expected.txt +46 lines
Line 0 a/LayoutTests/fast/forms/input-step-number-expected.txt_sec1
1
Tests stepDown()/stepUp() for type=number.
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS input.stepDown() threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
7
PASS input.stepUp() threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
8
PASS input.value is "0"
9
PASS input.value is "0"
10
PASS input.value is "1"
11
PASS input.value is "3"
12
PASS input.value is "2"
13
PASS input.value is "1"
14
PASS input.value is "-1"
15
PASS input.value is "0"
16
PASS input.value is "1"
17
PASS input.value is "2"
18
PASS input.value is "3"
19
PASS input.stepDown() threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
20
PASS input.stepUp() threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
21
PASS input.value is "0"
22
PASS input.stepDown() threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
23
PASS input.stepDown(2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
24
PASS input.value is "1"
25
PASS input.stepDown(2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
26
PASS input.value is "0"
27
PASS input.stepUp() threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
28
PASS input.stepUp(2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
29
PASS input.value is "-1"
30
PASS input.stepUp(2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
31
PASS input.value is "3"
32
PASS input.value is "1"
33
PASS input.value is "100"
34
PASS input.value is "10"
35
PASS input.stepUp() threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
36
PASS input.value is "1e+308"
37
PASS input.value is "1e+308"
38
PASS input.value is "1"
39
PASS input.value is "2"
40
PASS input.value is "3"
41
PASS input.value is "1"
42
PASS input.value is "0"
43
PASS successfullyParsed is true
44
45
TEST COMPLETE
46
- a/LayoutTests/fast/forms/input-step-number.html +13 lines
Line 0 a/LayoutTests/fast/forms/input-step-number.html_sec1
1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2
<html>
3
<head>
4
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
5
<script src="../../fast/js/resources/js-test-pre.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
<script src="script-tests/input-step-number.js"></script>
11
<script src="../../fast/js/resources/js-test-post.js"></script>
12
</body>
13
</html>
- a/LayoutTests/fast/forms/input-step-range-expected.txt +46 lines
Line 0 a/LayoutTests/fast/forms/input-step-range-expected.txt_sec1
1
Tests stepDown()/stepUp() for type=range.
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS input.stepDown() threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
7
PASS input.stepUp() threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
8
PASS input.value is "0"
9
PASS input.value is "0"
10
PASS input.value is "1"
11
PASS input.value is "3"
12
PASS input.value is "2"
13
PASS input.value is "1"
14
PASS input.value is "-1"
15
PASS input.value is "0"
16
PASS input.value is "1"
17
PASS input.value is "2"
18
PASS input.value is "3"
19
PASS input.stepDown() threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
20
PASS input.stepUp() threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
21
PASS input.value is "0"
22
PASS input.stepDown() threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
23
PASS input.stepDown(2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
24
PASS input.value is "1"
25
PASS input.stepDown(2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
26
PASS input.value is "0"
27
PASS input.stepUp() threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
28
PASS input.stepUp(2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
29
PASS input.value is "-1"
30
PASS input.stepUp(2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
31
PASS input.value is "3"
32
PASS input.value is "1"
33
PASS input.value is "100"
34
PASS input.value is "10"
35
PASS input.value is "90"
36
PASS input.value is "1e+308"
37
PASS input.value is "1e+308"
38
PASS input.value is "1"
39
PASS input.value is "2"
40
PASS input.value is "3"
41
PASS input.value is "1"
42
PASS input.value is "0"
43
PASS successfullyParsed is true
44
45
TEST COMPLETE
46
- a/LayoutTests/fast/forms/input-step-range.html +13 lines
Line 0 a/LayoutTests/fast/forms/input-step-range.html_sec1
1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2
<html>
3
<head>
4
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
5
<script src="../../fast/js/resources/js-test-pre.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
<script src="script-tests/input-step-range.js"></script>
11
<script src="../../fast/js/resources/js-test-post.js"></script>
12
</body>
13
</html>
- a/LayoutTests/fast/forms/input-step-unsupported-expected.txt +13 lines
Line 0 a/LayoutTests/fast/forms/input-step-unsupported-expected.txt_sec1
1
Tests stepDown()/stepUp() for unsuppoted typpes
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS input.stepDown() threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
7
PASS input.stepDown(0) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
8
PASS input.stepUp() threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
9
PASS input.stepUp(0) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
10
PASS successfullyParsed is true
11
12
TEST COMPLETE
13
- a/LayoutTests/fast/forms/input-step-unsupported.html +13 lines
Line 0 a/LayoutTests/fast/forms/input-step-unsupported.html_sec1
1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2
<html>
3
<head>
4
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
5
<script src="../../fast/js/resources/js-test-pre.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
<script src="script-tests/input-step-unsupported.js"></script>
11
<script src="../../fast/js/resources/js-test-post.js"></script>
12
</body>
13
</html>
- a/LayoutTests/fast/forms/script-tests/input-step-number.js +140 lines
Line 0 a/LayoutTests/fast/forms/script-tests/input-step-number.js_sec1
1
description('Tests stepDown()/stepUp() for type=number.');
2
3
var input = document.createElement('input');
4
input.type = 'number';
5
var invalidStateErr = '"Error: INVALID_STATE_ERR: DOM Exception 11"';
6
7
// The value is unparsable.
8
input.value = '';
9
shouldThrow('input.stepDown()', invalidStateErr);
10
shouldThrow('input.stepUp()', invalidStateErr);
11
12
// Non-number argument
13
input.value = '0';
14
input.stepDown("foo");
15
shouldBe('input.value', '"0"');
16
input.stepUp("foo");
17
shouldBe('input.value', '"0"');
18
19
// Default step value for type=number is 1.
20
input.value = '0';
21
input.stepUp();
22
shouldBe('input.value', '"1"');
23
input.stepUp(2);
24
shouldBe('input.value', '"3"');
25
input.stepUp(-1);
26
shouldBe('input.value', '"2"');
27
input.stepDown();
28
shouldBe('input.value', '"1"');
29
input.stepDown(2);
30
shouldBe('input.value', '"-1"');
31
input.stepDown(-1);
32
shouldBe('input.value', '"0"');
33
// The default value is used for invalid step values.
34
input.value = '0';
35
input.step = 'foo';
36
input.stepUp();
37
shouldBe('input.value', '"1"');
38
input.step = '0';
39
input.stepUp();
40
shouldBe('input.value', '"2"');
41
input.step = '-1';
42
input.stepUp();
43
shouldBe('input.value', '"3"');
44
45
// No step value
46
input.value = '0';
47
input.step = 'any';
48
shouldThrow('input.stepDown()', invalidStateErr);
49
shouldThrow('input.stepUp()', invalidStateErr);
50
51
// Minimum limit
52
input.min = '0';
53
input.step = '1';
54
input.value = '1';
55
input.stepDown();
56
shouldBe('input.value', '"0"');
57
shouldThrow('input.stepDown()', invalidStateErr);
58
input.value = '1';
59
shouldThrow('input.stepDown(2)', invalidStateErr);
60
shouldBe('input.value', '"1"');
61
// Should not be -Infinity.
62
input.value = '1';
63
input.min = '';
64
input.step = '1.7976931348623156e+308';
65
shouldThrow('input.stepDown(2)', invalidStateErr);
66
67
// Maximum limit
68
input.value = '-1';
69
input.min = '';
70
input.max = '0';
71
input.step = '1';
72
input.stepUp();
73
shouldBe('input.value', '"0"');
74
shouldThrow('input.stepUp()', invalidStateErr);
75
input.value = '-1';
76
shouldThrow('input.stepUp(2)', invalidStateErr);
77
shouldBe('input.value', '"-1"');
78
// Should not be Infinity.
79
input.value = '1';
80
input.max = '';
81
input.step = '1.7976931348623156e+308';
82
shouldThrow('input.stepUp(2)', invalidStateErr);
83
84
// stepDown()/stepUp() for stepMismatch values
85
input.value = '0';
86
input.min = '-1';
87
input.step = '2';
88
input.stepUp();
89
shouldBe('input.value', '"3"');
90
input.stepDown();
91
shouldBe('input.value', '"1"');
92
input.value = '9';
93
input.min = '0';
94
input.max = '';
95
input.step = '10';
96
input.stepUp(9);
97
shouldBe('input.value', '"100"');
98
input.value = '19';
99
input.stepDown();
100
shouldBe('input.value', '"10"');
101
// value + step is <= max, but rounded result would be > max.
102
input.value = '89';
103
input.max = '99';
104
shouldThrow('input.stepUp()', invalidStateErr);
105
106
// Huge value and small step
107
input.value = '1e+308';
108
input.min = '';
109
input.max = '';
110
input.step = '1';
111
input.stepUp(999999);
112
shouldBe('input.value', '"1e+308"');
113
input.stepDown(999999);
114
shouldBe('input.value', '"1e+308"');
115
116
// Fractional numbers
117
input.value = '0';
118
input.min = '';
119
input.max = '';
120
input.step = '0.33333333333333333';
121
input.stepUp(3);
122
shouldBe('input.value', '"1"');
123
input.step = '0.1';
124
input.stepUp(10);
125
shouldBe('input.value', '"2"');
126
for (var i = 0; i < 10; i++)
127
    input.stepUp();
128
shouldBe('input.value', '"3"');
129
130
input.value = '0';
131
input.min = '0';
132
input.max = '1';
133
input.step = '0.003921568627450980';
134
input.stepUp(255);
135
shouldBe('input.value', '"1"');
136
for (var i = 0; i < 255; i++)
137
    input.stepDown();
138
shouldBe('input.value', '"0"');
139
140
var successfullyParsed = true;
- a/LayoutTests/fast/forms/script-tests/input-step-range.js +142 lines
Line 0 a/LayoutTests/fast/forms/script-tests/input-step-range.js_sec1
1
description('Tests stepDown()/stepUp() for type=range.');
2
3
var input = document.createElement('input');
4
input.type = 'range';
5
var invalidStateErr = '"Error: INVALID_STATE_ERR: DOM Exception 11"';
6
7
// The value is unparsable.
8
input.value = '';
9
shouldThrow('input.stepDown()', invalidStateErr);
10
shouldThrow('input.stepUp()', invalidStateErr);
11
12
// Non-number argument
13
input.value = '0';
14
input.stepDown("foo");
15
shouldBe('input.value', '"0"');
16
input.stepUp("foo");
17
shouldBe('input.value', '"0"');
18
19
// Default step value for type=range is 1.
20
input.value = '0';
21
input.min = '-100';
22
input.stepUp();
23
shouldBe('input.value', '"1"');
24
input.stepUp(2);
25
shouldBe('input.value', '"3"');
26
input.stepUp(-1);
27
shouldBe('input.value', '"2"');
28
input.stepDown();
29
shouldBe('input.value', '"1"');
30
input.stepDown(2);
31
shouldBe('input.value', '"-1"');
32
input.stepDown(-1);
33
shouldBe('input.value', '"0"');
34
// The default value is used for invalid step values.
35
input.value = '0';
36
input.step = 'foo';
37
input.stepUp();
38
shouldBe('input.value', '"1"');
39
input.step = '0';
40
input.stepUp();
41
shouldBe('input.value', '"2"');
42
input.step = '-1';
43
input.stepUp();
44
shouldBe('input.value', '"3"');
45
46
// No step value
47
input.value = '0';
48
input.step = 'any';
49
shouldThrow('input.stepDown()', invalidStateErr);
50
shouldThrow('input.stepUp()', invalidStateErr);
51
52
// Minimum limit
53
input.min = '0';
54
input.step = '1';
55
input.value = '1';
56
input.stepDown();
57
shouldBe('input.value', '"0"');
58
shouldThrow('input.stepDown()', invalidStateErr);
59
input.value = '1';
60
shouldThrow('input.stepDown(2)', invalidStateErr);
61
shouldBe('input.value', '"1"');
62
// Should not be -Infinity.
63
input.value = '1';
64
input.min = '';
65
input.step = '1.7976931348623156e+308';
66
shouldThrow('input.stepDown(2)', invalidStateErr);
67
68
// Maximum limit
69
input.value = '-1';
70
input.min = '';
71
input.max = '0';
72
input.step = '1';
73
input.stepUp();
74
shouldBe('input.value', '"0"');
75
shouldThrow('input.stepUp()', invalidStateErr);
76
input.value = '-1';
77
shouldThrow('input.stepUp(2)', invalidStateErr);
78
shouldBe('input.value', '"-1"');
79
// Should not be Infinity.
80
input.value = '1';
81
input.max = '';
82
input.step = '1.7976931348623156e+308';
83
shouldThrow('input.stepUp(2)', invalidStateErr);
84
85
// stepDown()/stepUp() for stepMismatch values
86
input.value = '0';
87
input.min = '-1';
88
input.step = '2';
89
input.stepUp();
90
shouldBe('input.value', '"3"');
91
input.stepDown();
92
shouldBe('input.value', '"1"');
93
input.value = '9';
94
input.min = '0';
95
input.max = '';
96
input.step = '10';
97
input.stepUp(9);
98
shouldBe('input.value', '"100"');
99
input.value = '19';
100
input.stepDown();
101
shouldBe('input.value', '"10"');
102
// value + step is <= max, but rounded result would be > max.
103
input.value = '89';
104
input.max = '99';
105
input.stepUp();
106
shouldBe('input.value', '"90"');
107
108
// Huge value and small step
109
input.value = '1e+308';
110
input.min = '0';
111
input.max = '1.1e+308';
112
input.step = '1';
113
input.stepUp(999999);
114
shouldBe('input.value', '"1e+308"');
115
input.stepDown(999999);
116
shouldBe('input.value', '"1e+308"');
117
118
// Fractional numbers
119
input.value = '0';
120
input.min = '';
121
input.max = '';
122
input.step = '0.33333333333333333';
123
input.stepUp(3);
124
shouldBe('input.value', '"1"');
125
input.step = '0.1';
126
input.stepUp(10);
127
shouldBe('input.value', '"2"');
128
for (var i = 0; i < 10; i++)
129
    input.stepUp();
130
shouldBe('input.value', '"3"');
131
132
input.value = '0';
133
input.min = '0';
134
input.max = '1';
135
input.step = '0.003921568627450980';
136
input.stepUp(255);
137
shouldBe('input.value', '"1"');
138
for (var i = 0; i < 255; i++)
139
    input.stepDown();
140
shouldBe('input.value', '"0"');
141
142
var successfullyParsed = true;
- a/LayoutTests/fast/forms/script-tests/input-step-unsupported.js +12 lines
Line 0 a/LayoutTests/fast/forms/script-tests/input-step-unsupported.js_sec1
1
description('Tests stepDown()/stepUp() for unsuppoted typpes');
2
3
var input = document.createElement('input');
4
input.type = 'text';
5
input.step = '3';
6
input.value = '2';
7
shouldThrow('input.stepDown()', '"Error: INVALID_STATE_ERR: DOM Exception 11"');
8
shouldThrow('input.stepDown(0)', '"Error: INVALID_STATE_ERR: DOM Exception 11"');
9
shouldThrow('input.stepUp()', '"Error: INVALID_STATE_ERR: DOM Exception 11"');
10
shouldThrow('input.stepUp(0)', '"Error: INVALID_STATE_ERR: DOM Exception 11"');
11
12
var successfullyParsed = true;
- a/WebCore/ChangeLog +19 lines
Lines 1-3 a/WebCore/ChangeLog_sec1
1
2009-10-30  Kent Tamura  <tkent@chromium.org>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        Add support for HTMLInputElement::stepUp() and stepDown().
6
        https://bugs.webkit.org/show_bug.cgi?id=27451
7
8
        Tests: fast/forms/input-step-number.html
9
               fast/forms/input-step-range.html
10
               fast/forms/input-step-unsupported.html
11
12
        * html/HTMLInputElement.cpp:
13
        (WebCore::HTMLInputElement::addForNumber):
14
        (WebCore::HTMLInputElement::stepUp):
15
        (WebCore::HTMLInputElement::stepDown):
16
        (WebCore::HTMLInputElement::doubleToFormString):
17
        * html/HTMLInputElement.h:
18
        * html/HTMLInputElement.idl:
19
1
2009-10-28  Kent Tamura  <tkent@chromium.org>
20
2009-10-28  Kent Tamura  <tkent@chromium.org>
2
21
3
        Reviewed by NOBODY (OOPS!).
22
        Reviewed by NOBODY (OOPS!).
- a/WebCore/html/HTMLInputElement.cpp +82 lines
Lines 62-68 a/WebCore/html/HTMLInputElement.cpp_sec1
62
#include "TextEvent.h"
62
#include "TextEvent.h"
63
#include <wtf/MathExtras.h>
63
#include <wtf/MathExtras.h>
64
#include <wtf/StdLibExtras.h>
64
#include <wtf/StdLibExtras.h>
65
#include <wtf/dtoa.h>
65
66
67
using namespace WTF;
66
using namespace std;
68
using namespace std;
67
69
68
namespace WebCore {
70
namespace WebCore {
Lines 362-367 bool HTMLInputElement::allowedValueStep(double* step) const a/WebCore/html/HTMLInputElement.cpp_sec2
362
    return true;
364
    return true;
363
}
365
}
364
366
367
void HTMLInputElement::addForNumber(double step, double count, ExceptionCode& ec)
368
{
369
    ASSERT(inputType() == NUMBER || inputType() == RANGE);
370
    ASSERT(step > 0);
371
    double current = 0.0;
372
    if (!formStringToDouble(value(), &current)) {
373
        ec = INVALID_STATE_ERR;
374
        return;
375
    }
376
    double newValue = current + step * count;
377
    if (isinf(newValue)) {
378
        ec = INVALID_STATE_ERR;
379
        return;
380
    }
381
    if (inputType() == NUMBER) {
382
        double minimum = 0.0;
383
        if (formStringToDouble(getAttribute(minAttr), &minimum)) {
384
            if (newValue < minimum) {
385
                ec = INVALID_STATE_ERR;
386
                return;
387
            }
388
        }
389
        double n = round((newValue - minimum) / step);
390
        newValue = minimum + n * step;
391
        double maximum = 0.0;
392
        if (formStringToDouble(getAttribute(maxAttr), &maximum)) {
393
            if (newValue > maximum) {
394
                ec = INVALID_STATE_ERR;
395
                return;
396
            }
397
        }
398
    } else {  // inputType() == RANGE
399
        double minimum = rangeMinimum();
400
        double maximum = rangeMaximum();
401
        if (newValue < minimum || newValue > maximum) {
402
            ec = INVALID_STATE_ERR;
403
            return;
404
        }
405
        double n = round((newValue - minimum) / step);
406
        newValue = minimum + n * step;
407
        if (newValue > maximum)
408
            newValue = minimum + (n - 1) * step;
409
        ASSERT(newValue >= minimum);
410
        ASSERT(newValue <= maximum);
411
    }
412
    setValue(formStringFromDouble(newValue));
413
}
414
415
void HTMLInputElement::stepUp(int n, ExceptionCode& ec)
416
{
417
    double step = 0.0;
418
    if (!allowedValueStep(&step)) {
419
        ec = INVALID_STATE_ERR;
420
        return;
421
    }
422
    // Types other than NUMBER/RANGE should be rejected by allowedValueStep().
423
    ASSERT(inputType() == NUMBER || inputType() == RANGE);
424
    addForNumber(step, n, ec);
425
}
426
427
void HTMLInputElement::stepDown(int n, ExceptionCode& ec)
428
{
429
    double step = 0.0;
430
    if (!allowedValueStep(&step)) {
431
        ec = INVALID_STATE_ERR;
432
        return;
433
    }
434
    // Types other than NUMBER/RANGE should be rejected by allowedValueStep().
435
    ASSERT(inputType() == NUMBER || inputType() == RANGE);
436
    addForNumber(step, -n, ec);
437
}
438
365
static inline CheckedRadioButtons& checkedRadioButtons(const HTMLInputElement *element)
439
static inline CheckedRadioButtons& checkedRadioButtons(const HTMLInputElement *element)
366
{
440
{
367
    if (HTMLFormElement* form = element->form())
441
    if (HTMLFormElement* form = element->form())
Lines 1912-1917 bool HTMLInputElement::willValidate() const a/WebCore/html/HTMLInputElement.cpp_sec3
1912
           inputType() != BUTTON && inputType() != RESET;
1986
           inputType() != BUTTON && inputType() != RESET;
1913
}
1987
}
1914
1988
1989
String HTMLInputElement::formStringFromDouble(double num)
1990
{
1991
    // According to HTML5, "the best representation of the number n as a floating
1992
    // point number" is a string produced by applying ToString() to n.
1993
    Vector<UChar> uchars = ecma262dtoa(num);
1994
    return String(uchars.data(), uchars.size());
1995
}
1996
1915
bool HTMLInputElement::formStringToDouble(const String& src, double* out)
1997
bool HTMLInputElement::formStringToDouble(const String& src, double* out)
1916
{
1998
{
1917
    // See HTML5 2.4.4.3 `Real numbers.'
1999
    // See HTML5 2.4.4.3 `Real numbers.'
- a/WebCore/html/HTMLInputElement.h +11 lines
Lines 106-111 public: a/WebCore/html/HTMLInputElement.h_sec1
106
    bool allowedValueStep(double*) const;
106
    bool allowedValueStep(double*) const;
107
    // For ValidityState.
107
    // For ValidityState.
108
    bool stepMismatch() const;
108
    bool stepMismatch() const;
109
    // Implementations of HTMLInputElement::stepUp() and stepDown().
110
    void stepUp(int, ExceptionCode&);
111
    void stepDown(int, ExceptionCode&);
112
    void stepUp(ExceptionCode& ec) { stepUp(1, ec); }
113
    void stepDown(ExceptionCode& ec) { stepDown(1, ec); }
109
114
110
    bool isTextButton() const { return m_type == SUBMIT || m_type == RESET || m_type == BUTTON; }
115
    bool isTextButton() const { return m_type == SUBMIT || m_type == RESET || m_type == BUTTON; }
111
    virtual bool isRadioButton() const { return m_type == RADIO; }
116
    virtual bool isRadioButton() const { return m_type == RADIO; }
Lines 262-267 private: a/WebCore/html/HTMLInputElement.h_sec2
262
267
263
    PassRefPtr<HTMLFormElement> createTemporaryFormForIsIndex();
268
    PassRefPtr<HTMLFormElement> createTemporaryFormForIsIndex();
264
269
270
    // Helper for stepUp()/stepDown().  Adds step * count to the current number value.
271
    void addForNumber(double step, double count, ExceptionCode&);
272
    // Converts the specified number to a string.  This is an implementation of
273
    // HTML5's "algorithm to convert a number to a string" for NUMBER/RANGE types.
274
    static String formStringFromDouble(double);
275
265
#if ENABLE(DATALIST)
276
#if ENABLE(DATALIST)
266
    HTMLDataListElement* dataList() const;
277
    HTMLDataListElement* dataList() const;
267
#endif
278
#endif
- a/WebCore/html/HTMLInputElement.idl -1 / +5 lines
Lines 71-76 module html { a/WebCore/html/HTMLInputElement.idl_sec1
71
        readonly attribute HTMLOptionElement selectedOption;
71
        readonly attribute HTMLOptionElement selectedOption;
72
#endif
72
#endif
73
73
74
        void               stepUp(in [Optional] long n)
75
            raises(DOMException);
76
        void               stepDown(in [Optional] long n)
77
            raises(DOMException);
78
74
        readonly attribute boolean         willValidate;
79
        readonly attribute boolean         willValidate;
75
        boolean            checkValidity();
80
        boolean            checkValidity();
76
        void               setCustomValidity(in [ConvertUndefinedOrNullToNullString] DOMString error);
81
        void               setCustomValidity(in [ConvertUndefinedOrNullToNullString] DOMString error);
77
- 

Return to Bug 27451