Backed out 2 changesets (bug 1943998) for causing wd failures @ phases.py CLOSED...
[gecko.git] / layout / inspector / tests / test_isinheritableproperty.html
blob9f9340535cd68600edba1f4865807943368bcd59
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=699592
5 -->
6 <head>
7 <title>Test for InspectorUtils::isInheritedProperty</title>
8 <script src="/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
10 <style>
11 @property --css-registered-inherits {
12 syntax: "*";
13 inherits: true;
15 @property --css-registered-no-inherits {
16 syntax: "*";
17 inherits: false;
19 </style>
20 <script>
21 CSS.registerProperty({
22 name: "--js-registered-inherits",
23 syntax: "*",
24 inherits: true,
25 });
26 CSS.registerProperty({
27 name: "--js-registered-no-inherits",
28 syntax: "*",
29 inherits: false,
30 });
31 </script>
32 </head>
33 <body>
34 <pre id="test">
35 <script type="application/javascript">
37 function do_test() {
38 const isInherited = (name) =>
39 SpecialPowers.InspectorUtils.isInheritedProperty(document, name);
41 is(isInherited("font-size"), true, "font-size is inherited.");
42 is(isInherited("min-width"), false, "min-width is not inherited.");
44 is(isInherited("font"), true, "shorthand font property is inherited.");
46 is(isInherited("border"), false, "shorthand border property not inherited.");
47 is(isInherited("garbage"), false, "Unknown property isn't inherited.");
49 info("Checking isInheritedProperty result on custom properties");
50 is(isInherited("--unregistered-var"),true,
51 "Unregistered custom property is inherited."
53 is(
54 isInherited("--css-registered-inherits"),
55 true,
56 "Returns true for @property that inherits"
58 is(
59 isInherited("--css-registered-no-inherits"),
60 false,
61 "Returns false for @property that does not inherits"
63 is(
64 isInherited("--js-registered-inherits"),
65 true,
66 "Returns true for property registered in JS that inherits"
68 is(
69 isInherited("--js-registered-no-inherits"),
70 false,
71 "Returns false for property registered in JS that does not inherits"
74 SimpleTest.finish();
77 SimpleTest.waitForExplicitFinish();
78 addLoadEvent(do_test);
81 </script>
82 </pre>
83 </body>
84 </html>