4 https://bugzilla.mozilla.org/show_bug.cgi?id=699592
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"/>
11 @property --css-registered-inherits {
15 @property --css-registered-no-inherits {
21 CSS
.registerProperty({
22 name
: "--js-registered-inherits",
26 CSS
.registerProperty({
27 name
: "--js-registered-no-inherits",
35 <script type=
"application/javascript">
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."
54 isInherited(
"--css-registered-inherits"),
56 "Returns true for @property that inherits"
59 isInherited(
"--css-registered-no-inherits"),
61 "Returns false for @property that does not inherits"
64 isInherited(
"--js-registered-inherits"),
66 "Returns true for property registered in JS that inherits"
69 isInherited(
"--js-registered-no-inherits"),
71 "Returns false for property registered in JS that does not inherits"
77 SimpleTest.waitForExplicitFinish();
78 addLoadEvent(do_test);