2008-03-13 03:12:51 -07:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
<!--
|
|
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=419527
|
|
|
|
-->
|
|
|
|
<head>
|
|
|
|
<title>Test for Bug 419527</title>
|
|
|
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
|
|
|
<bindings xmlns="http://www.mozilla.org/xbl"
|
|
|
|
xmlns:html="http://www.w3.org/1999/xhtml">
|
|
|
|
<binding id="rangebinding">
|
|
|
|
<content><html:span>Foo</html:span>
|
|
|
|
</content>
|
|
|
|
<implementation>
|
|
|
|
<constructor>
|
|
|
|
var span = document.getAnonymousNodes(this)[0];
|
|
|
|
ok(span.localName == "span", "Wrong anon node!");
|
|
|
|
var range = document.createRange();
|
|
|
|
range.selectNode(span.firstChild);
|
|
|
|
ok(range.startContainer == span, "Wrong start container!");
|
|
|
|
ok(range.endContainer == span, "Wrong end container!");
|
|
|
|
window.newSubTree.appendChild(this);
|
|
|
|
range.setStart(window.newSubTree.firstChild, 0);
|
|
|
|
ok(range.startContainer == window.newSubTree.firstChild,
|
|
|
|
"Range should have been collapsed to newSubTree.firstChild!");
|
|
|
|
ok(range.endContainer == window.newSubTree.firstChild,
|
|
|
|
"Range should have been collapsed to newSubTree.firstChild!");
|
2009-06-22 11:40:55 -07:00
|
|
|
//XXX This should just call SimpleTest.finish(), bugs 478528, 499735.
|
|
|
|
setTimeout(finish, 0);
|
2008-03-13 03:12:51 -07:00
|
|
|
</constructor>
|
|
|
|
</implementation>
|
|
|
|
</binding>
|
|
|
|
</bindings>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=419527">Mozilla Bug 419527</a>
|
|
|
|
<p id="display"></p>
|
|
|
|
<div id="content" style="display: none">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<pre id="test">
|
|
|
|
<script class="testbody" type="text/javascript">
|
|
|
|
<![CDATA[
|
|
|
|
|
|
|
|
/** Test for Bug 419527 **/
|
|
|
|
|
2009-06-22 11:40:55 -07:00
|
|
|
var d;
|
|
|
|
|
2008-03-13 03:12:51 -07:00
|
|
|
function runRangeTest() {
|
|
|
|
window.newSubTree = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
|
|
|
|
newSubTree.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "div"));
|
|
|
|
|
2009-06-22 11:40:55 -07:00
|
|
|
d = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
|
2008-03-13 03:12:51 -07:00
|
|
|
document.loadBindingDocument(window.location);
|
|
|
|
document.addBinding(d, window.location + "#rangebinding");
|
|
|
|
}
|
|
|
|
|
2009-06-22 11:40:55 -07:00
|
|
|
function finish() {
|
|
|
|
document.removeBinding(d, window.location + "#rangebinding");
|
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
|
2008-03-13 03:12:51 -07:00
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
setTimeout(runRangeTest, 0);
|
|
|
|
|
|
|
|
|
|
|
|
]]>
|
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|