OLD | NEW |
1 // http://whatwg.org/html#reflecting-content-attributes-in-idl-attributes | 1 // http://whatwg.org/html#reflecting-content-attributes-in-idl-attributes |
2 // http://whatwg.org/html#rules-for-parsing-non-negative-integers | 2 // http://whatwg.org/html#rules-for-parsing-non-negative-integers |
3 function testUnsignedLong(interface, createElement, attribute) | 3 function testUnsignedLong(interface, createElement, attribute) |
4 { | 4 { |
5 test(function() | 5 test(function() |
6 { | 6 { |
7 var element = createElement(); | 7 var element = createElement(); |
8 | 8 |
9 assert_equals(element[attribute], 0); | 9 assert_equals(element[attribute], 0); |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 assert_false(element.hasAttribute(attribute)); | 32 assert_false(element.hasAttribute(attribute)); |
33 | 33 |
34 function t(input, output) | 34 function t(input, output) |
35 { | 35 { |
36 element[attribute] = input; | 36 element[attribute] = input; |
37 assert_equals(element.getAttribute(attribute), output); | 37 assert_equals(element.getAttribute(attribute), output); |
38 } | 38 } |
39 | 39 |
40 t(0, "0"); | 40 t(0, "0"); |
41 t(2147483647, "2147483647"); | 41 t(2147483647, "2147483647"); |
42 // per spec: | 42 t(2147483648, "0"); |
43 //t(2147483648, "0"); | 43 t(2147483700, "0"); |
44 //t(-1, "0"); | 44 t(-1, "0"); |
45 // per implementation <http://crbug.com/316122>: | 45 t(-3, "0"); |
46 t(2147483648, "2147483648"); | |
47 t(-1, "4294967295"); | |
48 }, "set " + interface + "." + attribute); | 46 }, "set " + interface + "." + attribute); |
49 } | 47 } |
OLD | NEW |