diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index b4f104101cb..ab359138037 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -5665,10 +5665,6 @@ already_AddRefed nsIDocument::ImportNode(nsINode& aNode, bool aDeep, ErrorResult& rv) const { nsINode* imported = &aNode; - rv = nsContentUtils::CheckSameOrigin(this, imported); - if (rv.Failed()) { - return nullptr; - } switch (imported->NodeType()) { case nsIDOMNode::ATTRIBUTE_NODE: @@ -5925,12 +5921,6 @@ nsIDocument::CreateNodeIterator(nsINode& aRoot, uint32_t aWhatToShow, ErrorResult& rv) const { nsINode* root = &aRoot; - nsresult res = nsContentUtils::CheckSameOrigin(this, root); - if (NS_FAILED(res)) { - rv.Throw(res); - return nullptr; - } - nsRefPtr iterator = new NodeIterator(root, aWhatToShow, aFilter); return iterator.forget(); @@ -5974,12 +5964,6 @@ nsIDocument::CreateTreeWalker(nsINode& aRoot, uint32_t aWhatToShow, ErrorResult& rv) const { nsINode* root = &aRoot; - nsresult res = nsContentUtils::CheckSameOrigin(this, root); - if (NS_FAILED(res)) { - rv.Throw(res); - return nullptr; - } - nsRefPtr walker = new TreeWalker(root, aWhatToShow, aFilter); return walker.forget(); } @@ -6688,10 +6672,6 @@ nsINode* nsIDocument::AdoptNode(nsINode& aAdoptedNode, ErrorResult& rv) { nsINode* adoptedNode = &aAdoptedNode; - rv = nsContentUtils::CheckSameOrigin(this, adoptedNode); - if (rv.Failed()) { - return nullptr; - } // Scope firing mutation events so that we don't carry any state that // might be stale @@ -11113,16 +11093,12 @@ nsIDocument::GetMozPointerLockElement() return nullptr; } - // Make sure pointer locked element is in the same document and domain. + // Make sure pointer locked element is in the same document. nsCOMPtr pointerLockedDoc = do_QueryReferent(nsEventStateManager::sPointerLockedDoc); if (pointerLockedDoc != this) { return nullptr; } - nsresult rv = nsContentUtils::CheckSameOrigin(this, pointerLockedElement); - if (NS_FAILED(rv)) { - return nullptr; - } return pointerLockedElement; }