зеркало из https://github.com/mozilla/gecko-dev.git
Bug 833412 - Fix tests that call addBinding. r=bz
This commit is contained in:
Родитель
348797d9b2
Коммит
04da52d3d7
|
@ -1,12 +0,0 @@
|
|||
<html>
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
try {
|
||||
document.addBinding(document.documentElement, null);
|
||||
} catch (e) {
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
|
@ -28,7 +28,6 @@ load 349355-1.html
|
|||
load 354645-1.xul
|
||||
load 360599-1.html
|
||||
load 366200-1.xhtml
|
||||
load 369216-1.html
|
||||
load 371466-1.xhtml
|
||||
load 377360-1.xhtml
|
||||
load 384663-1.html
|
||||
|
|
|
@ -95,7 +95,7 @@ interface nsIContentPolicy : nsISupports
|
|||
|
||||
/**
|
||||
* Indicates an XBL binding request, triggered either by -moz-binding CSS
|
||||
* property or Document.addBinding method.
|
||||
* property.
|
||||
*/
|
||||
const nsContentPolicyType TYPE_XBL = 9;
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ function runNextTest() {
|
|||
if (tests[curTest] == "XBL")
|
||||
{
|
||||
//XXX Removing binding to work-around a memory leak (bugs 478528, 499735).
|
||||
document.removeBinding(div, testURL);
|
||||
div.style.MozBinding = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -168,9 +168,9 @@ function request_xbl() {
|
|||
var content = $("content");
|
||||
|
||||
div = document.createElement("div");
|
||||
content.appendChild(div);
|
||||
|
||||
document.addBinding(div, testURL);
|
||||
div.style.MozBinding = "url(" + testURL + ")";
|
||||
$('test').appendChild(div);
|
||||
div.offsetLeft; // Flush styles.
|
||||
}
|
||||
|
||||
function request_xmlhttprequest() {
|
||||
|
|
|
@ -52,12 +52,11 @@ function runRangeTest() {
|
|||
newSubTree.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "div"));
|
||||
|
||||
d = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
|
||||
document.loadBindingDocument(window.location);
|
||||
document.addBinding(d, window.location + "#rangebinding");
|
||||
d.style.MozBinding = "url('" + window.location + "#rangebinding" + "')";
|
||||
document.body.appendChild(d);
|
||||
}
|
||||
|
||||
function finish() {
|
||||
document.removeBinding(d, window.location + "#rangebinding");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@ MOCHITEST_FILES = \
|
|||
$(NULL)
|
||||
|
||||
MOCHITEST_CHROME_FILES = \
|
||||
test_bug296375.xul \
|
||||
test_bug378518.xul \
|
||||
test_bug398135.xul \
|
||||
test_bug398492.xul \
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=296375
|
||||
-->
|
||||
<window title="Mozilla Bug 296375"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<title>Test for Bug 296375</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=296375">Mozilla Bug 296375</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
|
||||
<button id="b" label="crash"/>
|
||||
|
||||
<script class="testbody" type="application/javascript">
|
||||
<![CDATA[
|
||||
|
||||
/** Test for Bug 296375 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addLoadEvent(function () {
|
||||
document.addBinding(document.getElementById("b"),
|
||||
"chrome://global/content/bindings/checkbox.xml#checkbox");
|
||||
ok(true, "addBinding didn't cause a crash");
|
||||
SimpleTest.finish();
|
||||
});
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</window>
|
|
@ -55,9 +55,16 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=398492
|
|||
"Unexpected anonymous nodes after clone");
|
||||
|
||||
var n3 = document.createElement("hbox");
|
||||
document.documentElement.appendChild(n3);
|
||||
var kid3 = document.createTextNode("Text");
|
||||
n3.appendChild(kid3);
|
||||
document.addBinding(n3, document.location.href + "#test");
|
||||
|
||||
// Note - we rely on the fact that the binding is preloaded
|
||||
// by the other hbox here, so that the binding will be applied
|
||||
// sync.
|
||||
n3.style.MozBinding = "url(" + document.location.href + "#test)";
|
||||
n3.getBoundingClientRect(); // Flush styles.
|
||||
|
||||
var anonKid3 = document.getAnonymousNodes(n3)[0];
|
||||
is(anonKid3 instanceof XULElement, true,
|
||||
"Must be a XUL element after addBinding");
|
||||
|
|
Загрузка…
Ссылка в новой задаче