dom/tests/mochitest/general/file_moving_nodeList.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <html>
     2     <head>
     3         <script>
     4             document.childNodes.expando = "foo";
     6             function getNodeList() {
     7                 return document.childNodes;
     8             }
     9             function getOptions() {
    10                 return document.createElement("select").options;
    11             }
    13             function tryToUseNodeList(nodeList, ok) {
    14                 function expectException(op, reason) {
    15                     try {
    16                         var result = op();
    17                         ok(false, "should have thrown an exception, got: " + result);
    18                     } catch (e) {
    19                         ok(/Permission denied/.test(e.toString()), reason);
    20                     }
    21                 }
    23                 expectException(function() { nodeList.length = 2; }, "should not be able to set attributes");
    24                 expectException(function() { nodeList.item(0); }, "should not have access to any functions");
    25                 expectException(function() { nodeList.foo = "foo"; }, "should not be able to add expandos");
    26             }
    27         </script>
    28     </head>
    29     <body>
    30     </body>
    31 </html>

mercurial