Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/xslt/tests/mochitest/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 2 kB image not shown  

Quellcode-Bibliothek test_bug1769155.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/dom/xslt/tests/mochitest/test_bug1769155.html


<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <title>XSLT error results shouldn't replace documents loaded during the transform
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
  <script>
    SimpleTest.waitForExplicitFinish();

    async function runTest() {
      const crossOriginLocation = "https://example.org/tests/dom/xslt/tests/mochitest/file_bug1769155.html";
      const sjs = new URL("bug1769155.sjs", location.href);
      // During the XSLT processing we redirect by setting location and then
      // spin the event loop using synchronous XHR, so that the location change
      // happens while we're still processing the XSLT.
      let xml = `
        <?xml-stylesheet type="application/xml" href="#sheet"?>
        <stylesheet id="sheet" version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform">
          <template match="/">
            <script xmlns="http://www.w3.org/1999/xhtml">
              location = "${crossOriginLocation}";
              let xhr = new XMLHttpRequest();
              xhr.open("GET""${sjs.href}", false);
              xhr.send();
            <\/script>
          </template>
        </stylesheet>`;

      let win = window.open();

      let redirected = new Promise((resolve) => {
        addEventListener("message", resolve, { once: true });
      });

      SpecialPowers.spawn(win, [xml], value => {
        content.location = URL.createObjectURL(new Blob([ value ], { type: "application/xml" }));
      });
      await redirected;

      // At this point the setting of window.location should have redirected us to
      // a cross-origin site.
      let threw = false;
      try {
        win.document;
      } catch {
        threw = true;
      }
      ok(threw, "Accessing a property on a cross-origin window should fail.");

      win.close();

      SimpleTest.finish();
    }
  </script>
</head>
<body onload="runTest();">
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test"></pre>
</body>
</html>

Messung V0.5
C=97 H=100 G=98

¤ Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.0.26Bemerkung:  (vorverarbeitet)  ¤

*Bot Zugriff






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.