content/base/test/test_bug419527.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 <?xml version="1.0"?>
michael@0 2 <html xmlns="http://www.w3.org/1999/xhtml">
michael@0 3 <!--
michael@0 4 https://bugzilla.mozilla.org/show_bug.cgi?id=419527
michael@0 5 -->
michael@0 6 <head>
michael@0 7 <title>Test for Bug 419527</title>
michael@0 8 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
michael@0 10 <bindings xmlns="http://www.mozilla.org/xbl"
michael@0 11 xmlns:html="http://www.w3.org/1999/xhtml">
michael@0 12 <binding id="rangebinding">
michael@0 13 <content><html:span>Foo</html:span>
michael@0 14 </content>
michael@0 15 <implementation>
michael@0 16 <constructor>
michael@0 17 var win = XPCNativeWrapper.unwrap(window);
michael@0 18 var span = document.getAnonymousNodes(this)[0];
michael@0 19 win.ok(span.localName == "span", "Wrong anon node!");
michael@0 20 var range = document.createRange();
michael@0 21 range.selectNode(span.firstChild);
michael@0 22 win.ok(range.startContainer == span, "Wrong start container!");
michael@0 23 win.ok(range.endContainer == span, "Wrong end container!");
michael@0 24 var newSubTree = XPCNativeWrapper(win.newSubTree);
michael@0 25 newSubTree.appendChild(this);
michael@0 26 range.setStart(newSubTree.firstChild, 0);
michael@0 27 win.ok(range.startContainer == newSubTree.firstChild,
michael@0 28 "Range should have been collapsed to newSubTree.firstChild!");
michael@0 29 win.ok(range.endContainer == newSubTree.firstChild,
michael@0 30 "Range should have been collapsed to newSubTree.firstChild!");
michael@0 31 //XXX This should just call SimpleTest.finish(), bugs 478528, 499735.
michael@0 32 setTimeout(win.finish, 0);
michael@0 33 </constructor>
michael@0 34 </implementation>
michael@0 35 </binding>
michael@0 36 </bindings>
michael@0 37 </head>
michael@0 38 <body>
michael@0 39 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=419527">Mozilla Bug 419527</a>
michael@0 40 <p id="display"></p>
michael@0 41 <div id="content" style="display: none">
michael@0 42
michael@0 43 </div>
michael@0 44 <pre id="test">
michael@0 45 <script class="testbody" type="text/javascript">
michael@0 46 <![CDATA[
michael@0 47
michael@0 48 /** Test for Bug 419527 **/
michael@0 49
michael@0 50 var d;
michael@0 51
michael@0 52 function runRangeTest() {
michael@0 53 window.newSubTree = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
michael@0 54 newSubTree.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "div"));
michael@0 55
michael@0 56 d = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
michael@0 57 d.style.MozBinding = "url('" + window.location + "#rangebinding" + "')";
michael@0 58 document.body.appendChild(d);
michael@0 59 }
michael@0 60
michael@0 61 function finish() {
michael@0 62 SimpleTest.finish();
michael@0 63 }
michael@0 64
michael@0 65 SimpleTest.waitForExplicitFinish();
michael@0 66 setTimeout(runRangeTest, 0);
michael@0 67
michael@0 68
michael@0 69 ]]>
michael@0 70 </script>
michael@0 71 </pre>
michael@0 72 </body>
michael@0 73 </html>
michael@0 74

mercurial