Index: Source/core/dom/Document.cpp |
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
index 1d88dad2de2f487beae9c3360d3be30767429b41..76b9c406255dca4a870404fec9ed4e20245a3748 100644 |
--- a/Source/core/dom/Document.cpp |
+++ b/Source/core/dom/Document.cpp |
@@ -927,13 +927,13 @@ bool Document::importContainerNodeChildren(ContainerNode* oldContainerNode, Pass |
return true; |
} |
-PassRefPtr<Node> Document::importNode(Node* importedNode, ExceptionState& ec) |
+PassRefPtrWillBeRawPtr<Node> Document::importNode(Node* importedNode, ExceptionState& ec) |
{ |
UseCounter::countDeprecation(this, UseCounter::DocumentImportNodeOptionalArgument); |
return importNode(importedNode, true, ec); |
} |
-PassRefPtr<Node> Document::importNode(Node* importedNode, bool deep, ExceptionState& exceptionState) |
+PassRefPtrWillBeRawPtr<Node> Document::importNode(Node* importedNode, bool deep, ExceptionState& exceptionState) |
{ |
if (!importedNode) { |
exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::argumentNullOrIncorrectType(1, "Node")); |
@@ -961,7 +961,7 @@ PassRefPtr<Node> Document::importNode(Node* importedNode, bool deep, ExceptionSt |
exceptionState.throwDOMException(NamespaceError, "The imported node has an invalid namespace."); |
return nullptr; |
} |
- RefPtr<Element> newElement = createElement(oldElement->tagQName(), false); |
+ RefPtrWillBeRawPtr<Element> newElement = createElement(oldElement->tagQName(), false); |
newElement->cloneDataFromElement(*oldElement); |
@@ -5720,6 +5720,13 @@ void Document::clearWeakMembers(Visitor* visitor) |
for (unsigned i = 0; i < deadNodes.size(); ++i) |
didClearTouchEventHandlers(deadNodes[i]); |
} |
+ if (m_domWindow && !visitor->isAlive(m_domWindow)) { |
+ // Oilpan: this mirrors the clearing of the document object's touch |
+ // handlers that happen when the DOMWindow is destructed in a non-Oilpan |
+ // setting (done via DOMWindow::removeAllEventListeners().) |
+ didClearTouchEventHandlers(this); |
+ m_domWindow.clear(); |
+ } |
} |
void Document::trace(Visitor* visitor) |