зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 763a234926ca (bug 1131887)
This commit is contained in:
Родитель
3af53039d1
Коммит
37a8ad1785
|
@ -23,7 +23,6 @@
|
|||
#endif
|
||||
#include "nsBindingManager.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/dom/HTMLImageElement.h"
|
||||
#include "mozilla/dom/HTMLMediaElement.h"
|
||||
#include "nsWrapperCacheInlines.h"
|
||||
|
@ -467,9 +466,17 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep,
|
|||
if (aReparentScope) {
|
||||
JS::Rooted<JSObject*> wrapper(cx);
|
||||
if ((wrapper = aNode->GetWrapper())) {
|
||||
MOZ_ASSERT(IsDOMObject(wrapper));
|
||||
JSAutoCompartment ac(cx, wrapper);
|
||||
rv = ReparentWrapper(cx, wrapper);
|
||||
if (IsDOMObject(wrapper)) {
|
||||
JSAutoCompartment ac(cx, wrapper);
|
||||
rv = ReparentWrapper(cx, wrapper);
|
||||
} else {
|
||||
nsIXPConnect *xpc = nsContentUtils::XPConnect();
|
||||
if (xpc) {
|
||||
rv = xpc->ReparentWrappedNativeIfFound(cx, wrapper, aReparentScope, aNode);
|
||||
} else {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
if (NS_FAILED(rv)) {
|
||||
aNode->mNodeInfo.swap(nodeInfo);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче