Bug 930250 - Don't tear down XBL binding when element is in document. r=bz

This commit is contained in:
William Chen 2014-03-07 15:48:20 -08:00
parent 09b7e926b7
commit 05df29b501
3 changed files with 20 additions and 1 deletions

View File

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<body>
<nobr>
<h4 contenteditable="true">
<iframe></iframe>
<applet></applet>
<nobr>

View File

@ -146,5 +146,6 @@ load 849601.html
skip-if(Android) load 851353-1.html
load 863950.html
load 864448.html
load 930250.html
load 942979.html
load 978646.html

View File

@ -1264,7 +1264,17 @@ public:
NS_IMETHOD Run()
{
mManager->RemovedFromDocumentInternal(mElement, mDoc);
// It may be the case that the element was removed from the
// DOM, causing this runnable to be created, then inserted back
// into the document before the this runnable had a chance to
// tear down the binding. Only tear down the binding if the element
// is still no longer in the DOM. nsXBLService::LoadBinding tears
// down the old binding if the element is inserted back into the
// DOM and loads a different binding.
if (!mElement->IsInDoc()) {
mManager->RemovedFromDocumentInternal(mElement, mDoc);
}
return NS_OK;
}