OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../resources/js-test.js"></script> | 3 <script src="../../resources/js-test.js"></script> |
4 <style id="style" media="screen"> | 4 <style id="style" media="screen"> |
5 .non-existent-class { | 5 .non-existent-class { |
6 color: rgb(0, 0, 0); | 6 color: rgb(0, 0, 0); |
7 } | 7 } |
8 </style> | 8 </style> |
9 </head> | 9 </head> |
10 <body> | 10 <body> |
(...skipping 25 matching lines...) Expand all Loading... |
36 return classString(document.createElement(tagName).constructor); | 36 return classString(document.createElement(tagName).constructor); |
37 } | 37 } |
38 | 38 |
39 function tagConstructorName(tagName) | 39 function tagConstructorName(tagName) |
40 { | 40 { |
41 return document.createElement(tagName).constructor.name; | 41 return document.createElement(tagName).constructor.name; |
42 } | 42 } |
43 | 43 |
44 function testTag(tagName, className, prototypeName, constructorName) | 44 function testTag(tagName, className, prototypeName, constructorName) |
45 { | 45 { |
| 46 // TODO(jsbell): Willful violation: https://www.w3.org/Bugs/Public/show_bug.
cgi?id=28244 |
46 if (!prototypeName) | 47 if (!prototypeName) |
47 prototypeName = className + "Prototype"; | 48 prototypeName = className; |
48 if (!constructorName) | 49 if (!constructorName) |
49 constructorName = className; | 50 constructorName = className; |
50 shouldBeEqualToString("tagClassString('" + tagName + "')", className); | 51 shouldBeEqualToString("tagClassString('" + tagName + "')", className); |
51 shouldBeEqualToString("tagPrototypeClassString('" + tagName + "')", prototyp
eName); | 52 shouldBeEqualToString("tagPrototypeClassString('" + tagName + "')", prototyp
eName); |
52 shouldBeEqualToString("tagConstructorClassString('" + tagName + "')", "Funct
ion"); | 53 shouldBeEqualToString("tagConstructorClassString('" + tagName + "')", "Funct
ion"); |
53 shouldBeEqualToString("tagConstructorName('" + tagName + "')", constructorNa
me); | 54 shouldBeEqualToString("tagConstructorName('" + tagName + "')", constructorNa
me); |
54 } | 55 } |
55 | 56 |
56 function test(expression, className, prototypeName, constructorName) | 57 function test(expression, className, prototypeName, constructorName) |
57 { | 58 { |
| 59 // TODO(jsbell): Willful violation: https://www.w3.org/Bugs/Public/show_bug.
cgi?id=28244 |
58 if (!prototypeName) | 60 if (!prototypeName) |
59 prototypeName = className + "Prototype"; | 61 prototypeName = className; |
60 if (!constructorName) | 62 if (!constructorName) |
61 constructorName = className; | 63 constructorName = className; |
62 shouldBeEqualToString("classString(" + expression + ")", className); | 64 shouldBeEqualToString("classString(" + expression + ")", className); |
63 shouldBeEqualToString("classString(" + expression + ".__proto__)", prototype
Name); | 65 shouldBeEqualToString("classString(" + expression + ".__proto__)", prototype
Name); |
64 shouldBeEqualToString("classString(" + expression + ".constructor)", "Functi
on"); | 66 shouldBeEqualToString("classString(" + expression + ".constructor)", "Functi
on"); |
65 shouldBeEqualToString(expression + ".constructor.name", constructorName); | 67 shouldBeEqualToString(expression + ".constructor.name", constructorName); |
66 } | 68 } |
67 | 69 |
68 function runTest() | 70 function runTest() |
69 { | 71 { |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 | 288 |
287 function frameLoaded() | 289 function frameLoaded() |
288 { | 290 { |
289 runTest(); | 291 runTest(); |
290 } | 292 } |
291 | 293 |
292 </script> | 294 </script> |
293 <iframe id="xmlframe" onload="frameLoaded()" style="height:0px" src="data:applic
ation/xhtml+xml,<?xml version='1.0' encoding='UTF-8'?><body/>"></iframe> | 295 <iframe id="xmlframe" onload="frameLoaded()" style="height:0px" src="data:applic
ation/xhtml+xml,<?xml version='1.0' encoding='UTF-8'?><body/>"></iframe> |
294 </body> | 296 </body> |
295 </html> | 297 </html> |
OLD | NEW |