Make sure to tear down the XBL binding for nodes which forced one even though not in the document. Bug 389636, r+sr+a=sicking

This commit is contained in:
bzbarsky@mit.edu 2007-09-20 19:05:43 -07:00
Родитель 764caa38c3
Коммит 1f4e049086
3 изменённых файлов: 34 добавлений и 1 удалений

Просмотреть файл

@ -2089,7 +2089,8 @@ nsGenericElement::UnbindFromTree(PRBool aDeep, PRBool aNullParent)
"Shallow unbind won't clear document and binding parent on "
"kids!");
// Make sure to unbind this node before doing the kids
nsIDocument *document = GetCurrentDoc();
nsIDocument *document =
HasFlag(NODE_FORCE_XBL_BINDINGS) ? GetOwnerDoc() : GetCurrentDoc();
if (document) {
// Notify XBL- & nsIAnonymousContentCreator-generated
// anonymous content that the document is changing.

Просмотреть файл

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<script>
function finishTest()
{
document.documentElement.className = "";
}
function boom()
{
var HTML_NS = "http://www.w3.org/1999/xhtml";
var XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
var clonedRichListBox = document.createElementNS(XUL_NS, 'richlistbox').cloneNode(false);
var div = document.createElementNS(HTML_NS, "div");
div.appendChild(clonedRichListBox);
document.body.appendChild(clonedRichListBox);
setTimeout(finishTest, 100);
}
</script>
</head>
<body onload="setTimeout(boom, 100);" style="visibility: hidden">
</body>
</html>

Просмотреть файл

@ -368,6 +368,7 @@ fails == 386310-1d.html 386310-1-ref.html
== 387201-2.html about:blank # Really an assertion test rather than a rendering test
== 387201-3.html about:blank # Really an assertion test rather than a rendering test
== 387344-1.html 387344-1-ref.html
== 389636-1.html about:blank # assertion test
== 389924-1a.html 389924-1-ref.html
== 389924-1b.html 389924-1-ref.html
!= 389924-1a.html about:blank