Adding tests

This commit is contained in:
bzbarsky@mit.edu 2007-09-18 22:15:31 -07:00
parent d27aec6224
commit 8496ff8efa
8 changed files with 85 additions and 0 deletions

View File

@ -0,0 +1,6 @@
<!DOCTYPE html>
<html>
<body>
<div id="test">first second third [<span style="background: yellow">fourth</span>]</div>
</body>
</html>

View File

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<script src="386310-script.js"></script>
</head>
<body>
<div id="test">first second third [fourth]</div>
</body>
</html>

View File

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<script src="386310-script.js"></script>
</head>
<body>
<div id="test" style="-moz-binding: url(386310-binding.xml#prepend);">first second third [fourth]</div>
</body>
</html>

View File

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<script src="386310-script.js"></script>
</head>
<body>
<div id="test" style="-moz-binding: url(386310-binding.xml#append);">first second third [fourth]</div>
</body>
</html>

View File

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<script src="386310-script.js"></script>
</head>
<body>
<div id="test" style="-moz-binding: url(386310-binding.xml#prepend-with-comment-fix);">first second third [fourth]</div>
</body>
</html>

View File

@ -0,0 +1,27 @@
<?xml version="1.0"?>
<bindings xmlns="http://www.mozilla.org/xbl"
xmlns:html="http://www.w3.org/1999/xhtml">
<binding id="prepend">
<content>
<span/>
<children/>
</content>
</binding>
<binding id="append">
<content>
<children/>
<span/>
</content>
</binding>
<binding id="prepend-with-comment-fix" extends="#prepend">
<implementation>
<constructor>
var span = document.createComment("xbl generated comment to prevent bug #36");
this.insertBefore(span, this.firstChild);
</constructor>
</implementation>
</binding>
</bindings>

View File

@ -0,0 +1,12 @@
function wrapNode() {
var elm = document.getElementById("test");
var span = document.createElement("span");
span.setAttribute("style", "background: yellow");
var range = document.createRange();
var start = "first second third [".length;
range.setStart(elm.lastChild, start);
range.setEnd(elm.lastChild, start + "fourth".length);
range.surroundContents(span);
}
window.addEventListener("load", wrapNode, false);

View File

@ -353,6 +353,10 @@ random-if(MOZ_WIDGET_TOOLKIT=="cocoa") == 379316-2.html 379316-2-ref.html # bug
== 386014-1b.html 386014-1-ref.html
== 386014-1c.html 386014-1-ref.html
== 386147-1.html 386147-1-ref.html
== 386310-1a.html 386310-1-ref.html
fails == 386310-1b.html 386310-1-ref.html
== 386310-1c.html 386310-1-ref.html
fails == 386310-1d.html 386310-1-ref.html
== 386470-1a.html 386470-1-ref.html
== 386470-1b.html 386470-1-ref.html
== 386470-1c.html 386470-1-ref.html