1 Test for size attribute of input
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 PASS spinButtonWidth is >= 1
7 The content area of the number input without min/max/step attribute should have the same width as text input
8 PASS number.offsetWidth is text.offsetWidth
10 The number whose width is specified should respect the setting
11 PASS numberWithWidth.offsetWidth is 100
12 PASS numberWithWidth.min = 0; numberWithWidth.max = 100; numberWithWidth.offsetWidth is 100
14 The number input should ignore size attribute for layout
15 PASS number.size = 10; number.offsetWidth is text.offsetWidth
16 PASS number.size is 10
17 PASS number.size = 100; number.offsetWidth is text.offsetWidth
18 PASS number.size is 100
19 PASS number.size = null threw exception IndexSizeError: Failed to set the 'size' property on 'HTMLInputElement': The value provided is 0, which is an invalid size..
21 If min or max is absent, the number input has the same width as input[type=text]
22 PASS numberWidth(0, null, null) is text.offsetWidth
23 PASS numberWidth(null, 100, null) is text.offsetWidth
24 PASS numberWidth(null, null, 100) is text.offsetWidth
26 If step is any, the input[type=text] has the same width as input[type=text]
27 PASS numberWidth(0, 1, "any") is text.offsetWidth
28 PASS numberWidth(0, 10, "any") is text.offsetWidth
29 PASS numberWidth(0, 1.1, "any") is text.offsetWidth
31 The case the inner spin button has border or padding.
32 PASS numberWidth(0, 10, 1, "with-border") is textWidthPlusSpinButtonWidth(2) + borderWidth
33 PASS numberWidth(0, 10, 1, "with-padding") is textWidthPlusSpinButtonWidth(2) + paddingWidth
34 PASS numberWidth(0, 10, 1, "with-margin") is textWidthPlusSpinButtonWidth(2)
35 PASS numberWidth(0, 10, 1, "with-border with-padding") is textWidthPlusSpinButtonWidth(2) + borderWidth + paddingWidth
37 The default step does not need to be considered.
38 PASS numberWidth(0, 1, null) is textWidthPlusSpinButtonWidth(1)
39 PASS numberWidth(0, 100, null) is textWidthPlusSpinButtonWidth(3)
40 PASS numberWidth(-100, 1, null) is textWidthPlusSpinButtonWidth(4)
41 PASS numberWidth(0.0, 1.0, null) is textWidthPlusSpinButtonWidth(1)
42 PASS numberWidth(0.5, 1.5, null) is textWidthPlusSpinButtonWidth(3)
43 PASS numberWidth(-0.5, 1.5, null) is textWidthPlusSpinButtonWidth(4)
44 PASS numberWidth(1e+10, 1e+10 + 1, null) is textWidthPlusSpinButtonWidth(11)
45 PASS numberWidth(-1e+10, 1e+10 + 1, null) is textWidthPlusSpinButtonWidth(12)
47 Check the width of a number input when min/max/step is changed variously
48 PASS numberWidth(0, 1, 1) is textWidthPlusSpinButtonWidth(1)
49 PASS numberWidth(0, 10, 1) is textWidthPlusSpinButtonWidth(2)
50 PASS numberWidth(0, 100, 1) is textWidthPlusSpinButtonWidth(3)
51 PASS numberWidth(0, 1000, 1) is textWidthPlusSpinButtonWidth(4)
52 PASS numberWidth(0, 10000, 1) is textWidthPlusSpinButtonWidth(5)
53 PASS numberWidth(0, 100000, 1) is textWidthPlusSpinButtonWidth(6)
54 PASS numberWidth(0, 1000000, 1) is textWidthPlusSpinButtonWidth(7)
55 PASS numberWidth(0, 10000000, 1) is textWidthPlusSpinButtonWidth(8)
56 PASS numberWidth(0, 100000000, 1) is textWidthPlusSpinButtonWidth(9)
57 PASS numberWidth(0, 1000000000, 1) is textWidthPlusSpinButtonWidth(10)
58 PASS numberWidth(-1, 0, 1) is textWidthPlusSpinButtonWidth(2)
59 PASS numberWidth(-10, 0, 1) is textWidthPlusSpinButtonWidth(3)
60 PASS numberWidth(-100, 0, 1) is textWidthPlusSpinButtonWidth(4)
61 PASS numberWidth(-1000, 0, 1) is textWidthPlusSpinButtonWidth(5)
62 PASS numberWidth(-10000, 0, 1) is textWidthPlusSpinButtonWidth(6)
63 PASS numberWidth(-100000, 0, 1) is textWidthPlusSpinButtonWidth(7)
64 PASS numberWidth(-1000000, 0, 1) is textWidthPlusSpinButtonWidth(8)
65 PASS numberWidth(-10000000, 0, 1) is textWidthPlusSpinButtonWidth(9)
66 PASS numberWidth(-100000000, 0, 1) is textWidthPlusSpinButtonWidth(10)
67 PASS numberWidth(-1000000000, 0, 1) is textWidthPlusSpinButtonWidth(11)
68 PASS numberWidth(0, 1, 0.5) is textWidthPlusSpinButtonWidth(3)
69 PASS numberWidth(0, 1, 0.05) is textWidthPlusSpinButtonWidth(4)
70 PASS numberWidth(0, 1, 0.005) is textWidthPlusSpinButtonWidth(5)
71 PASS numberWidth(0, 1, 0.0005) is textWidthPlusSpinButtonWidth(6)
72 PASS numberWidth(0, 1, 0.00005) is textWidthPlusSpinButtonWidth(7)
73 PASS numberWidth(0, 1, 0.000005) is textWidthPlusSpinButtonWidth(8)
74 PASS numberWidth(0, 1, 0.0000005) is textWidthPlusSpinButtonWidth(9)
75 PASS numberWidth(0.5, 1, 1) is textWidthPlusSpinButtonWidth(3)
76 PASS numberWidth(0.05, 1, 1) is textWidthPlusSpinButtonWidth(4)
77 PASS numberWidth(0.005, 1, 1) is textWidthPlusSpinButtonWidth(5)
78 PASS numberWidth(1.5, 2, 1) is textWidthPlusSpinButtonWidth(3)
79 PASS numberWidth(1.05, 2, 1) is textWidthPlusSpinButtonWidth(4)
80 PASS numberWidth(1.005, 2, 1) is textWidthPlusSpinButtonWidth(5)
81 PASS numberWidth(123456, 123456, 0.0000005) is textWidthPlusSpinButtonWidth(14)
83 PASS successfullyParsed is true