mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 1455676 part 14. Remove most use of nsIDOMNode in dom/. r=qdot
This commit is contained in:
parent
ce1b5e3b44
commit
bea3100e53
@ -1326,7 +1326,7 @@ FragmentOrElement::FireNodeInserted(nsIDocument* aDoc,
|
||||
if (nsContentUtils::HasMutationListeners(childContent,
|
||||
NS_EVENT_BITS_MUTATION_NODEINSERTED, aParent)) {
|
||||
InternalMutationEvent mutation(true, eLegacyNodeInserted);
|
||||
mutation.mRelatedNode = do_QueryInterface(aParent);
|
||||
mutation.mRelatedNode = aParent;
|
||||
|
||||
mozAutoSubtreeModified subtree(aDoc, aParent);
|
||||
(new AsyncEventDispatcher(childContent, mutation))->RunDOMEventWhenSafe();
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
/*
|
||||
* Base class for all element classes as well as nsDocumentFragment. This
|
||||
* provides an implementation of nsIDOMNode, implements nsIContent, provides
|
||||
* provides an implementation of nsINode, implements nsIContent, provides
|
||||
* utility methods for subclasses, and so forth.
|
||||
*/
|
||||
|
||||
@ -71,7 +71,7 @@ private:
|
||||
|
||||
/**
|
||||
* A generic base class for DOM elements and document fragments,
|
||||
* implementing many nsIContent, nsIDOMNode and Element methods.
|
||||
* implementing many nsIContent, nsINode and Element methods.
|
||||
*/
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "nsBindingManager.h"
|
||||
#include "nsEscape.h"
|
||||
#include "nsXBLPrototypeBinding.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -120,8 +120,8 @@ public:
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the nodetype for the node. Returns the values specified in nsIDOMNode
|
||||
* for nsIDOMNode.nodeType
|
||||
* Get the nodetype for the node. Returns the values specified in Node
|
||||
* for Node.nodeType
|
||||
*/
|
||||
uint16_t NodeType() const
|
||||
{
|
||||
@ -302,7 +302,7 @@ protected:
|
||||
nsAtom* const MOZ_OWNING_REF mName;
|
||||
nsAtom* MOZ_OWNING_REF mPrefix;
|
||||
int32_t mNamespaceID;
|
||||
uint16_t mNodeType; // As defined by nsIDOMNode.nodeType
|
||||
uint16_t mNodeType; // As defined by Node.nodeType
|
||||
const nsAString* const mNameString;
|
||||
nsAtom* MOZ_OWNING_REF mExtraName; // Only used by PIs and DocTypes
|
||||
mutable mozilla::Maybe<const uint32_t> mHash;
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
#include "mozilla/dom/NodeIterator.h"
|
||||
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsError.h"
|
||||
|
||||
#include "nsIContent.h"
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include "nsStubMutationObserver.h"
|
||||
|
||||
class nsINode;
|
||||
class nsIDOMNode;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include "nsContentCID.h"
|
||||
#include "nsDeviceContext.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsRange.h"
|
||||
#include "nsITableCellLayout.h"
|
||||
#include "nsTArray.h"
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "mozilla/dom/TreeWalker.h"
|
||||
|
||||
#include "nsIContent.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsError.h"
|
||||
#include "nsINode.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
|
||||
class nsINode;
|
||||
class nsIDOMNode;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
@ -15,7 +15,6 @@
|
||||
// Interfaces needed to be included
|
||||
#include "nsCopySupport.h"
|
||||
#include "nsISelectionController.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIFormControl.h"
|
||||
#include "nsITransferable.h"
|
||||
|
@ -1016,7 +1016,7 @@ nsContentSubtreeIterator::InitWithRange()
|
||||
}
|
||||
|
||||
// cache ancestors
|
||||
nsContentUtils::GetAncestorsAndOffsets(endContainer->AsDOMNode(), endOffset,
|
||||
nsContentUtils::GetAncestorsAndOffsets(endContainer, endOffset,
|
||||
&mEndNodes, &mEndOffsets);
|
||||
|
||||
nsIContent* firstCandidate = nullptr;
|
||||
|
@ -12,7 +12,6 @@
|
||||
|
||||
#include "nsContentList.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsWrapperCacheInlines.h"
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "nsContentPolicy.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsITabChild.h"
|
||||
#include "nsIContent.h"
|
||||
@ -94,7 +93,7 @@ nsContentPolicy::CheckPolicy(CPMethod policyMethod,
|
||||
|
||||
#ifdef DEBUG
|
||||
{
|
||||
nsCOMPtr<nsIDOMNode> node(do_QueryInterface(requestingContext));
|
||||
nsCOMPtr<nsINode> node(do_QueryInterface(requestingContext));
|
||||
nsCOMPtr<nsIDOMWindow> window(do_QueryInterface(requestingContext));
|
||||
nsCOMPtr<nsITabChild> tabChild(do_QueryInterface(requestingContext));
|
||||
NS_ASSERTION(!requestingContext || node || window || tabChild,
|
||||
|
@ -285,8 +285,7 @@ NS_CP_GetDocShellFromContext(nsISupports *aContext)
|
||||
nsCOMPtr<nsPIDOMWindowOuter> window = do_QueryInterface(aContext);
|
||||
|
||||
if (!window) {
|
||||
// our context might be a document (which also QIs to nsIDOMNode), so
|
||||
// try that first
|
||||
// Our context might be a document.
|
||||
nsCOMPtr<nsIDocument> doc = do_QueryInterface(aContext);
|
||||
if (!doc) {
|
||||
// we were not a document after all, get our ownerDocument,
|
||||
|
@ -40,7 +40,6 @@
|
||||
#include "nsIAppShell.h"
|
||||
#include "nsIWidget.h"
|
||||
#include "nsWidgetsCID.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "mozAutoDocUpdate.h"
|
||||
#include "nsIWebNavigation.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
|
@ -133,7 +133,6 @@
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDocumentEncoder.h"
|
||||
#include "nsIDOMChromeWindow.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIDOMWindowUtils.h"
|
||||
#include "nsIDragService.h"
|
||||
#include "nsIFormControl.h"
|
||||
@ -2071,10 +2070,7 @@ nsContentUtils::Shutdown()
|
||||
|
||||
/**
|
||||
* Checks whether two nodes come from the same origin. aTrustedNode is
|
||||
* considered 'safe' in that a user can operate on it and that it isn't
|
||||
* a js-object that implements nsIDOMNode.
|
||||
* Never call this function with the first node provided by script, it
|
||||
* must always be known to be a 'real' node!
|
||||
* considered 'safe' in that a user can operate on it.
|
||||
*/
|
||||
// static
|
||||
nsresult
|
||||
@ -2124,15 +2120,6 @@ nsContentUtils::CanCallerAccess(nsIPrincipal* aSubjectPrincipal,
|
||||
return IsCallerChrome();
|
||||
}
|
||||
|
||||
// static
|
||||
bool
|
||||
nsContentUtils::CanCallerAccess(nsIDOMNode *aNode)
|
||||
{
|
||||
nsCOMPtr<nsINode> node = do_QueryInterface(aNode);
|
||||
NS_ENSURE_TRUE(node, false);
|
||||
return CanCallerAccess(node);
|
||||
}
|
||||
|
||||
// static
|
||||
bool
|
||||
nsContentUtils::CanCallerAccess(nsINode* aNode)
|
||||
@ -2597,18 +2584,17 @@ nsContentUtils::GetAncestors(nsINode* aNode,
|
||||
|
||||
// static
|
||||
nsresult
|
||||
nsContentUtils::GetAncestorsAndOffsets(nsIDOMNode* aNode,
|
||||
nsContentUtils::GetAncestorsAndOffsets(nsINode* aNode,
|
||||
int32_t aOffset,
|
||||
nsTArray<nsIContent*>* aAncestorNodes,
|
||||
nsTArray<int32_t>* aAncestorOffsets)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aNode);
|
||||
|
||||
nsCOMPtr<nsIContent> content(do_QueryInterface(aNode));
|
||||
|
||||
if (!content) {
|
||||
if (!aNode->IsContent()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nsIContent* content = aNode->AsContent();
|
||||
|
||||
if (!aAncestorNodes->IsEmpty()) {
|
||||
NS_WARNING("aAncestorNodes is not empty");
|
||||
@ -2621,7 +2607,7 @@ nsContentUtils::GetAncestorsAndOffsets(nsIDOMNode* aNode,
|
||||
}
|
||||
|
||||
// insert the node itself
|
||||
aAncestorNodes->AppendElement(content.get());
|
||||
aAncestorNodes->AppendElement(content);
|
||||
aAncestorOffsets->AppendElement(aOffset);
|
||||
|
||||
// insert all the ancestors
|
||||
@ -2637,25 +2623,6 @@ nsContentUtils::GetAncestorsAndOffsets(nsIDOMNode* aNode,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// static
|
||||
nsresult
|
||||
nsContentUtils::GetCommonAncestor(nsIDOMNode *aNode,
|
||||
nsIDOMNode *aOther,
|
||||
nsIDOMNode** aCommonAncestor)
|
||||
{
|
||||
*aCommonAncestor = nullptr;
|
||||
|
||||
nsCOMPtr<nsINode> node1 = do_QueryInterface(aNode);
|
||||
nsCOMPtr<nsINode> node2 = do_QueryInterface(aOther);
|
||||
|
||||
NS_ENSURE_TRUE(node1 && node2, NS_ERROR_UNEXPECTED);
|
||||
|
||||
nsINode* common = GetCommonAncestor(node1, node2);
|
||||
NS_ENSURE_TRUE(common, NS_ERROR_NOT_AVAILABLE);
|
||||
|
||||
return CallQueryInterface(common, aCommonAncestor);
|
||||
}
|
||||
|
||||
template <typename Node, typename GetParentFunc>
|
||||
static Node*
|
||||
GetCommonAncestorInternal(Node* aNode1,
|
||||
@ -2802,18 +2769,6 @@ nsContentUtils::ComparePoints(nsINode* aParent1, int32_t aOffset1,
|
||||
return parent->ComputeIndexOf(child1) < aOffset2 ? -1 : 1;
|
||||
}
|
||||
|
||||
/* static */
|
||||
int32_t
|
||||
nsContentUtils::ComparePoints(nsIDOMNode* aParent1, int32_t aOffset1,
|
||||
nsIDOMNode* aParent2, int32_t aOffset2,
|
||||
bool* aDisconnected)
|
||||
{
|
||||
nsCOMPtr<nsINode> parent1 = do_QueryInterface(aParent1);
|
||||
nsCOMPtr<nsINode> parent2 = do_QueryInterface(aParent2);
|
||||
NS_ENSURE_TRUE(parent1 && parent2, -1);
|
||||
return ComparePoints(parent1, aOffset1, parent2, aOffset2);
|
||||
}
|
||||
|
||||
/* static */
|
||||
int32_t
|
||||
nsContentUtils::ComparePoints(const RawRangeBoundary& aFirst,
|
||||
@ -4800,7 +4755,7 @@ nsContentUtils::MaybeFireNodeRemoved(nsINode* aChild, nsINode* aParent)
|
||||
if (HasMutationListeners(aChild,
|
||||
NS_EVENT_BITS_MUTATION_NODEREMOVED, aParent)) {
|
||||
InternalMutationEvent mutation(true, eLegacyNodeRemoved);
|
||||
mutation.mRelatedNode = do_QueryInterface(aParent);
|
||||
mutation.mRelatedNode = aParent;
|
||||
|
||||
mozAutoSubtreeModified subtree(aParent->OwnerDoc(), aParent);
|
||||
EventDispatcher::Dispatch(aChild, nullptr, &mutation);
|
||||
|
@ -69,7 +69,6 @@ class nsIContentPolicy;
|
||||
class nsIContentSecurityPolicy;
|
||||
class nsIDocShellTreeItem;
|
||||
class nsIDocumentLoaderFactory;
|
||||
class nsIDOMNode;
|
||||
class nsIDragSession;
|
||||
class nsIEventTarget;
|
||||
class nsIFragmentContentSink;
|
||||
@ -386,21 +385,11 @@ public:
|
||||
*
|
||||
* This method just sucks.
|
||||
*/
|
||||
static nsresult GetAncestorsAndOffsets(nsIDOMNode* aNode,
|
||||
static nsresult GetAncestorsAndOffsets(nsINode* aNode,
|
||||
int32_t aOffset,
|
||||
nsTArray<nsIContent*>* aAncestorNodes,
|
||||
nsTArray<int32_t>* aAncestorOffsets);
|
||||
|
||||
/*
|
||||
* The out parameter, |aCommonAncestor| will be the closest node, if any,
|
||||
* to both |aNode| and |aOther| which is also an ancestor of each.
|
||||
* Returns an error if the two nodes are disconnected and don't have
|
||||
* a common ancestor.
|
||||
*/
|
||||
static nsresult GetCommonAncestor(nsIDOMNode *aNode,
|
||||
nsIDOMNode *aOther,
|
||||
nsIDOMNode** aCommonAncestor);
|
||||
|
||||
/**
|
||||
* Returns the common ancestor, if any, for two nodes.
|
||||
*
|
||||
@ -461,9 +450,6 @@ public:
|
||||
static int32_t ComparePoints(nsINode* aParent1, int32_t aOffset1,
|
||||
nsINode* aParent2, int32_t aOffset2,
|
||||
bool* aDisconnected = nullptr);
|
||||
static int32_t ComparePoints(nsIDOMNode* aParent1, int32_t aOffset1,
|
||||
nsIDOMNode* aParent2, int32_t aOffset2,
|
||||
bool* aDisconnected = nullptr);
|
||||
static int32_t ComparePoints(const mozilla::RawRangeBoundary& aFirst,
|
||||
const mozilla::RawRangeBoundary& aSecond,
|
||||
bool* aDisconnected = nullptr);
|
||||
@ -487,7 +473,7 @@ public:
|
||||
*
|
||||
* @return The reversed document position flags.
|
||||
*
|
||||
* @see nsIDOMNode
|
||||
* @see Node
|
||||
*/
|
||||
static uint16_t ReverseDocumentPosition(uint16_t aDocumentPosition);
|
||||
|
||||
@ -593,7 +579,6 @@ public:
|
||||
const nsINode* unTrustedNode);
|
||||
|
||||
// Check if the (JS) caller can access aNode.
|
||||
static bool CanCallerAccess(nsIDOMNode *aNode);
|
||||
static bool CanCallerAccess(nsINode* aNode);
|
||||
|
||||
// Check if the (JS) caller can access aWindow.
|
||||
|
@ -29,7 +29,6 @@
|
||||
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIHTMLDocument.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsIFrame.h"
|
||||
|
@ -829,11 +829,9 @@ nsDocumentEncoder::SerializeRangeToString(nsRange *aRange,
|
||||
mEndOffsets.Clear();
|
||||
|
||||
nsContentUtils::GetAncestors(mCommonParent, mCommonAncestors);
|
||||
nsCOMPtr<nsIDOMNode> sp = do_QueryInterface(startContainer);
|
||||
nsContentUtils::GetAncestorsAndOffsets(sp, startOffset,
|
||||
nsContentUtils::GetAncestorsAndOffsets(startContainer, startOffset,
|
||||
&mStartNodes, &mStartOffsets);
|
||||
nsCOMPtr<nsIDOMNode> ep = do_QueryInterface(endContainer);
|
||||
nsContentUtils::GetAncestorsAndOffsets(ep, endOffset,
|
||||
nsContentUtils::GetAncestorsAndOffsets(endContainer, endOffset,
|
||||
&mEndNodes, &mEndOffsets);
|
||||
|
||||
nsCOMPtr<nsIContent> commonContent = do_QueryInterface(mCommonParent);
|
||||
@ -1149,13 +1147,11 @@ protected:
|
||||
nsresult GetPromotedPoint(Endpoint aWhere, nsINode* aNode, int32_t aOffset,
|
||||
nsCOMPtr<nsINode>* outNode, int32_t* outOffset, nsINode* aCommon);
|
||||
nsCOMPtr<nsINode> GetChildAt(nsINode *aParent, int32_t aOffset);
|
||||
bool IsMozBR(nsIDOMNode* aNode);
|
||||
bool IsMozBR(Element* aNode);
|
||||
nsresult GetNodeLocation(nsINode *inChild, nsCOMPtr<nsINode> *outParent, int32_t *outOffset);
|
||||
bool IsRoot(nsINode* aNode);
|
||||
bool IsFirstNode(nsINode *aNode);
|
||||
bool IsLastNode(nsINode *aNode);
|
||||
bool IsEmptyTextContent(nsIDOMNode* aNode);
|
||||
virtual bool IncludeInContext(nsINode *aNode) override;
|
||||
virtual int32_t
|
||||
GetImmediateContextCount(const nsTArray<nsINode*>& aAncestorArray) override;
|
||||
@ -1731,14 +1727,6 @@ nsHTMLCopyEncoder::GetChildAt(nsINode *aParent, int32_t aOffset)
|
||||
return resultNode;
|
||||
}
|
||||
|
||||
bool
|
||||
nsHTMLCopyEncoder::IsMozBR(nsIDOMNode* aNode)
|
||||
{
|
||||
MOZ_ASSERT(aNode);
|
||||
nsCOMPtr<Element> element = do_QueryInterface(aNode);
|
||||
return element && IsMozBR(element);
|
||||
}
|
||||
|
||||
bool
|
||||
nsHTMLCopyEncoder::IsMozBR(Element* aElement)
|
||||
{
|
||||
@ -1831,13 +1819,6 @@ nsHTMLCopyEncoder::IsLastNode(nsINode *aNode)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
nsHTMLCopyEncoder::IsEmptyTextContent(nsIDOMNode* aNode)
|
||||
{
|
||||
nsCOMPtr<nsIContent> cont = do_QueryInterface(aNode);
|
||||
return cont && cont->TextIsOnlyWhitespace();
|
||||
}
|
||||
|
||||
nsresult NS_NewHTMLCopyTextEncoder(nsIDocumentEncoder** aResult); // make mac compiler happy
|
||||
|
||||
nsresult
|
||||
|
@ -1345,13 +1345,12 @@ nsFocusManager::SetFocusInner(Element* aNewContent, int32_t aFlags,
|
||||
// If the caller cannot access the current focused node, the caller should
|
||||
// not be able to steal focus from it. E.g., When the current focused node
|
||||
// is in chrome, any web contents should not be able to steal the focus.
|
||||
nsCOMPtr<nsIDOMNode> domNode(do_QueryInterface(mFocusedElement));
|
||||
sendFocusEvent = nsContentUtils::CanCallerAccess(domNode);
|
||||
sendFocusEvent = nsContentUtils::CanCallerAccess(mFocusedElement);
|
||||
if (!sendFocusEvent && mMouseButtonEventHandlingDocument) {
|
||||
// However, while mouse button event is handling, the handling document's
|
||||
// script should be able to steal focus.
|
||||
domNode = do_QueryInterface(mMouseButtonEventHandlingDocument);
|
||||
sendFocusEvent = nsContentUtils::CanCallerAccess(domNode);
|
||||
sendFocusEvent =
|
||||
nsContentUtils::CanCallerAccess(mMouseButtonEventHandlingDocument);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1377,7 +1377,7 @@ nsINode::doInsertChildAt(nsIContent* aKid, uint32_t aIndex,
|
||||
if (nsContentUtils::HasMutationListeners(aKid,
|
||||
NS_EVENT_BITS_MUTATION_NODEINSERTED, this)) {
|
||||
InternalMutationEvent mutation(true, eLegacyNodeInserted);
|
||||
mutation.mRelatedNode = do_QueryInterface(this);
|
||||
mutation.mRelatedNode = this;
|
||||
|
||||
mozAutoSubtreeModified subtree(OwnerDoc(), this);
|
||||
(new AsyncEventDispatcher(aKid, mutation))->RunDOMEventWhenSafe();
|
||||
|
@ -34,7 +34,6 @@
|
||||
#include "nsIStreamListener.h"
|
||||
|
||||
#include "nsIFrame.h"
|
||||
#include "nsIDOMNode.h"
|
||||
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
|
@ -13,7 +13,6 @@
|
||||
|
||||
#include "nsString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsError.h"
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsINode.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "prmon.h"
|
||||
#include "nsStubMutationObserver.h"
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsXPCOMCIDInternal.h"
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
#include "nsTraversal.h"
|
||||
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsError.h"
|
||||
#include "nsINode.h"
|
||||
#include "mozilla/AutoRestore.h"
|
||||
|
@ -821,16 +821,11 @@ DataTransfer::Clone(nsISupports* aParent, EventMessage aEventMessage,
|
||||
}
|
||||
|
||||
already_AddRefed<nsIArray>
|
||||
DataTransfer::GetTransferables(nsIDOMNode* aDragTarget)
|
||||
DataTransfer::GetTransferables(nsINode* aDragTarget)
|
||||
{
|
||||
MOZ_ASSERT(aDragTarget);
|
||||
|
||||
nsCOMPtr<nsINode> dragNode = do_QueryInterface(aDragTarget);
|
||||
if (!dragNode) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsIDocument* doc = dragNode->GetComposedDoc();
|
||||
nsIDocument* doc = aDragTarget->GetComposedDoc();
|
||||
if (!doc) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include "mozilla/dom/BindingDeclarations.h"
|
||||
#include "mozilla/dom/File.h"
|
||||
|
||||
class nsIDOMNode;
|
||||
class nsINode;
|
||||
class nsITransferable;
|
||||
class nsILoadContext;
|
||||
@ -343,7 +342,7 @@ public:
|
||||
|
||||
// converts the data into an array of nsITransferable objects to be used for
|
||||
// drag and drop or clipboard operations.
|
||||
already_AddRefed<nsIArray> GetTransferables(nsIDOMNode* aDragTarget);
|
||||
already_AddRefed<nsIArray> GetTransferables(nsINode* aDragTarget);
|
||||
|
||||
already_AddRefed<nsIArray>
|
||||
GetTransferables(nsILoadContext* aLoadContext);
|
||||
|
@ -2106,8 +2106,7 @@ EventStateManager::DoDefaultDragStart(nsPresContext* aPresContext,
|
||||
int32_t imageX, imageY;
|
||||
Element* dragImage = aDataTransfer->GetDragImage(&imageX, &imageY);
|
||||
|
||||
nsCOMPtr<nsIArray> transArray =
|
||||
aDataTransfer->GetTransferables(dragTarget->AsDOMNode());
|
||||
nsCOMPtr<nsIArray> transArray = aDataTransfer->GetTransferables(dragTarget);
|
||||
if (!transArray)
|
||||
return false;
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "mozilla/BasicEvents.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsAtom.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsINode.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@ -36,7 +36,7 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMNode> mRelatedNode;
|
||||
nsCOMPtr<nsINode> mRelatedNode;
|
||||
RefPtr<nsAtom> mAttrName;
|
||||
RefPtr<nsAtom> mPrevAttrValue;
|
||||
RefPtr<nsAtom> mNewAttrValue;
|
||||
|
@ -22,12 +22,10 @@ MutationEvent::MutationEvent(EventTarget* aOwner,
|
||||
mEventIsInternal = (aEvent == nullptr);
|
||||
}
|
||||
|
||||
already_AddRefed<nsINode>
|
||||
nsINode*
|
||||
MutationEvent::GetRelatedNode()
|
||||
{
|
||||
nsCOMPtr<nsINode> n =
|
||||
do_QueryInterface(mEvent->AsMutationEvent()->mRelatedNode);
|
||||
return n.forget();
|
||||
return mEvent->AsMutationEvent()->mRelatedNode;
|
||||
}
|
||||
|
||||
void
|
||||
@ -75,7 +73,7 @@ MutationEvent::InitMutationEvent(const nsAString& aType,
|
||||
Event::InitEvent(aType, aCanBubble, aCancelable);
|
||||
|
||||
InternalMutationEvent* mutation = mEvent->AsMutationEvent();
|
||||
mutation->mRelatedNode = aRelatedNode ? aRelatedNode->AsDOMNode() : nullptr;
|
||||
mutation->mRelatedNode = aRelatedNode;
|
||||
if (!aPrevValue.IsEmpty())
|
||||
mutation->mPrevAttrValue = NS_Atomize(aPrevValue);
|
||||
if (!aNewValue.IsEmpty())
|
||||
|
@ -33,7 +33,7 @@ public:
|
||||
void GetNewValue(nsAString& aNewValue) const;
|
||||
void GetAttrName(nsAString& aAttrName) const;
|
||||
|
||||
already_AddRefed<nsINode> GetRelatedNode();
|
||||
nsINode* GetRelatedNode();
|
||||
|
||||
uint16_t AttrChange();
|
||||
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "prtime.h"
|
||||
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "mozilla/dom/HTMLFormElement.h"
|
||||
#include "nsGenericHTMLElement.h" // nsGenericHTMLFormElement
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIFormControl.h"
|
||||
#include "RadioNodeList.h"
|
||||
#include "jsfriendapi.h"
|
||||
|
@ -1122,7 +1122,7 @@ NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED(HTMLInputElement,
|
||||
nsIDOMNSEditableElement,
|
||||
nsIConstraintValidation)
|
||||
|
||||
// nsIDOMNode
|
||||
// nsINode
|
||||
|
||||
nsresult
|
||||
HTMLInputElement::Clone(mozilla::dom::NodeInfo* aNodeInfo, nsINode** aResult,
|
||||
|
@ -1179,7 +1179,7 @@ nsHTMLDocument::Open(JSContext* /* unused */,
|
||||
bool aReplace,
|
||||
ErrorResult& rv)
|
||||
{
|
||||
MOZ_ASSERT(nsContentUtils::CanCallerAccess(static_cast<nsIDOMNode*>(this)),
|
||||
MOZ_ASSERT(nsContentUtils::CanCallerAccess(this),
|
||||
"XOW should have caught this!");
|
||||
|
||||
nsCOMPtr<nsPIDOMWindowInner> window = GetInnerWindow();
|
||||
@ -1209,7 +1209,7 @@ nsHTMLDocument::Open(JSContext* cx,
|
||||
// Implements the "When called with two arguments (or fewer)" steps here:
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#opening-the-input-stream
|
||||
|
||||
MOZ_ASSERT(nsContentUtils::CanCallerAccess(static_cast<nsIDOMNode*>(this)),
|
||||
MOZ_ASSERT(nsContentUtils::CanCallerAccess(this),
|
||||
"XOW should have caught this!");
|
||||
if (!IsHTMLDocument() || mDisableDocWrite) {
|
||||
// No calling document.open() on XHTML
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIHttpChannel.h"
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
|
@ -27,7 +27,7 @@ SVGAnimateElement::SVGAnimateElement(already_AddRefed<mozilla::dom::NodeInfo>& a
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGAnimateElement)
|
||||
|
||||
|
@ -30,7 +30,7 @@ protected:
|
||||
virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
public:
|
||||
// nsIDOMNode
|
||||
// nsINode
|
||||
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
|
||||
bool aPreallocateChildren) const override;
|
||||
|
||||
|
@ -27,7 +27,7 @@ SVGAnimateMotionElement::SVGAnimateMotionElement(already_AddRefed<mozilla::dom::
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGAnimateMotionElement)
|
||||
|
||||
|
@ -30,7 +30,7 @@ protected:
|
||||
virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
public:
|
||||
// nsIDOMNode specializations
|
||||
// nsINode specializations
|
||||
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
|
||||
bool aPreallocateChildren) const override;
|
||||
|
||||
|
@ -55,7 +55,7 @@ SVGAnimateTransformElement::ParseAttribute(int32_t aNamespaceID,
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGAnimateTransformElement)
|
||||
|
||||
|
@ -30,7 +30,7 @@ protected:
|
||||
virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
public:
|
||||
// nsIDOMNode specializations
|
||||
// nsINode specializations
|
||||
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
|
||||
bool aPreallocateChildren) const override;
|
||||
|
||||
|
@ -39,7 +39,7 @@ SVGCircleElement::SVGCircleElement(already_AddRefed<mozilla::dom::NodeInfo>& aNo
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGCircleElement)
|
||||
|
||||
|
@ -61,7 +61,7 @@ SVGClipPathElement::IsUnitsObjectBoundingBox() const
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGClipPathElement)
|
||||
|
||||
|
@ -27,7 +27,7 @@ SVGDefsElement::SVGDefsElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeIn
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGDefsElement)
|
||||
|
@ -27,7 +27,7 @@ SVGDescElement::SVGDescElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeIn
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGDescElement)
|
||||
|
||||
|
@ -41,7 +41,7 @@ SVGEllipseElement::SVGEllipseElement(already_AddRefed<mozilla::dom::NodeInfo>& a
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGEllipseElement)
|
||||
|
||||
|
@ -57,7 +57,7 @@ nsSVGElement::StringInfo SVGFEBlendElement::sStringInfo[3] =
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEBlendElement)
|
||||
|
||||
|
@ -52,7 +52,7 @@ nsSVGElement::NumberListInfo SVGFEColorMatrixElement::sNumberListInfo[1] =
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEColorMatrixElement)
|
||||
|
@ -30,7 +30,7 @@ nsSVGElement::StringInfo SVGFEComponentTransferElement::sStringInfo[2] =
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEComponentTransferElement)
|
||||
|
||||
|
@ -54,7 +54,7 @@ nsSVGElement::StringInfo SVGFECompositeElement::sStringInfo[3] =
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFECompositeElement)
|
||||
|
||||
|
@ -79,7 +79,7 @@ nsSVGElement::NumberListInfo SVGFEConvolveMatrixElement::sNumberListInfo[1] =
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEConvolveMatrixElement)
|
||||
|
||||
|
@ -23,7 +23,7 @@ SVGFEDiffuseLightingElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGiv
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEDiffuseLightingElement)
|
||||
|
||||
|
@ -55,7 +55,7 @@ nsSVGElement::StringInfo SVGFEDisplacementMapElement::sStringInfo[3] =
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEDisplacementMapElement)
|
||||
|
||||
|
@ -29,7 +29,7 @@ nsSVGElement::NumberInfo SVGFEDistantLightElement::sNumberInfo[2] =
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEDistantLightElement)
|
||||
|
||||
|
@ -40,7 +40,7 @@ nsSVGElement::StringInfo SVGFEDropShadowElement::sStringInfo[2] =
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEDropShadowElement)
|
||||
|
||||
|
@ -30,7 +30,7 @@ nsSVGElement::StringInfo SVGFEFloodElement::sStringInfo[1] =
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEFloodElement)
|
||||
|
||||
|
@ -34,7 +34,7 @@ nsSVGElement::StringInfo SVGFEGaussianBlurElement::sStringInfo[2] =
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEGaussianBlurElement)
|
||||
|
||||
|
@ -198,7 +198,7 @@ SVGFEImageElement::IntrinsicState() const
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEImageElement)
|
||||
|
||||
|
@ -24,7 +24,7 @@ nsSVGElement::StringInfo SVGFEMergeNodeElement::sStringInfo[1] =
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEMergeNodeElement)
|
||||
|
||||
|
@ -47,7 +47,7 @@ nsSVGElement::StringInfo SVGFEMorphologyElement::sStringInfo[2] =
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEMorphologyElement)
|
||||
|
@ -34,7 +34,7 @@ nsSVGElement::StringInfo SVGFEOffsetElement::sStringInfo[2] =
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEOffsetElement)
|
||||
|
@ -29,7 +29,7 @@ nsSVGElement::NumberInfo SVGFEPointLightElement::sNumberInfo[3] =
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEPointLightElement)
|
||||
|
||||
|
@ -23,7 +23,7 @@ SVGFESpecularLightingElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGi
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFESpecularLightingElement)
|
||||
|
||||
|
@ -34,7 +34,7 @@ nsSVGElement::NumberInfo SVGFESpotLightElement::sNumberInfo[8] =
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFESpotLightElement)
|
||||
|
||||
|
@ -28,7 +28,7 @@ nsSVGElement::StringInfo SVGFETileElement::sStringInfo[2] =
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFETileElement)
|
||||
|
@ -77,7 +77,7 @@ nsSVGElement::StringInfo SVGFETurbulenceElement::sStringInfo[1] =
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFETurbulenceElement)
|
||||
|
||||
|
@ -62,7 +62,7 @@ SVGFilterElement::SVGFilterElement(already_AddRefed<mozilla::dom::NodeInfo>& aNo
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFilterElement)
|
||||
|
@ -40,7 +40,7 @@ SVGForeignObjectElement::SVGForeignObjectElement(already_AddRefed<mozilla::dom::
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGForeignObjectElement)
|
||||
|
||||
|
@ -28,7 +28,7 @@ SVGGElement::SVGGElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGGElement)
|
||||
|
@ -147,7 +147,7 @@ SVGLinearGradientElement::SVGLinearGradientElement(already_AddRefed<mozilla::dom
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGLinearGradientElement)
|
||||
|
||||
@ -223,7 +223,7 @@ SVGRadialGradientElement::SVGRadialGradientElement(already_AddRefed<mozilla::dom
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGRadialGradientElement)
|
||||
|
||||
|
@ -69,7 +69,7 @@ SVGImageElement::~SVGImageElement()
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGImageElement)
|
||||
|
@ -56,7 +56,7 @@ SVGLineElement::MaybeAdjustForZeroLength(float aX1, float aY1,
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGLineElement)
|
||||
|
||||
|
@ -65,7 +65,7 @@ SVGMPathElement::~SVGMPathElement()
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGMPathElement)
|
||||
|
||||
|
@ -105,7 +105,7 @@ SVGMarkerElement::SVGMarkerElement(already_AddRefed<mozilla::dom::NodeInfo>& aNo
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGMarkerElement)
|
||||
|
||||
|
@ -57,7 +57,7 @@ SVGMaskElement::SVGMaskElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeIn
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode method
|
||||
// nsINode method
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGMaskElement)
|
||||
|
||||
|
@ -35,7 +35,7 @@ SVGMetadataElement::Init()
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGMetadataElement)
|
||||
|
||||
|
@ -56,7 +56,7 @@ SVGPathElement::AddSizeOfExcludingThis(nsWindowSizes& aSizes,
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGPathElement)
|
||||
|
||||
|
@ -64,7 +64,7 @@ SVGPatternElement::SVGPatternElement(already_AddRefed<mozilla::dom::NodeInfo>& a
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode method
|
||||
// nsINode method
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGPatternElement)
|
||||
|
||||
|
@ -32,7 +32,7 @@ SVGPolygonElement::SVGPolygonElement(already_AddRefed<mozilla::dom::NodeInfo>& a
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGPolygonElement)
|
||||
|
||||
|
@ -31,7 +31,7 @@ SVGPolylineElement::SVGPolylineElement(already_AddRefed<mozilla::dom::NodeInfo>&
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGPolylineElement)
|
||||
|
||||
|
@ -48,7 +48,7 @@ SVGRectElement::SVGRectElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeIn
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGRectElement)
|
||||
|
||||
|
@ -157,7 +157,7 @@ SVGSVGElement::~SVGSVGElement()
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT_AND_PARSER(SVGSVGElement)
|
||||
|
||||
|
@ -52,7 +52,7 @@ SVGScriptElement::~SVGScriptElement()
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
nsresult
|
||||
SVGScriptElement::Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
|
||||
|
@ -27,7 +27,7 @@ SVGSetElement::SVGSetElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGSetElement)
|
||||
|
||||
|
@ -30,7 +30,7 @@ protected:
|
||||
virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
public:
|
||||
// nsIDOMNode
|
||||
// nsINode
|
||||
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
|
||||
bool aPreallocateChildren) const override;
|
||||
|
||||
|
@ -30,7 +30,7 @@ SVGStopElement::SVGStopElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeIn
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGStopElement)
|
||||
|
||||
|
@ -54,7 +54,7 @@ SVGStyleElement::~SVGStyleElement()
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGStyleElement)
|
||||
|
@ -73,7 +73,7 @@ SVGSwitchElement::MaybeInvalidate()
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGSwitchElement)
|
||||
|
@ -38,7 +38,7 @@ SVGSymbolElement::~SVGSymbolElement()
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGSymbolElement)
|
||||
|
||||
|
@ -42,7 +42,7 @@ SVGTSpanElement::GetLengthInfo()
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGTSpanElement)
|
||||
|
@ -41,7 +41,7 @@ SVGTextElement::GetLengthInfo()
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGTextElement)
|
||||
|
@ -91,7 +91,7 @@ SVGTextPathElement::SVGTextPathElement(already_AddRefed<mozilla::dom::NodeInfo>&
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGTextPathElement)
|
||||
|
||||
|
@ -108,7 +108,7 @@ SVGTitleElement::SendTitleChangeEvent(bool aBound)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGTitleElement)
|
||||
|
||||
|
@ -85,7 +85,7 @@ SVGUseElement::~SVGUseElement()
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
nsresult
|
||||
SVGUseElement::Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
|
||||
|
@ -43,7 +43,7 @@ SVGViewElement::SVGViewElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeIn
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
// nsINode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGViewElement)
|
||||
|
||||
|
@ -30,7 +30,6 @@
|
||||
#include "nsFrameLoader.h"
|
||||
#include "nsIComponentRegistrar.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIDOMWindowUtils.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIDocument.h"
|
||||
@ -236,7 +235,7 @@ class ResourceReader final : public nsIWebBrowserPersistDocumentReceiver {
|
||||
public:
|
||||
ResourceReader(WebBrowserPersistLocalDocument* aParent,
|
||||
nsIWebBrowserPersistResourceVisitor* aVisitor);
|
||||
nsresult OnWalkDOMNode(nsIDOMNode* aNode);
|
||||
nsresult OnWalkDOMNode(nsINode* aNode);
|
||||
|
||||
// This is called both to indicate the end of the document walk
|
||||
// and when a subdocument is (maybe asynchronously) sent to the
|
||||
@ -263,10 +262,10 @@ private:
|
||||
|
||||
nsresult OnWalkURI(const nsACString& aURISpec);
|
||||
nsresult OnWalkURI(nsIURI* aURI);
|
||||
nsresult OnWalkAttribute(nsIDOMNode* aNode,
|
||||
nsresult OnWalkAttribute(Element* aElement,
|
||||
const char* aAttribute,
|
||||
const char* aNamespaceURI = "");
|
||||
nsresult OnWalkSubframe(nsIDOMNode* aNode);
|
||||
nsresult OnWalkSubframe(nsINode* aNode);
|
||||
|
||||
~ResourceReader();
|
||||
|
||||
@ -305,7 +304,7 @@ ResourceReader::DocumentDone(nsresult aStatus)
|
||||
}
|
||||
|
||||
nsresult
|
||||
ResourceReader::OnWalkSubframe(nsIDOMNode* aNode)
|
||||
ResourceReader::OnWalkSubframe(nsINode* aNode)
|
||||
{
|
||||
nsCOMPtr<nsIFrameLoaderOwner> loaderOwner = do_QueryInterface(aNode);
|
||||
NS_ENSURE_STATE(loaderOwner);
|
||||
@ -380,18 +379,15 @@ ResourceReader::OnWalkURI(const nsACString& aURISpec)
|
||||
}
|
||||
|
||||
static void
|
||||
ExtractAttribute(nsIDOMNode* aNode,
|
||||
ExtractAttribute(Element* aElement,
|
||||
const char* aAttribute,
|
||||
const char* aNamespaceURI,
|
||||
nsCString& aValue)
|
||||
{
|
||||
nsCOMPtr<dom::Element> element = do_QueryInterface(aNode);
|
||||
MOZ_ASSERT(element);
|
||||
|
||||
// Find the named URI attribute on the (element) node and store
|
||||
// a reference to the URI that maps onto a local file name
|
||||
|
||||
RefPtr<nsDOMAttributeMap> attrMap = element->Attributes();
|
||||
RefPtr<nsDOMAttributeMap> attrMap = aElement->Attributes();
|
||||
|
||||
NS_ConvertASCIItoUTF16 namespaceURI(aNamespaceURI);
|
||||
NS_ConvertASCIItoUTF16 attribute(aAttribute);
|
||||
@ -406,12 +402,12 @@ ExtractAttribute(nsIDOMNode* aNode,
|
||||
}
|
||||
|
||||
nsresult
|
||||
ResourceReader::OnWalkAttribute(nsIDOMNode* aNode,
|
||||
ResourceReader::OnWalkAttribute(Element* aElement,
|
||||
const char* aAttribute,
|
||||
const char* aNamespaceURI)
|
||||
{
|
||||
nsAutoCString uriSpec;
|
||||
ExtractAttribute(aNode, aAttribute, aNamespaceURI, uriSpec);
|
||||
ExtractAttribute(aElement, aAttribute, aNamespaceURI, uriSpec);
|
||||
if (uriSpec.IsEmpty()) {
|
||||
return NS_OK;
|
||||
}
|
||||
@ -429,15 +425,10 @@ GetXMLStyleSheetLink(dom::ProcessingInstruction *aPI, nsAString &aHref)
|
||||
}
|
||||
|
||||
nsresult
|
||||
ResourceReader::OnWalkDOMNode(nsIDOMNode* aNode)
|
||||
ResourceReader::OnWalkDOMNode(nsINode* aNode)
|
||||
{
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(aNode);
|
||||
if (!content) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Fixup xml-stylesheet processing instructions
|
||||
if (auto nodeAsPI = dom::ProcessingInstruction::FromNode(content)) {
|
||||
if (auto nodeAsPI = dom::ProcessingInstruction::FromNode(aNode)) {
|
||||
nsAutoString target;
|
||||
nodeAsPI->GetTarget(target);
|
||||
if (target.EqualsLiteral("xml-stylesheet")) {
|
||||
@ -451,55 +442,57 @@ ResourceReader::OnWalkDOMNode(nsIDOMNode* aNode)
|
||||
}
|
||||
|
||||
// Test the node to see if it's an image, frame, iframe, css, js
|
||||
if (content->IsHTMLElement(nsGkAtoms::img)) {
|
||||
return OnWalkAttribute(aNode, "src");
|
||||
if (aNode->IsHTMLElement(nsGkAtoms::img)) {
|
||||
return OnWalkAttribute(aNode->AsElement(), "src");
|
||||
}
|
||||
|
||||
if (content->IsSVGElement(nsGkAtoms::img)) {
|
||||
return OnWalkAttribute(aNode, "href", "http://www.w3.org/1999/xlink");
|
||||
if (aNode->IsSVGElement(nsGkAtoms::img)) {
|
||||
return OnWalkAttribute(aNode->AsElement(), "href",
|
||||
"http://www.w3.org/1999/xlink");
|
||||
}
|
||||
|
||||
if (content->IsAnyOfHTMLElements(nsGkAtoms::audio, nsGkAtoms::video)) {
|
||||
return OnWalkAttribute(aNode, "src");
|
||||
if (aNode->IsAnyOfHTMLElements(nsGkAtoms::audio, nsGkAtoms::video)) {
|
||||
return OnWalkAttribute(aNode->AsElement(), "src");
|
||||
}
|
||||
|
||||
if (content->IsHTMLElement(nsGkAtoms::source)) {
|
||||
return OnWalkAttribute(aNode, "src");
|
||||
if (aNode->IsHTMLElement(nsGkAtoms::source)) {
|
||||
return OnWalkAttribute(aNode->AsElement(), "src");
|
||||
}
|
||||
|
||||
if (content->IsHTMLElement(nsGkAtoms::body)) {
|
||||
return OnWalkAttribute(aNode, "background");
|
||||
if (aNode->IsHTMLElement(nsGkAtoms::body)) {
|
||||
return OnWalkAttribute(aNode->AsElement(), "background");
|
||||
}
|
||||
|
||||
if (content->IsHTMLElement(nsGkAtoms::table)) {
|
||||
return OnWalkAttribute(aNode, "background");
|
||||
if (aNode->IsHTMLElement(nsGkAtoms::table)) {
|
||||
return OnWalkAttribute(aNode->AsElement(), "background");
|
||||
}
|
||||
|
||||
if (content->IsHTMLElement(nsGkAtoms::tr)) {
|
||||
return OnWalkAttribute(aNode, "background");
|
||||
if (aNode->IsHTMLElement(nsGkAtoms::tr)) {
|
||||
return OnWalkAttribute(aNode->AsElement(), "background");
|
||||
}
|
||||
|
||||
if (content->IsAnyOfHTMLElements(nsGkAtoms::td, nsGkAtoms::th)) {
|
||||
return OnWalkAttribute(aNode, "background");
|
||||
if (aNode->IsAnyOfHTMLElements(nsGkAtoms::td, nsGkAtoms::th)) {
|
||||
return OnWalkAttribute(aNode->AsElement(), "background");
|
||||
}
|
||||
|
||||
if (content->IsHTMLElement(nsGkAtoms::script)) {
|
||||
return OnWalkAttribute(aNode, "src");
|
||||
if (aNode->IsHTMLElement(nsGkAtoms::script)) {
|
||||
return OnWalkAttribute(aNode->AsElement(), "src");
|
||||
}
|
||||
|
||||
if (content->IsSVGElement(nsGkAtoms::script)) {
|
||||
return OnWalkAttribute(aNode, "href", "http://www.w3.org/1999/xlink");
|
||||
if (aNode->IsSVGElement(nsGkAtoms::script)) {
|
||||
return OnWalkAttribute(aNode->AsElement(), "href",
|
||||
"http://www.w3.org/1999/xlink");
|
||||
}
|
||||
|
||||
if (content->IsHTMLElement(nsGkAtoms::embed)) {
|
||||
return OnWalkAttribute(aNode, "src");
|
||||
if (aNode->IsHTMLElement(nsGkAtoms::embed)) {
|
||||
return OnWalkAttribute(aNode->AsElement(), "src");
|
||||
}
|
||||
|
||||
if (content->IsHTMLElement(nsGkAtoms::object)) {
|
||||
return OnWalkAttribute(aNode, "data");
|
||||
if (aNode->IsHTMLElement(nsGkAtoms::object)) {
|
||||
return OnWalkAttribute(aNode->AsElement(), "data");
|
||||
}
|
||||
|
||||
if (auto nodeAsLink = dom::HTMLLinkElement::FromNode(content)) {
|
||||
if (auto nodeAsLink = dom::HTMLLinkElement::FromNode(aNode)) {
|
||||
// Test if the link has a rel value indicating it to be a stylesheet
|
||||
nsAutoString linkRel;
|
||||
nodeAsLink->GetRel(linkRel);
|
||||
@ -527,7 +520,7 @@ ResourceReader::OnWalkDOMNode(nsIDOMNode* aNode)
|
||||
// Store the link for fix up if it says "stylesheet"
|
||||
if (Substring(startWord, current)
|
||||
.LowerCaseEqualsLiteral("stylesheet")) {
|
||||
OnWalkAttribute(aNode, "href");
|
||||
OnWalkAttribute(aNode->AsElement(), "href");
|
||||
return NS_OK;
|
||||
}
|
||||
if (current == end) {
|
||||
@ -538,18 +531,18 @@ ResourceReader::OnWalkDOMNode(nsIDOMNode* aNode)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (content->IsHTMLElement(nsGkAtoms::frame)) {
|
||||
if (aNode->IsHTMLElement(nsGkAtoms::frame)) {
|
||||
return OnWalkSubframe(aNode);
|
||||
}
|
||||
|
||||
if (content->IsHTMLElement(nsGkAtoms::iframe) &&
|
||||
if (aNode->IsHTMLElement(nsGkAtoms::iframe) &&
|
||||
!(mPersistFlags & IWBP::PERSIST_FLAGS_IGNORE_IFRAMES)) {
|
||||
return OnWalkSubframe(aNode);
|
||||
}
|
||||
|
||||
auto nodeAsInput = dom::HTMLInputElement::FromNode(content);
|
||||
auto nodeAsInput = dom::HTMLInputElement::FromNode(aNode);
|
||||
if (nodeAsInput) {
|
||||
return OnWalkAttribute(aNode, "src");
|
||||
return OnWalkAttribute(aNode->AsElement(), "src");
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
@ -1161,7 +1154,7 @@ WebBrowserPersistLocalDocument::ReadResources(nsIWebBrowserPersistResourceVisito
|
||||
RefPtr<ResourceReader> reader = new ResourceReader(this, aVisitor);
|
||||
nsCOMPtr<nsINode> currentNode = walker->CurrentNode();
|
||||
do {
|
||||
rv = reader->OnWalkDOMNode(currentNode->AsDOMNode());
|
||||
rv = reader->OnWalkDOMNode(currentNode);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
break;
|
||||
}
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "nsXBLContentSink.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsBindingManager.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsIURI.h"
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIXPConnect.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsXBLPrototypeBinding.h"
|
||||
#include "nsXBLProtoImplProperty.h"
|
||||
#include "nsIURI.h"
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user