tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_bug455629.html (1560B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=455629
      5 -->
      6 <head>
      7  <title>Test for Bug 455629</title>
      8  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      9  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     10 </head>
     11 <body>
     12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=455629">Mozilla Bug 455629</a>
     13 <p id="display"></p>
     14 <div id="content" style="display: none">
     15  
     16 </div>
     17 <pre id="test">
     18 <script type="application/javascript">
     19 /** Test for Bug 455629 */
     20 SimpleTest.waitForExplicitFinish();
     21 
     22 var done = 0;
     23 function doTest(name) {
     24    var elem = $(name);
     25    var doc = elem.getSVGDocument();
     26    try {
     27        doc.foopy = 42;
     28        fail("Able to set cross origin property!");
     29    } catch (e) {
     30        ok(true, "unable to set non-allAccess property cross origin");
     31    }
     32 
     33    if (elem instanceof HTMLObjectElement) {
     34        doc = elem.contentDocument;
     35        try {
     36            doc.foopy = 42;
     37            fail("Able to set cross origin property!");
     38        } catch (e) {
     39            ok(true, "unable to set non-allAccess property cross origin");
     40        }
     41    }
     42 
     43    if (++done == 2) {
     44        SimpleTest.finish();
     45    }
     46 }
     47 </script>
     48 
     49 <object id="obj"
     50        type="image/svg+xml"
     51        onload="doTest('obj')"
     52        data="http://example.org/tests/dom/base/test/bug455629-helper.svg">
     53 </object>
     54 
     55 <embed id="emb"
     56       type="image/svg+xml"
     57       onload="doTest('emb')"
     58       src="http://example.org/tests/dom/base/test/bug455629-helper.svg">
     59 </embed>
     60 
     61 </pre>
     62 </body>
     63 </html>