| <head> |
| <script src="../../resources/js-test-pre.js"></script> |
| <script> |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| |
| |
| </script> |
| </head> |
| <body style="text-decoration: underline; border-top-color: green"> |
| <div id="description">This test makes sure that CSSStyleDeclaration enumerates JavaScript properties for defined and non-defined CSS properties, indexed properties, and properties defined on the prototype. See <a href="https://bugs.webkit.org/show_bug.cgi?id=23946">Bug 23946</a>.</div> |
| <div id="console"></div> |
| <script> |
| shouldBe("document.body.style.length", "2"); |
| shouldBeTrue("'0' in document.body.style"); |
| shouldBeTrue("'1' in document.body.style"); |
| shouldBeTrue("'textDecoration' in document.body.style"); |
| shouldBeTrue("'borderTopColor' in document.body.style"); |
| shouldBeTrue("'border' in document.body.style"); |
| shouldBeTrue("'font' in document.body.style"); |
| shouldBeTrue("'webkitTransform' in document.body.style"); |
| shouldBeTrue("'WebkitTransform' in document.body.style"); |
| shouldBeFalse("'bogus-random-String' in document.body.style"); |
| shouldBeTrue("'cssText' in document.body.style"); |
| shouldBeTrue("'getPropertyCSSValue' in document.body.style"); |
| |
| // Test CSS property order. |
| var started; |
| var cssPropertyCount = 0; |
| var previous; |
| var seenFilter; |
| for (var p in document.body.style) { |
| if (p === "alignmentBaseline") |
| started = true; |
| if (!started) |
| continue; |
| if (p === "filter") |
| seenFilter = true; |
| if (previous && previous >= p) { |
| testFailed("Invalid CSS-mapped property order: '" + p + "' after '" + previous + "'"); |
| break; |
| } |
| if (++cssPropertyCount <= 400) |
| previous = p; |
| else { |
| if (seenFilter) |
| testPassed("The CSS property order is correct"); |
| else |
| testFailed("The 'filter' property was not enumerated"); |
| break; |
| } |
| } |
| </script> |
| <script src="../../resources/js-test-post.js"></script> |
| </body> |