Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/xhr/tests/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 33 B image not shown  

Quelle  test_isinheritableproperty.html  Sprache: unbekannt

 
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=699592
-->

<head>
  <title>Test for InspectorUtils::isInheritedProperty</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  <style>
    @property --css-registered-inherits {
      syntax: "*";
      inherits: true;
    }
    @property --css-registered-no-inherits {
      syntax: "*";
      inherits: false;
    }
  </style>
  <script>
    CSS.registerProperty({
      name: "--js-registered-inherits",
      syntax: "*",
      inherits: true,
    });
    CSS.registerProperty({
      name: "--js-registered-no-inherits",
      syntax: "*",
      inherits: false,
    });
  </script>
</head>
<body>
<pre id="test">
<script type="application/javascript">

function do_test() {
  const isInherited = (name) =>
    SpecialPowers.InspectorUtils.isInheritedProperty(document, name);

  is(isInherited("font-size"), true, "font-size is inherited.");
  is(isInherited("min-width"), false, "min-width is not inherited.");

  is(isInherited("font"), true, "shorthand font property is inherited.");

  is(isInherited("border"), false, "shorthand border property not inherited.");
  is(isInherited("garbage"), false, "Unknown property isn't inherited.");

  info("Checking isInheritedProperty result on custom properties");
  is(isInherited("--unregistered-var"),true,
    "Unregistered custom property is inherited."
  );
  is(
    isInherited("--css-registered-inherits"),
    true,
    "Returns true for @property that inherits"
  );
  is(
    isInherited("--css-registered-no-inherits"),
    false,
    "Returns false for @property that does not inherits"
  );
  is(
    isInherited("--js-registered-inherits"),
    true,
    "Returns true for property registered in JS that inherits"
  );
  is(
    isInherited("--js-registered-no-inherits"),
    false,
    "Returns false for property registered in JS that does not inherits"
  );

  SimpleTest.finish();
}

SimpleTest.waitForExplicitFinish();
addLoadEvent(do_test);


</script>
</pre>
</body>
</html>

Messung V0.5 in Prozent
C=100 H=100 G=100

[Dauer der Verarbeitung: 0.13 Sekunden, vorverarbeitet 2026-09-27]