content/base/test/test_base.xhtml

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.

michael@0 1 <html xmlns="http://www.w3.org/1999/xhtml">
michael@0 2 <head>
michael@0 3 <title>Test for base URIs</title>
michael@0 4 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 5 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
michael@0 6 <base href="/tests/content/base/" />
michael@0 7 <style>
michael@0 8 #bound { -moz-binding: url("test/file_base_xbl.xml#test"); }
michael@0 9 </style>
michael@0 10 </head>
michael@0 11 <body>
michael@0 12 <div id="1" xml:base="supercalifragilisticexpialidocious"><p><p xml:base="hello/"><p xml:base="world"><span xml:base="#iamtheverymodelofamodernmajorgeneral">text</span></p></p></p></div>
michael@0 13 <div id="bound"/>
michael@0 14 <pre id="test">
michael@0 15 <script type="application/javascript">
michael@0 16 SimpleTest.waitForExplicitFinish();
michael@0 17 addLoadEvent(function() {
michael@0 18 is(document.baseURI, "http://mochi.test:8888/tests/content/base/",
michael@0 19 "document base");
michael@0 20 is(document.body.baseURI, "http://mochi.test:8888/tests/content/base/",
michael@0 21 "body base");
michael@0 22
michael@0 23 var expected =
michael@0 24 ["http://mochi.test:8888/tests/content/base/supercalifragilisticexpialidocious",
michael@0 25 "http://mochi.test:8888/tests/content/base/supercalifragilisticexpialidocious",
michael@0 26 "http://mochi.test:8888/tests/content/base/hello/",
michael@0 27 "http://mochi.test:8888/tests/content/base/hello/world",
michael@0 28 "http://mochi.test:8888/tests/content/base/hello/world#iamtheverymodelofamodernmajorgeneral",
michael@0 29 "http://mochi.test:8888/tests/content/base/hello/world#iamtheverymodelofamodernmajorgeneral",
michael@0 30 ];
michael@0 31 var node = document.getElementById("1");
michael@0 32 while(node) {
michael@0 33 is(node.baseURI, expected.shift(), "node base");
michael@0 34 node = node.firstChild;
michael@0 35 }
michael@0 36 is(expected.length, 0, "found all expected nodes");
michael@0 37
michael@0 38 var svgExpected =
michael@0 39 ["http://mochi.test:8888/tests/content/base/test/file_base_xbl.xml",
michael@0 40 "http://mochi.test:8888/tests/content/base/test/file_base_xbl.xml",
michael@0 41 "http://mochi.test:8888/tests/content/base/test/file_base_xbl.xml#shesellsseashellsbytheseashore",
michael@0 42 ];
michael@0 43 node = SpecialPowers.wrap(document).getAnonymousNodes(document.getElementById("bound"))[0];
michael@0 44 while(node) {
michael@0 45 is(node.baseURI, svgExpected.shift(), "node base");
michael@0 46 node = node.firstChild;
michael@0 47 }
michael@0 48 is(svgExpected.length, 0, "found all expected nodes");
michael@0 49
michael@0 50 SimpleTest.finish();
michael@0 51 });
michael@0 52 </script>
michael@0 53 </pre>
michael@0 54 </body>
michael@0 55 </html>

mercurial