mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 682420 - Rename nsINode::GetOwnerDoc to nsINode::OwnerDoc, part 1, r=jst
--HG-- extra : rebase_source : baf1a25cdea68d499a7673fdf96e27b5a12dc83c
This commit is contained in:
parent
9cf38f71b6
commit
2c2da3099f
@ -103,7 +103,7 @@ AccEvent::GetDocAccessible()
|
||||
{
|
||||
nsINode *node = GetNode();
|
||||
if (node)
|
||||
return GetAccService()->GetDocAccessible(node->GetOwnerDoc());
|
||||
return GetAccService()->GetDocAccessible(node->OwnerDoc());
|
||||
|
||||
return nsnull;
|
||||
}
|
||||
|
@ -278,10 +278,10 @@ IDRefsIterator::IDRefsIterator(nsIContent* aContent, nsIAtom* aIDRefsAttr) :
|
||||
return;
|
||||
|
||||
if (aContent->IsInAnonymousSubtree()) {
|
||||
mXBLDocument = do_QueryInterface(aContent->GetOwnerDoc());
|
||||
mXBLDocument = do_QueryInterface(aContent->OwnerDoc());
|
||||
mBindingParent = do_QueryInterface(aContent->GetBindingParent());
|
||||
} else {
|
||||
mDocument = aContent->GetOwnerDoc();
|
||||
mDocument = aContent->OwnerDoc();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ FocusManager::IsFocused(const nsAccessible* aAccessible) const
|
||||
// peculiarity we would end up with plain implementation based on
|
||||
// FocusedAccessible() method call. Make sure this issue is fixed in
|
||||
// bug 638465.
|
||||
if (focusedNode->GetOwnerDoc() == aAccessible->GetNode()->GetOwnerDoc()) {
|
||||
if (focusedNode->OwnerDoc() == aAccessible->GetNode()->OwnerDoc()) {
|
||||
return aAccessible ==
|
||||
GetAccService()->GetAccessibleOrContainer(focusedNode, nsnull);
|
||||
}
|
||||
@ -145,7 +145,7 @@ FocusManager::NotifyOfDOMFocus(nsISupports* aTarget)
|
||||
nsCOMPtr<nsINode> targetNode(do_QueryInterface(aTarget));
|
||||
if (targetNode) {
|
||||
nsDocAccessible* document =
|
||||
GetAccService()->GetDocAccessible(targetNode->GetOwnerDoc());
|
||||
GetAccService()->GetDocAccessible(targetNode->OwnerDoc());
|
||||
if (document) {
|
||||
// Set selection listener for focused element.
|
||||
if (targetNode->IsElement()) {
|
||||
@ -171,8 +171,8 @@ FocusManager::NotifyOfDOMBlur(nsISupports* aTarget)
|
||||
// If DOM document stays focused then fire accessible focus event to process
|
||||
// the case when no element within this DOM document will be focused.
|
||||
nsCOMPtr<nsINode> targetNode(do_QueryInterface(aTarget));
|
||||
if (targetNode && targetNode->GetOwnerDoc() == FocusedDOMDocument()) {
|
||||
nsIDocument* DOMDoc = targetNode->GetOwnerDoc();
|
||||
if (targetNode && targetNode->OwnerDoc() == FocusedDOMDocument()) {
|
||||
nsIDocument* DOMDoc = targetNode->OwnerDoc();
|
||||
nsDocAccessible* document =
|
||||
GetAccService()->GetDocAccessible(DOMDoc);
|
||||
if (document) {
|
||||
@ -216,7 +216,7 @@ FocusManager::ForceFocusEvent()
|
||||
nsINode* focusedNode = FocusedDOMNode();
|
||||
if (focusedNode) {
|
||||
nsDocAccessible* document =
|
||||
GetAccService()->GetDocAccessible(focusedNode->GetOwnerDoc());
|
||||
GetAccService()->GetDocAccessible(focusedNode->OwnerDoc());
|
||||
if (document) {
|
||||
document->HandleNotification<FocusManager, nsINode>
|
||||
(this, &FocusManager::ProcessDOMFocus, focusedNode);
|
||||
@ -246,7 +246,7 @@ FocusManager::ProcessDOMFocus(nsINode* aTarget)
|
||||
"Notification target", aTarget)
|
||||
|
||||
nsDocAccessible* document =
|
||||
GetAccService()->GetDocAccessible(aTarget->GetOwnerDoc());
|
||||
GetAccService()->GetDocAccessible(aTarget->OwnerDoc());
|
||||
|
||||
nsAccessible* target = document->GetAccessibleOrContainer(aTarget);
|
||||
if (target) {
|
||||
|
@ -380,7 +380,7 @@ NotificationController::CoalesceEvents()
|
||||
// is supported. Ignore events from different documents since we don't
|
||||
// coalesce them.
|
||||
if (!thisEvent->mNode ||
|
||||
thisEvent->mNode->GetOwnerDoc() != tailEvent->mNode->GetOwnerDoc())
|
||||
thisEvent->mNode->OwnerDoc() != tailEvent->mNode->OwnerDoc())
|
||||
continue;
|
||||
|
||||
// Coalesce earlier event for the same target.
|
||||
|
@ -262,7 +262,7 @@ nsDocAccessible *
|
||||
nsAccessNode::GetDocAccessible() const
|
||||
{
|
||||
return mContent ?
|
||||
GetAccService()->GetDocAccessible(mContent->GetOwnerDoc()) : nsnull;
|
||||
GetAccService()->GetDocAccessible(mContent->OwnerDoc()) : nsnull;
|
||||
}
|
||||
|
||||
nsRootAccessible*
|
||||
@ -465,7 +465,7 @@ nsAccessNode::GetLanguage(nsAString& aLanguage)
|
||||
nsCoreUtils::GetLanguageFor(mContent, nsnull, aLanguage);
|
||||
|
||||
if (aLanguage.IsEmpty()) { // Nothing found, so use document's language
|
||||
nsIDocument *doc = mContent->GetOwnerDoc();
|
||||
nsIDocument *doc = mContent->OwnerDoc();
|
||||
if (doc) {
|
||||
doc->GetHeaderData(nsGkAtoms::headerContentLanguage, aLanguage);
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ public:
|
||||
virtual nsINode* GetNode() const { return mContent; }
|
||||
nsIContent* GetContent() const { return mContent; }
|
||||
virtual nsIDocument* GetDocumentNode() const
|
||||
{ return mContent ? mContent->GetOwnerDoc() : nsnull; }
|
||||
{ return mContent ? mContent->OwnerDoc() : nsnull; }
|
||||
|
||||
/**
|
||||
* Return node type information of DOM node associated with the accessible.
|
||||
|
@ -864,7 +864,7 @@ nsAccessibilityService::GetAccessible(nsINode* aNode)
|
||||
{
|
||||
NS_PRECONDITION(aNode, "Getting an accessible for null node! Crash.");
|
||||
|
||||
nsDocAccessible* document = GetDocAccessible(aNode->GetOwnerDoc());
|
||||
nsDocAccessible* document = GetDocAccessible(aNode->OwnerDoc());
|
||||
return document ? document->GetAccessible(aNode) : nsnull;
|
||||
}
|
||||
|
||||
@ -876,7 +876,7 @@ nsAccessibilityService::GetAccessibleOrContainer(nsINode* aNode,
|
||||
return nsnull;
|
||||
|
||||
// XXX: weak shell is ignored until multiple shell documents are supported.
|
||||
nsDocAccessible* document = GetDocAccessible(aNode->GetOwnerDoc());
|
||||
nsDocAccessible* document = GetDocAccessible(aNode->OwnerDoc());
|
||||
return document ? document->GetAccessibleOrContainer(aNode) : nsnull;
|
||||
}
|
||||
|
||||
@ -936,7 +936,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
if (aNode->GetOwnerDoc() != aPresShell->GetDocument()) {
|
||||
if (aNode->OwnerDoc() != aPresShell->GetDocument()) {
|
||||
NS_ERROR("Creating accessible for wrong pres shell");
|
||||
return nsnull;
|
||||
}
|
||||
@ -983,7 +983,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
|
||||
#endif
|
||||
|
||||
nsDocAccessible* docAcc =
|
||||
GetAccService()->GetDocAccessible(aNode->GetOwnerDoc());
|
||||
GetAccService()->GetDocAccessible(aNode->OwnerDoc());
|
||||
if (!docAcc) {
|
||||
NS_NOTREACHED("Node has no host document accessible!");
|
||||
return nsnull;
|
||||
|
@ -2101,7 +2101,7 @@ nsAccessible::RelationByType(PRUint32 aType)
|
||||
} else {
|
||||
// In XUL, use first <button default="true" .../> in the document
|
||||
nsCOMPtr<nsIDOMXULDocument> xulDoc =
|
||||
do_QueryInterface(mContent->GetOwnerDoc());
|
||||
do_QueryInterface(mContent->OwnerDoc());
|
||||
nsCOMPtr<nsIDOMXULButtonElement> buttonEl;
|
||||
if (xulDoc) {
|
||||
nsCOMPtr<nsIDOMNodeList> possibleDefaultButtons;
|
||||
@ -2769,7 +2769,7 @@ nsAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
|
||||
mContent->GetAttr(kNameSpaceID_XLink, nsGkAtoms::href, href);
|
||||
|
||||
nsCOMPtr<nsIURI> baseURI = mContent->GetBaseURI();
|
||||
nsCOMPtr<nsIDocument> document = mContent->GetOwnerDoc();
|
||||
nsCOMPtr<nsIDocument> document = mContent->OwnerDoc();
|
||||
nsIURI* anchorURI = nsnull;
|
||||
NS_NewURI(&anchorURI, href,
|
||||
document ? document->GetDocumentCharacterSet().get() : nsnull,
|
||||
@ -2942,7 +2942,7 @@ nsAccessible::CurrentItem()
|
||||
nsAutoString id;
|
||||
if (mContent->GetAttr(kNameSpaceID_None,
|
||||
nsGkAtoms::aria_activedescendant, id)) {
|
||||
nsIDocument* DOMDoc = mContent->GetOwnerDoc();
|
||||
nsIDocument* DOMDoc = mContent->OwnerDoc();
|
||||
dom::Element* activeDescendantElm = DOMDoc->GetElementById(id);
|
||||
if (activeDescendantElm) {
|
||||
nsDocAccessible* document = GetDocAccessible();
|
||||
@ -3057,7 +3057,7 @@ nsAccessible::GetFirstAvailableAccessible(nsINode *aStartNode) const
|
||||
if (accessible)
|
||||
return accessible;
|
||||
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(aStartNode->GetOwnerDoc());
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(aStartNode->OwnerDoc());
|
||||
NS_ENSURE_TRUE(domDoc, nsnull);
|
||||
|
||||
nsCOMPtr<nsIDOMNode> currentNode = do_QueryInterface(aStartNode);
|
||||
|
@ -386,7 +386,7 @@ nsCaretAccessible::GetSelectionControllerForNode(nsIContent *aContent)
|
||||
if (!aContent)
|
||||
return nsnull;
|
||||
|
||||
nsIDocument *document = aContent->GetOwnerDoc();
|
||||
nsIDocument *document = aContent->OwnerDoc();
|
||||
if (!document)
|
||||
return nsnull;
|
||||
|
||||
|
@ -207,7 +207,7 @@ nsCoreUtils::GetAccessKeyFor(nsIContent *aContent)
|
||||
if (!aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::accesskey))
|
||||
return 0;
|
||||
|
||||
nsCOMPtr<nsIDocument> doc = aContent->GetOwnerDoc();
|
||||
nsCOMPtr<nsIDocument> doc = aContent->OwnerDoc();
|
||||
if (!doc)
|
||||
return 0;
|
||||
|
||||
@ -439,7 +439,7 @@ nsCoreUtils::GetDocShellTreeItemFor(nsINode *aNode)
|
||||
if (!aNode)
|
||||
return nsnull;
|
||||
|
||||
nsIDocument *doc = aNode->GetOwnerDoc();
|
||||
nsIDocument *doc = aNode->OwnerDoc();
|
||||
NS_ASSERTION(doc, "No document for node passed in");
|
||||
NS_ENSURE_TRUE(doc, nsnull);
|
||||
|
||||
@ -603,7 +603,7 @@ nsCoreUtils::GetComputedStyleDeclaration(const nsAString& aPseudoElt,
|
||||
return nsnull;
|
||||
|
||||
// Returns number of items in style declaration
|
||||
nsIDocument* document = content->GetOwnerDoc();
|
||||
nsIDocument* document = content->OwnerDoc();
|
||||
if (!document)
|
||||
return nsnull;
|
||||
|
||||
|
@ -254,7 +254,7 @@ public:
|
||||
*/
|
||||
static nsIPresShell *GetPresShellFor(nsINode *aNode)
|
||||
{
|
||||
nsIDocument *document = aNode->GetOwnerDoc();
|
||||
nsIDocument *document = aNode->OwnerDoc();
|
||||
return document ? document->GetShell() : nsnull;
|
||||
}
|
||||
static already_AddRefed<nsIWeakReference> GetWeakShellFor(nsINode *aNode)
|
||||
|
@ -1182,7 +1182,7 @@ nsDocAccessible::ARIAActiveDescendantChanged(nsIContent* aElm)
|
||||
if (FocusMgr()->HasDOMFocus(aElm)) {
|
||||
nsAutoString id;
|
||||
if (aElm->GetAttr(kNameSpaceID_None, nsGkAtoms::aria_activedescendant, id)) {
|
||||
nsIDocument* DOMDoc = aElm->GetOwnerDoc();
|
||||
nsIDocument* DOMDoc = aElm->OwnerDoc();
|
||||
dom::Element* activeDescendantElm = DOMDoc->GetElementById(id);
|
||||
if (activeDescendantElm) {
|
||||
nsAccessible* activeDescendant = GetAccessible(activeDescendantElm);
|
||||
|
@ -324,7 +324,7 @@ nsRootAccessible::HandleEvent(nsIDOMEvent* aDOMEvent)
|
||||
return NS_OK;
|
||||
|
||||
nsDocAccessible* document =
|
||||
GetAccService()->GetDocAccessible(origTargetNode->GetOwnerDoc());
|
||||
GetAccService()->GetDocAccessible(origTargetNode->OwnerDoc());
|
||||
|
||||
if (document) {
|
||||
#ifdef DEBUG_NOTIFICATIONS
|
||||
|
@ -201,7 +201,7 @@ nsHTMLRadioButtonAccessible::GetPositionAndSizeInternal(PRInt32 *aPosInSet,
|
||||
if (form) {
|
||||
form->GetElementsByTagNameNS(nsURI, tagName, getter_AddRefs(inputs));
|
||||
} else {
|
||||
nsIDocument* doc = mContent->GetOwnerDoc();
|
||||
nsIDocument* doc = mContent->OwnerDoc();
|
||||
nsCOMPtr<nsIDOMDocument> document(do_QueryInterface(doc));
|
||||
if (document)
|
||||
document->GetElementsByTagNameNS(nsURI, tagName, getter_AddRefs(inputs));
|
||||
|
@ -167,7 +167,7 @@ nsHTMLImageAccessible::DoAction(PRUint8 aIndex)
|
||||
nsresult rv = element->GetLongDesc(longDesc);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsIDocument* document = mContent->GetOwnerDoc();
|
||||
nsIDocument* document = mContent->OwnerDoc();
|
||||
nsCOMPtr<nsPIDOMWindow> piWindow = document->GetWindow();
|
||||
nsCOMPtr<nsIDOMWindow> win = do_QueryInterface(piWindow);
|
||||
NS_ENSURE_TRUE(win, NS_ERROR_FAILURE);
|
||||
|
@ -463,7 +463,7 @@ nsXULMenuitemAccessible::KeyboardShortcut() const
|
||||
if (keyElmId.IsEmpty())
|
||||
return KeyBinding();
|
||||
|
||||
nsIDocument* document = mContent->GetOwnerDoc();
|
||||
nsIDocument* document = mContent->OwnerDoc();
|
||||
if (!document)
|
||||
return KeyBinding();
|
||||
|
||||
|
@ -204,7 +204,7 @@ nsXULSliderAccessible::GetSliderNode()
|
||||
return nsnull;
|
||||
|
||||
if (!mSliderNode) {
|
||||
nsIDocument* document = mContent->GetOwnerDoc();
|
||||
nsIDocument* document = mContent->OwnerDoc();
|
||||
if (!document)
|
||||
return nsnull;
|
||||
|
||||
|
@ -257,7 +257,7 @@ nsXULLinkAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
|
||||
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::href, href);
|
||||
|
||||
nsCOMPtr<nsIURI> baseURI = mContent->GetBaseURI();
|
||||
nsIDocument* document = mContent->GetOwnerDoc();
|
||||
nsIDocument* document = mContent->OwnerDoc();
|
||||
|
||||
nsIURI* anchorURI = nsnull;
|
||||
NS_NewURI(&anchorURI, href,
|
||||
|
@ -175,7 +175,7 @@ nsMacShellService::SetDesktopBackground(nsIDOMElement* aElement,
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(aElement, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
doc = content->GetOwnerDoc();
|
||||
doc = content->OwnerDoc();
|
||||
if (!doc)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
|
@ -294,7 +294,7 @@ NS_CP_GetDocShellFromContext(nsISupports *aContext)
|
||||
// hopefully
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(aContext);
|
||||
if (content) {
|
||||
doc = content->GetOwnerDoc();
|
||||
doc = content->OwnerDoc();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -278,7 +278,7 @@ public:
|
||||
*/
|
||||
inline bool IsInHTMLDocument() const
|
||||
{
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
return doc && // XXX clean up after bug 335998 lands
|
||||
doc->IsHTML();
|
||||
}
|
||||
|
@ -1888,7 +1888,7 @@ NS_NewPluginDocument(nsIDocument** aInstancePtrResult);
|
||||
inline nsIDocument*
|
||||
nsINode::GetOwnerDocument() const
|
||||
{
|
||||
nsIDocument* ownerDoc = GetOwnerDoc();
|
||||
nsIDocument* ownerDoc = OwnerDoc();
|
||||
|
||||
return ownerDoc != this ? ownerDoc : nsnull;
|
||||
}
|
||||
|
@ -283,8 +283,8 @@ private:
|
||||
|
||||
// IID for the nsINode interface
|
||||
#define NS_INODE_IID \
|
||||
{ 0x38f966a0, 0xd652, 0x4979, \
|
||||
{ 0xae, 0x37, 0xc8, 0x75, 0x84, 0xfc, 0xf8, 0x43 } }
|
||||
{ 0x20d16be2, 0x3c58, 0x4099, \
|
||||
{ 0xbf, 0xa6, 0xd0, 0xe7, 0x6b, 0xb1, 0x3d, 0xc5 } }
|
||||
|
||||
/**
|
||||
* An internal interface that abstracts some DOMNode-related parts that both
|
||||
@ -415,7 +415,7 @@ public:
|
||||
* nsIDocument GetOwnerDocument returns the document itself. For nsIContent
|
||||
* implementations the two are the same.
|
||||
*/
|
||||
nsIDocument *GetOwnerDoc() const
|
||||
nsIDocument *OwnerDoc() const
|
||||
{
|
||||
return mNodeInfo->GetDocument();
|
||||
}
|
||||
@ -438,7 +438,7 @@ public:
|
||||
*/
|
||||
nsIDocument *GetCurrentDoc() const
|
||||
{
|
||||
return IsInDoc() ? GetOwnerDoc() : nsnull;
|
||||
return IsInDoc() ? OwnerDoc() : nsnull;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -847,7 +847,7 @@ nsContentList::Match(Element *aElement)
|
||||
if (toReturn)
|
||||
return toReturn;
|
||||
|
||||
nsIDocument* doc = aElement->GetOwnerDoc();
|
||||
nsIDocument* doc = aElement->OwnerDoc();
|
||||
bool matchHTML = aElement->GetNameSpaceID() == kNameSpaceID_XHTML &&
|
||||
doc && doc->IsHTML();
|
||||
|
||||
|
@ -133,7 +133,7 @@ nsContentPolicy::CheckPolicy(CPMethod policyMethod,
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
nsCOMPtr<nsIContent> node = do_QueryInterface(requestingContext);
|
||||
if (node) {
|
||||
doc = node->GetOwnerDoc();
|
||||
doc = node->OwnerDoc();
|
||||
}
|
||||
if (!doc) {
|
||||
doc = do_QueryInterface(requestingContext);
|
||||
|
@ -3247,7 +3247,7 @@ nsContentUtils::HasMutationListeners(nsINode* aNode,
|
||||
PRUint32 aType,
|
||||
nsINode* aTargetForSubtreeModified)
|
||||
{
|
||||
nsIDocument* doc = aNode->GetOwnerDoc();
|
||||
nsIDocument* doc = aNode->OwnerDoc();
|
||||
if (!doc) {
|
||||
return false;
|
||||
}
|
||||
@ -3321,7 +3321,7 @@ nsContentUtils::MaybeFireNodeRemoved(nsINode* aChild, nsINode* aParent,
|
||||
{
|
||||
NS_PRECONDITION(aChild, "Missing child");
|
||||
NS_PRECONDITION(aChild->GetNodeParent() == aParent, "Wrong parent");
|
||||
NS_PRECONDITION(aChild->GetOwnerDoc() == aOwnerDoc, "Wrong owner-doc");
|
||||
NS_PRECONDITION(aChild->OwnerDoc() == aOwnerDoc, "Wrong owner-doc");
|
||||
|
||||
// This checks that IsSafeToRunScript is true since we don't want to fire
|
||||
// events when that is false. We can't rely on nsEventDispatcher to assert
|
||||
@ -3493,7 +3493,7 @@ nsContentUtils::CreateContextualFragment(nsINode* aContextNode,
|
||||
|
||||
// If we don't have a document here, we can't get the right security context
|
||||
// for compiling event handlers... so just bail out.
|
||||
nsCOMPtr<nsIDocument> document = aContextNode->GetOwnerDoc();
|
||||
nsCOMPtr<nsIDocument> document = aContextNode->OwnerDoc();
|
||||
NS_ENSURE_TRUE(document, NS_ERROR_NOT_AVAILABLE);
|
||||
|
||||
bool isHTML = document->IsHTML();
|
||||
@ -3736,7 +3736,7 @@ nsContentUtils::SetNodeTextContent(nsIContent* aContent,
|
||||
{
|
||||
// We're relying on mozAutoSubtreeModified to keep a strong reference if
|
||||
// needed.
|
||||
nsIDocument* doc = aContent->GetOwnerDoc();
|
||||
nsIDocument* doc = aContent->OwnerDoc();
|
||||
|
||||
// Optimize the common case of there being no observers
|
||||
if (HasMutationListeners(doc, NS_EVENT_BITS_MUTATION_NODEREMOVED)) {
|
||||
@ -3885,7 +3885,7 @@ public:
|
||||
AnonymousContentDestroyer(nsCOMPtr<nsIContent>* aContent) {
|
||||
mContent.swap(*aContent);
|
||||
mParent = mContent->GetParent();
|
||||
mDoc = mContent->GetOwnerDoc();
|
||||
mDoc = mContent->OwnerDoc();
|
||||
}
|
||||
NS_IMETHOD Run() {
|
||||
mContent->UnbindFromTree();
|
||||
@ -4736,7 +4736,7 @@ nsContentUtils::GetContextForEventHandlers(nsINode* aNode,
|
||||
nsresult* aRv)
|
||||
{
|
||||
*aRv = NS_OK;
|
||||
nsIDocument* ownerDoc = aNode->GetOwnerDoc();
|
||||
nsIDocument* ownerDoc = aNode->OwnerDoc();
|
||||
if (!ownerDoc) {
|
||||
*aRv = NS_ERROR_UNEXPECTED;
|
||||
return nsnull;
|
||||
@ -5185,7 +5185,7 @@ nsContentUtils::DispatchXULCommand(nsIContent* aTarget,
|
||||
bool aMeta)
|
||||
{
|
||||
NS_ENSURE_STATE(aTarget);
|
||||
nsIDocument* doc = aTarget->GetOwnerDoc();
|
||||
nsIDocument* doc = aTarget->OwnerDoc();
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(doc);
|
||||
NS_ENSURE_STATE(domDoc);
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
@ -5354,8 +5354,8 @@ AllocClassMatchingInfo(nsINode* aRootNode,
|
||||
}
|
||||
|
||||
info->mCaseTreatment =
|
||||
aRootNode->GetOwnerDoc() &&
|
||||
aRootNode->GetOwnerDoc()->GetCompatibilityMode() == eCompatibility_NavQuirks ?
|
||||
aRootNode->OwnerDoc() &&
|
||||
aRootNode->OwnerDoc()->GetCompatibilityMode() == eCompatibility_NavQuirks ?
|
||||
eIgnoreCase : eCaseMatters;
|
||||
return info;
|
||||
}
|
||||
@ -5482,7 +5482,7 @@ nsContentUtils::IsSubDocumentTabbable(nsIContent* aContent)
|
||||
return false;
|
||||
}
|
||||
|
||||
// XXXbz should this use GetOwnerDoc() for GetSubDocumentFor?
|
||||
// XXXbz should this use OwnerDoc() for GetSubDocumentFor?
|
||||
// sXBL/XBL2 issue!
|
||||
nsIDocument* subDoc = doc->GetSubDocumentFor(aContent);
|
||||
if (!subDoc) {
|
||||
|
@ -179,7 +179,7 @@ nsDOMAttribute::SetOwnerDocument(nsIDocument* aDocument)
|
||||
{
|
||||
NS_ASSERTION(aDocument, "Missing document");
|
||||
|
||||
nsIDocument *doc = GetOwnerDoc();
|
||||
nsIDocument *doc = OwnerDoc();
|
||||
NS_ASSERTION(doc != aDocument, "bad call to nsDOMAttribute::SetOwnerDocument");
|
||||
if (doc) {
|
||||
doc->DeleteAllPropertiesFor(this);
|
||||
@ -275,7 +275,7 @@ NS_IMETHODIMP
|
||||
nsDOMAttribute::GetSpecified(bool* aSpecified)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aSpecified);
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eSpecified);
|
||||
}
|
||||
@ -288,7 +288,7 @@ nsDOMAttribute::GetOwnerElement(nsIDOMElement** aOwnerElement)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aOwnerElement);
|
||||
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eOwnerElement);
|
||||
}
|
||||
@ -306,7 +306,7 @@ nsDOMAttribute::GetOwnerElement(nsIDOMElement** aOwnerElement)
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::GetNodeName(nsAString& aNodeName)
|
||||
{
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eNodeName);
|
||||
}
|
||||
@ -317,7 +317,7 @@ nsDOMAttribute::GetNodeName(nsAString& aNodeName)
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::GetNodeValue(nsAString& aNodeValue)
|
||||
{
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eNodeValue);
|
||||
}
|
||||
@ -328,7 +328,7 @@ nsDOMAttribute::GetNodeValue(nsAString& aNodeValue)
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::SetNodeValue(const nsAString& aNodeValue)
|
||||
{
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eNodeValue);
|
||||
}
|
||||
@ -341,7 +341,7 @@ nsDOMAttribute::GetNodeType(PRUint16* aNodeType)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aNodeType);
|
||||
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eNodeType);
|
||||
}
|
||||
@ -355,7 +355,7 @@ nsDOMAttribute::GetParentNode(nsIDOMNode** aParentNode)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aParentNode);
|
||||
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eParentNode);
|
||||
}
|
||||
@ -374,7 +374,7 @@ nsDOMAttribute::GetParentElement(nsIDOMElement** aParentElement)
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::GetChildNodes(nsIDOMNodeList** aChildNodes)
|
||||
{
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eChildNodes);
|
||||
}
|
||||
@ -385,7 +385,7 @@ nsDOMAttribute::GetChildNodes(nsIDOMNodeList** aChildNodes)
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::HasChildNodes(bool* aHasChildNodes)
|
||||
{
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eHasChildNodes);
|
||||
}
|
||||
@ -400,7 +400,7 @@ nsDOMAttribute::HasAttributes(bool* aHasAttributes)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aHasAttributes);
|
||||
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eHasAttributes);
|
||||
}
|
||||
@ -415,7 +415,7 @@ nsDOMAttribute::GetFirstChild(nsIDOMNode** aFirstChild)
|
||||
{
|
||||
*aFirstChild = nsnull;
|
||||
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eFirstChild);
|
||||
}
|
||||
@ -430,7 +430,7 @@ nsDOMAttribute::GetFirstChild(nsIDOMNode** aFirstChild)
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::GetLastChild(nsIDOMNode** aLastChild)
|
||||
{
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eLastChild);
|
||||
}
|
||||
@ -442,7 +442,7 @@ nsDOMAttribute::GetPreviousSibling(nsIDOMNode** aPreviousSibling)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aPreviousSibling);
|
||||
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::ePreviousSibling);
|
||||
}
|
||||
@ -456,7 +456,7 @@ nsDOMAttribute::GetNextSibling(nsIDOMNode** aNextSibling)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aNextSibling);
|
||||
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eNextSibling);
|
||||
}
|
||||
@ -470,7 +470,7 @@ nsDOMAttribute::GetAttributes(nsIDOMNamedNodeMap** aAttributes)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aAttributes);
|
||||
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eAttributes);
|
||||
}
|
||||
@ -482,7 +482,7 @@ nsDOMAttribute::GetAttributes(nsIDOMNamedNodeMap** aAttributes)
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::InsertBefore(nsIDOMNode* aNewChild, nsIDOMNode* aRefChild, nsIDOMNode** aReturn)
|
||||
{
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eInsertBefore);
|
||||
}
|
||||
@ -493,7 +493,7 @@ nsDOMAttribute::InsertBefore(nsIDOMNode* aNewChild, nsIDOMNode* aRefChild, nsIDO
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::ReplaceChild(nsIDOMNode* aNewChild, nsIDOMNode* aOldChild, nsIDOMNode** aReturn)
|
||||
{
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eReplaceChild);
|
||||
}
|
||||
@ -504,7 +504,7 @@ nsDOMAttribute::ReplaceChild(nsIDOMNode* aNewChild, nsIDOMNode* aOldChild, nsIDO
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::RemoveChild(nsIDOMNode* aOldChild, nsIDOMNode** aReturn)
|
||||
{
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eRemoveChild);
|
||||
}
|
||||
@ -515,7 +515,7 @@ nsDOMAttribute::RemoveChild(nsIDOMNode* aOldChild, nsIDOMNode** aReturn)
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::AppendChild(nsIDOMNode* aNewChild, nsIDOMNode** aReturn)
|
||||
{
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eAppendChild);
|
||||
}
|
||||
@ -543,7 +543,7 @@ nsDOMAttribute::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::CloneNode(bool aDeep, nsIDOMNode** aResult)
|
||||
{
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eCloneNode);
|
||||
}
|
||||
@ -554,7 +554,7 @@ nsDOMAttribute::CloneNode(bool aDeep, nsIDOMNode** aResult)
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::GetOwnerDocument(nsIDOMDocument** aOwnerDocument)
|
||||
{
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eOwnerDocument);
|
||||
}
|
||||
@ -585,7 +585,7 @@ nsDOMAttribute::GetLocalName(nsAString& aLocalName)
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::Normalize()
|
||||
{
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eNormalize);
|
||||
}
|
||||
@ -599,7 +599,7 @@ nsDOMAttribute::IsSupported(const nsAString& aFeature,
|
||||
const nsAString& aVersion,
|
||||
bool* aReturn)
|
||||
{
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eIsSupported);
|
||||
}
|
||||
@ -631,7 +631,7 @@ nsDOMAttribute::CompareDocumentPosition(nsIDOMNode *other,
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::IsEqualNode(nsIDOMNode* aOther, bool* aResult)
|
||||
{
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eIsEqualNode);
|
||||
}
|
||||
@ -641,7 +641,7 @@ nsDOMAttribute::IsEqualNode(nsIDOMNode* aOther, bool* aResult)
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::GetTextContent(nsAString &aTextContent)
|
||||
{
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eTextContent);
|
||||
}
|
||||
@ -651,7 +651,7 @@ nsDOMAttribute::GetTextContent(nsAString &aTextContent)
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::SetTextContent(const nsAString& aTextContent)
|
||||
{
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eTextContent);
|
||||
}
|
||||
@ -661,7 +661,7 @@ nsDOMAttribute::SetTextContent(const nsAString& aTextContent)
|
||||
NS_IMETHODIMP
|
||||
nsDOMAttribute::IsSameNode(nsIDOMNode *other, bool *aResult)
|
||||
{
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eIsSameNode);
|
||||
}
|
||||
@ -793,7 +793,7 @@ nsDOMAttribute::RemoveChildAt(PRUint32 aIndex, bool aNotify)
|
||||
{
|
||||
nsCOMPtr<nsIContent> child = mChild;
|
||||
nsMutationGuard::DidMutate();
|
||||
mozAutoDocUpdate updateBatch(GetOwnerDoc(), UPDATE_CONTENT_MODEL, aNotify);
|
||||
mozAutoDocUpdate updateBatch(OwnerDoc(), UPDATE_CONTENT_MODEL, aNotify);
|
||||
|
||||
doRemoveChild(aNotify);
|
||||
}
|
||||
|
@ -299,7 +299,7 @@ nsDOMAttributeMap::SetNamedItemInternal(nsIDOMNode *aNode,
|
||||
|
||||
if (!mContent->HasSameOwnerDoc(iAttribute)) {
|
||||
nsCOMPtr<nsIDOMDocument> domDoc =
|
||||
do_QueryInterface(mContent->GetOwnerDoc(), &rv);
|
||||
do_QueryInterface(mContent->OwnerDoc(), &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIDOMNode> adoptedNode;
|
||||
|
@ -65,7 +65,7 @@ nsDataDocumentContentPolicy::ShouldLoad(PRUint32 aContentType,
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
nsCOMPtr<nsINode> node = do_QueryInterface(aRequestingContext);
|
||||
if (node) {
|
||||
doc = node->GetOwnerDoc();
|
||||
doc = node->OwnerDoc();
|
||||
} else {
|
||||
nsCOMPtr<nsIDOMWindow> window = do_QueryInterface(aRequestingContext);
|
||||
if (window) {
|
||||
|
@ -400,8 +400,8 @@ nsIdentifierMapEntry::RemoveIdElement(Element* aElement)
|
||||
// This could fire in OOM situations
|
||||
// Only assert this in HTML documents for now as XUL does all sorts of weird
|
||||
// crap.
|
||||
NS_ASSERTION(!aElement->GetOwnerDoc() ||
|
||||
!aElement->GetOwnerDoc()->IsHTML() ||
|
||||
NS_ASSERTION(!aElement->OwnerDoc() ||
|
||||
!aElement->OwnerDoc()->IsHTML() ||
|
||||
mIdContentList.IndexOf(aElement) >= 0,
|
||||
"Removing id entry that doesn't exist");
|
||||
|
||||
@ -1128,7 +1128,7 @@ nsExternalResourceMap::PendingLoad::StartLoad(nsIURI* aURI,
|
||||
return NS_ERROR_CONTENT_BLOCKED;
|
||||
}
|
||||
|
||||
nsIDocument* doc = aRequestingNode->GetOwnerDoc();
|
||||
nsIDocument* doc = aRequestingNode->OwnerDoc();
|
||||
if (!doc) {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
@ -2007,7 +2007,7 @@ nsDocument::Init()
|
||||
NS_ABORT_IF_FALSE(mNodeInfo->NodeType() == nsIDOMNode::DOCUMENT_NODE,
|
||||
"Bad NodeType in aNodeInfo");
|
||||
|
||||
NS_ASSERTION(GetOwnerDoc() == this, "Our nodeinfo is busted!");
|
||||
NS_ASSERTION(OwnerDoc() == this, "Our nodeinfo is busted!");
|
||||
|
||||
mScriptLoader = new nsScriptLoader(this);
|
||||
NS_ENSURE_TRUE(mScriptLoader, NS_ERROR_OUT_OF_MEMORY);
|
||||
@ -2726,7 +2726,7 @@ nsDocument::GetActiveElement(nsIDOMElement **aElement)
|
||||
nsFocusManager::GetFocusedDescendant(window, false,
|
||||
getter_AddRefs(focusedWindow));
|
||||
// be safe and make sure the element is from this document
|
||||
if (focusedContent && focusedContent->GetOwnerDoc() == this) {
|
||||
if (focusedContent && focusedContent->OwnerDoc() == this) {
|
||||
CallQueryInterface(focusedContent, aElement);
|
||||
return NS_OK;
|
||||
}
|
||||
@ -4815,7 +4815,7 @@ nsDocument::ImportNode(nsIDOMNode* aImportedNode,
|
||||
nodesWithProperties, getter_AddRefs(newNode));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsIDocument *ownerDoc = imported->GetOwnerDoc();
|
||||
nsIDocument *ownerDoc = imported->OwnerDoc();
|
||||
if (ownerDoc) {
|
||||
rv = nsNodeUtils::CallUserDataHandlers(nodesWithProperties, ownerDoc,
|
||||
nsIDOMUserDataHandler::NODE_IMPORTED,
|
||||
@ -5292,7 +5292,7 @@ nsDocument::GetBoxObjectFor(nsIDOMElement* aElement, nsIBoxObject** aResult)
|
||||
nsCOMPtr<nsIContent> content(do_QueryInterface(aElement));
|
||||
NS_ENSURE_TRUE(content, NS_ERROR_UNEXPECTED);
|
||||
|
||||
nsIDocument* doc = content->GetOwnerDoc();
|
||||
nsIDocument* doc = content->OwnerDoc();
|
||||
NS_ENSURE_TRUE(doc == this, NS_ERROR_DOM_WRONG_DOCUMENT_ERR);
|
||||
|
||||
if (!mHasWarnedAboutBoxObjects && !content->IsXUL()) {
|
||||
@ -6020,7 +6020,7 @@ nsDocument::AdoptNode(nsIDOMNode *aAdoptedNode, nsIDOMNode **aResult)
|
||||
nsINode* parent = adoptedNode->GetNodeParent();
|
||||
if (parent) {
|
||||
nsContentUtils::MaybeFireNodeRemoved(adoptedNode, parent,
|
||||
adoptedNode->GetOwnerDoc());
|
||||
adoptedNode->OwnerDoc());
|
||||
}
|
||||
}
|
||||
|
||||
@ -6102,7 +6102,7 @@ nsDocument::AdoptNode(nsIDOMNode *aAdoptedNode, nsIDOMNode **aResult)
|
||||
}
|
||||
}
|
||||
|
||||
nsIDocument *oldDocument = adoptedNode->GetOwnerDoc();
|
||||
nsIDocument *oldDocument = adoptedNode->OwnerDoc();
|
||||
bool sameDocument = oldDocument == this;
|
||||
|
||||
JSContext *cx = nsnull;
|
||||
@ -6162,7 +6162,7 @@ nsDocument::AdoptNode(nsIDOMNode *aAdoptedNode, nsIDOMNode **aResult)
|
||||
this));
|
||||
}
|
||||
|
||||
NS_ASSERTION(adoptedNode->GetOwnerDoc() == this,
|
||||
NS_ASSERTION(adoptedNode->OwnerDoc() == this,
|
||||
"Should still be in the document we just got adopted into");
|
||||
|
||||
return CallQueryInterface(adoptedNode, aResult);
|
||||
|
@ -339,7 +339,7 @@ nsFrameLoader*
|
||||
nsFrameLoader::Create(Element* aOwner, bool aNetworkCreated)
|
||||
{
|
||||
NS_ENSURE_TRUE(aOwner, nsnull);
|
||||
nsIDocument* doc = aOwner->GetOwnerDoc();
|
||||
nsIDocument* doc = aOwner->OwnerDoc();
|
||||
NS_ENSURE_TRUE(doc && !doc->GetDisplayDocument() &&
|
||||
((!doc->IsLoadedAsData() && aOwner->GetCurrentDoc()) ||
|
||||
doc->IsStaticDocument()),
|
||||
@ -362,7 +362,7 @@ nsFrameLoader::LoadFrame()
|
||||
src.AssignLiteral("about:blank");
|
||||
}
|
||||
|
||||
nsIDocument* doc = mOwnerContent->GetOwnerDoc();
|
||||
nsIDocument* doc = mOwnerContent->OwnerDoc();
|
||||
if (!doc || doc->IsStaticDocument()) {
|
||||
return NS_OK;
|
||||
}
|
||||
@ -411,7 +411,7 @@ nsFrameLoader::LoadURI(nsIURI* aURI)
|
||||
return NS_ERROR_INVALID_POINTER;
|
||||
NS_ENSURE_STATE(!mDestroyCalled && mOwnerContent);
|
||||
|
||||
nsCOMPtr<nsIDocument> doc = mOwnerContent->GetOwnerDoc();
|
||||
nsCOMPtr<nsIDocument> doc = mOwnerContent->OwnerDoc();
|
||||
if (!doc) {
|
||||
return NS_OK;
|
||||
}
|
||||
@ -1274,7 +1274,7 @@ nsFrameLoader::Destroy()
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
bool dynamicSubframeRemoval = false;
|
||||
if (mOwnerContent) {
|
||||
doc = mOwnerContent->GetOwnerDoc();
|
||||
doc = mOwnerContent->OwnerDoc();
|
||||
|
||||
if (doc) {
|
||||
dynamicSubframeRemoval = !mIsTopLevelContent && !doc->InUnlinkOrDeletion();
|
||||
@ -1382,7 +1382,7 @@ nsFrameLoader::MaybeCreateDocShell()
|
||||
// Get our parent docshell off the document of mOwnerContent
|
||||
// XXXbz this is such a total hack.... We really need to have a
|
||||
// better setup for doing this.
|
||||
nsIDocument* doc = mOwnerContent->GetOwnerDoc();
|
||||
nsIDocument* doc = mOwnerContent->OwnerDoc();
|
||||
if (!doc || !(doc->IsStaticDocument() || mOwnerContent->IsInDoc())) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
@ -2074,7 +2074,7 @@ nsFrameLoader::EnsureMessageManager()
|
||||
NS_ENSURE_STATE(cx);
|
||||
|
||||
nsCOMPtr<nsIDOMChromeWindow> chromeWindow =
|
||||
do_QueryInterface(mOwnerContent->GetOwnerDoc()->GetWindow());
|
||||
do_QueryInterface(mOwnerContent->OwnerDoc()->GetWindow());
|
||||
NS_ENSURE_STATE(chromeWindow);
|
||||
nsCOMPtr<nsIChromeFrameMessageManager> parentManager;
|
||||
chromeWindow->GetMessageManager(getter_AddRefs(parentManager));
|
||||
|
@ -245,8 +245,8 @@ public:
|
||||
* Return the document that owns this, or null if we don't have
|
||||
* an owner.
|
||||
*/
|
||||
nsIDocument* GetOwnerDoc() const
|
||||
{ return mOwnerContent ? mOwnerContent->GetOwnerDoc() : nsnull; }
|
||||
nsIDocument* OwnerDoc() const
|
||||
{ return mOwnerContent ? mOwnerContent->OwnerDoc() : nsnull; }
|
||||
|
||||
PBrowserParent* GetRemoteBrowser();
|
||||
|
||||
|
@ -106,7 +106,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsGenericDOMDataNode)
|
||||
return NS_SUCCESS_INTERRUPTED_TRAVERSE;
|
||||
}
|
||||
|
||||
nsIDocument* ownerDoc = tmp->GetOwnerDoc();
|
||||
nsIDocument* ownerDoc = tmp->OwnerDoc();
|
||||
if (ownerDoc) {
|
||||
ownerDoc->BindingManager()->Traverse(tmp, cb);
|
||||
}
|
||||
@ -389,7 +389,7 @@ nsGenericDOMDataNode::SetTextInternal(PRUint32 aOffset, PRUint32 aCount,
|
||||
mutation.mNewAttrValue = do_GetAtom(val);
|
||||
}
|
||||
|
||||
mozAutoSubtreeModified subtree(GetOwnerDoc(), this);
|
||||
mozAutoSubtreeModified subtree(OwnerDoc(), this);
|
||||
(new nsPLDOMEvent(this, mutation))->RunDOMEventWhenSafe();
|
||||
}
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ public:
|
||||
NS_IMETHOD SetTextContent(const nsAString& aTextContent)
|
||||
{
|
||||
// Batch possible DOMSubtreeModified events.
|
||||
mozAutoSubtreeModified subtree(GetOwnerDoc(), nsnull);
|
||||
mozAutoSubtreeModified subtree(OwnerDoc(), nsnull);
|
||||
return SetNodeValue(aTextContent);
|
||||
}
|
||||
|
||||
|
@ -217,7 +217,7 @@ void*
|
||||
nsINode::GetProperty(PRUint16 aCategory, nsIAtom *aPropertyName,
|
||||
nsresult *aStatus) const
|
||||
{
|
||||
nsIDocument *doc = GetOwnerDoc();
|
||||
nsIDocument *doc = OwnerDoc();
|
||||
if (!doc)
|
||||
return nsnull;
|
||||
|
||||
@ -230,7 +230,7 @@ nsINode::SetProperty(PRUint16 aCategory, nsIAtom *aPropertyName, void *aValue,
|
||||
NSPropertyDtorFunc aDtor, bool aTransfer,
|
||||
void **aOldValue)
|
||||
{
|
||||
nsIDocument *doc = GetOwnerDoc();
|
||||
nsIDocument *doc = OwnerDoc();
|
||||
if (!doc)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
@ -247,7 +247,7 @@ nsINode::SetProperty(PRUint16 aCategory, nsIAtom *aPropertyName, void *aValue,
|
||||
void
|
||||
nsINode::DeleteProperty(PRUint16 aCategory, nsIAtom *aPropertyName)
|
||||
{
|
||||
nsIDocument *doc = GetOwnerDoc();
|
||||
nsIDocument *doc = OwnerDoc();
|
||||
if (doc)
|
||||
doc->PropertyTable(aCategory)->DeleteProperty(this, aPropertyName);
|
||||
}
|
||||
@ -256,7 +256,7 @@ void*
|
||||
nsINode::UnsetProperty(PRUint16 aCategory, nsIAtom *aPropertyName,
|
||||
nsresult *aStatus)
|
||||
{
|
||||
nsIDocument *doc = GetOwnerDoc();
|
||||
nsIDocument *doc = OwnerDoc();
|
||||
if (!doc)
|
||||
return nsnull;
|
||||
|
||||
@ -539,7 +539,7 @@ nsINode::RemoveChild(nsINode *aOldChild)
|
||||
}
|
||||
|
||||
if (aOldChild && aOldChild->GetNodeParent() == this) {
|
||||
nsContentUtils::MaybeFireNodeRemoved(aOldChild, this, GetOwnerDoc());
|
||||
nsContentUtils::MaybeFireNodeRemoved(aOldChild, this, OwnerDoc());
|
||||
}
|
||||
|
||||
PRInt32 index = IndexOf(aOldChild);
|
||||
@ -617,7 +617,7 @@ nsINode::Normalize()
|
||||
}
|
||||
|
||||
// We're relying on mozAutoSubtreeModified to keep the doc alive here.
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
|
||||
// Batch possible DOMSubtreeModified events.
|
||||
mozAutoSubtreeModified subtree(doc, nsnull);
|
||||
@ -1095,7 +1095,7 @@ nsINode::AddEventListener(const nsAString& aType,
|
||||
|
||||
if (!aWantsUntrusted &&
|
||||
(aOptionalArgc < 2 &&
|
||||
!nsContentUtils::IsChromeDoc(GetOwnerDoc()))) {
|
||||
!nsContentUtils::IsChromeDoc(OwnerDoc()))) {
|
||||
aWantsUntrusted = true;
|
||||
}
|
||||
|
||||
@ -1131,7 +1131,7 @@ nsINode::DispatchEvent(nsIDOMEvent *aEvent, bool* aRetVal)
|
||||
{
|
||||
// XXX sXBL/XBL2 issue -- do we really want the owner here? What
|
||||
// if that's the XBL document? Would we want its presshell? Or what?
|
||||
nsCOMPtr<nsIDocument> document = GetOwnerDoc();
|
||||
nsCOMPtr<nsIDocument> document = OwnerDoc();
|
||||
|
||||
// Do nothing if the element does not belong to a document
|
||||
if (!document) {
|
||||
@ -1344,7 +1344,7 @@ nsIContent::GetFlattenedTreeParent() const
|
||||
{
|
||||
nsIContent *parent = GetParent();
|
||||
if (parent && parent->HasFlag(NODE_MAY_BE_IN_BINDING_MNGR)) {
|
||||
nsIDocument *doc = parent->GetOwnerDoc();
|
||||
nsIDocument *doc = parent->OwnerDoc();
|
||||
if (doc) {
|
||||
nsIContent* insertionElement =
|
||||
doc->BindingManager()->GetNestedInsertionPoint(parent, this);
|
||||
@ -1462,7 +1462,7 @@ nsIContent::LookupNamespaceURI(const nsAString& aNamespacePrefix,
|
||||
already_AddRefed<nsIURI>
|
||||
nsIContent::GetBaseURI() const
|
||||
{
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
if (!doc) {
|
||||
// We won't be able to do security checks, etc. So don't go any
|
||||
// further. That said, this really shouldn't happen...
|
||||
@ -1486,7 +1486,7 @@ nsIContent::GetBaseURI() const
|
||||
if (elem->IsSVG()) {
|
||||
nsIContent* bindingParent = elem->GetBindingParent();
|
||||
if (bindingParent) {
|
||||
nsIDocument* bindingDoc = bindingParent->GetOwnerDoc();
|
||||
nsIDocument* bindingDoc = bindingParent->OwnerDoc();
|
||||
if (bindingDoc) {
|
||||
nsXBLBinding* binding =
|
||||
bindingDoc->BindingManager()->GetBinding(bindingParent);
|
||||
@ -1934,7 +1934,7 @@ nsGenericElement::GetScrollFrame(nsIFrame **aStyledFrame)
|
||||
return scrollFrame;
|
||||
}
|
||||
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
bool quirksMode = doc->GetCompatibilityMode() == eCompatibility_NavQuirks;
|
||||
Element* elementWithRootScrollInfo =
|
||||
quirksMode ? doc->GetBodyElement() : doc->GetRootElement();
|
||||
@ -2612,7 +2612,7 @@ nsGenericElement::GetAttributeNode(const nsAString& aName,
|
||||
NS_ENSURE_ARG_POINTER(aReturn);
|
||||
*aReturn = nsnull;
|
||||
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eGetAttributeNode);
|
||||
}
|
||||
@ -2640,7 +2640,7 @@ nsGenericElement::SetAttributeNode(nsIDOMAttr* aAttribute,
|
||||
|
||||
*aReturn = nsnull;
|
||||
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eSetAttributeNode);
|
||||
}
|
||||
@ -2669,7 +2669,7 @@ nsGenericElement::RemoveAttributeNode(nsIDOMAttr* aAttribute,
|
||||
|
||||
*aReturn = nsnull;
|
||||
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eRemoveAttributeNode);
|
||||
}
|
||||
@ -2771,7 +2771,7 @@ nsGenericElement::GetAttributeNodeNS(const nsAString& aNamespaceURI,
|
||||
NS_ENSURE_ARG_POINTER(aReturn);
|
||||
*aReturn = nsnull;
|
||||
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eGetAttributeNodeNS);
|
||||
}
|
||||
@ -2798,7 +2798,7 @@ nsGenericElement::SetAttributeNodeNS(nsIDOMAttr* aNewAttr,
|
||||
NS_ENSURE_ARG_POINTER(aNewAttr);
|
||||
*aReturn = nsnull;
|
||||
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
document->WarnOnceAbout(nsIDocument::eSetAttributeNodeNS);
|
||||
}
|
||||
@ -3034,7 +3034,7 @@ nsGenericElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
// that also need to be told that they are moving.
|
||||
nsresult rv;
|
||||
if (hadForceXBL) {
|
||||
nsIDocument* ownerDoc = GetOwnerDoc();
|
||||
nsIDocument* ownerDoc = OwnerDoc();
|
||||
if (ownerDoc) {
|
||||
nsBindingManager* bmgr = ownerDoc->BindingManager();
|
||||
|
||||
@ -3100,7 +3100,7 @@ nsGenericElement::UnbindFromTree(bool aDeep, bool aNullParent)
|
||||
"kids!");
|
||||
// Make sure to unbind this node before doing the kids
|
||||
nsIDocument *document =
|
||||
HasFlag(NODE_FORCE_XBL_BINDINGS) ? GetOwnerDoc() : GetCurrentDoc();
|
||||
HasFlag(NODE_FORCE_XBL_BINDINGS) ? OwnerDoc() : GetCurrentDoc();
|
||||
|
||||
if (aNullParent) {
|
||||
if (GetParent()) {
|
||||
@ -3191,7 +3191,7 @@ nsGenericElement::GetChildren(PRUint32 aFilter)
|
||||
// insertion point if any.
|
||||
nsINodeList *childList = nsnull;
|
||||
|
||||
nsIDocument* document = GetOwnerDoc();
|
||||
nsIDocument* document = OwnerDoc();
|
||||
if (document) {
|
||||
if (!(aFilter & eAllButXBL)) {
|
||||
childList = document->BindingManager()->GetXBLChildNodesFor(this);
|
||||
@ -3268,7 +3268,7 @@ nsIContent::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
do_QueryInterface(static_cast<nsMouseEvent*>
|
||||
(aVisitor.mEvent)->relatedTarget);
|
||||
if (relatedTarget &&
|
||||
relatedTarget->GetOwnerDoc() == GetOwnerDoc()) {
|
||||
relatedTarget->OwnerDoc() == OwnerDoc()) {
|
||||
|
||||
// If current target is anonymous for events or we know that related
|
||||
// target is descendant of an element which is anonymous for events,
|
||||
@ -3351,7 +3351,7 @@ nsIContent::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
// check for an anonymous parent
|
||||
// XXX XBL2/sXBL issue
|
||||
if (HasFlag(NODE_MAY_BE_IN_BINDING_MNGR)) {
|
||||
nsIDocument* ownerDoc = GetOwnerDoc();
|
||||
nsIDocument* ownerDoc = OwnerDoc();
|
||||
if (ownerDoc) {
|
||||
nsIContent* insertionParent = ownerDoc->BindingManager()->
|
||||
GetInsertionParent(this);
|
||||
@ -3590,7 +3590,7 @@ AdoptNodeIntoOwnerDoc(nsINode *aParent, nsINode *aNode)
|
||||
NS_ASSERTION(!aNode->GetNodeParent(),
|
||||
"Should have removed from parent already");
|
||||
|
||||
nsIDocument *doc = aParent->GetOwnerDoc();
|
||||
nsIDocument *doc = aParent->OwnerDoc();
|
||||
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(doc, &rv);
|
||||
@ -3603,7 +3603,7 @@ AdoptNodeIntoOwnerDoc(nsINode *aParent, nsINode *aNode)
|
||||
rv = domDoc->AdoptNode(node, getter_AddRefs(adoptedNode));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
NS_ASSERTION(aParent->GetOwnerDoc() == doc,
|
||||
NS_ASSERTION(aParent->OwnerDoc() == doc,
|
||||
"ownerDoc chainged while adopting");
|
||||
NS_ASSERTION(adoptedNode == node, "Uh, adopt node changed nodes?");
|
||||
NS_ASSERTION(aParent->HasSameOwnerDoc(aNode),
|
||||
@ -3673,7 +3673,7 @@ nsINode::doInsertChildAt(nsIContent* aKid, PRUint32 aIndex,
|
||||
nsMutationEvent mutation(true, NS_MUTATION_NODEINSERTED);
|
||||
mutation.mRelatedNode = do_QueryInterface(this);
|
||||
|
||||
mozAutoSubtreeModified subtree(GetOwnerDoc(), this);
|
||||
mozAutoSubtreeModified subtree(OwnerDoc(), this);
|
||||
(new nsPLDOMEvent(aKid, mutation))->RunDOMEventWhenSafe();
|
||||
}
|
||||
}
|
||||
@ -3822,7 +3822,7 @@ nsGenericElement::GetPrimaryFrame(mozFlushType aType)
|
||||
void
|
||||
nsGenericElement::DestroyContent()
|
||||
{
|
||||
nsIDocument *document = GetOwnerDoc();
|
||||
nsIDocument *document = OwnerDoc();
|
||||
if (document) {
|
||||
document->BindingManager()->RemovedFromDocument(this, document);
|
||||
document->ClearBoxObjectFor(this);
|
||||
@ -4061,7 +4061,7 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
|
||||
// If we're replacing, fire for node-to-be-replaced.
|
||||
// If aRefChild == aNewChild then we'll fire for it in check below
|
||||
if (aReplace && aRefChild != aNewChild) {
|
||||
nsContentUtils::MaybeFireNodeRemoved(aRefChild, this, GetOwnerDoc());
|
||||
nsContentUtils::MaybeFireNodeRemoved(aRefChild, this, OwnerDoc());
|
||||
}
|
||||
|
||||
// If the new node already has a parent, fire for removing from old
|
||||
@ -4069,7 +4069,7 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
|
||||
nsINode* oldParent = aNewChild->GetNodeParent();
|
||||
if (oldParent) {
|
||||
nsContentUtils::MaybeFireNodeRemoved(aNewChild, oldParent,
|
||||
aNewChild->GetOwnerDoc());
|
||||
aNewChild->OwnerDoc());
|
||||
}
|
||||
|
||||
// If we're inserting a fragment, fire for all the children of the
|
||||
@ -4079,7 +4079,7 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
|
||||
}
|
||||
}
|
||||
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
nsIContent* newContent = static_cast<nsIContent*>(aNewChild);
|
||||
PRInt32 insPos;
|
||||
|
||||
@ -4245,7 +4245,7 @@ nsINode::IsEqualNode(nsIDOMNode* aOther, bool* aReturn)
|
||||
nsresult
|
||||
nsINode::IsSameNode(nsIDOMNode* aOther, bool* aReturn)
|
||||
{
|
||||
nsIDocument* owner = GetOwnerDoc();
|
||||
nsIDocument* owner = OwnerDoc();
|
||||
if (owner) {
|
||||
owner->WarnOnceAbout(nsIDocument::eIsSameNode);
|
||||
}
|
||||
@ -4295,7 +4295,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGenericElement)
|
||||
|
||||
{
|
||||
nsIDocument *doc;
|
||||
if (!tmp->GetNodeParent() && (doc = tmp->GetOwnerDoc())) {
|
||||
if (!tmp->GetNodeParent() && (doc = tmp->OwnerDoc())) {
|
||||
doc->BindingManager()->RemovedFromDocument(tmp, doc);
|
||||
}
|
||||
}
|
||||
@ -4347,7 +4347,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsGenericElement)
|
||||
return NS_SUCCESS_INTERRUPTED_TRAVERSE;
|
||||
}
|
||||
|
||||
nsIDocument* ownerDoc = tmp->GetOwnerDoc();
|
||||
nsIDocument* ownerDoc = tmp->OwnerDoc();
|
||||
if (ownerDoc) {
|
||||
ownerDoc->BindingManager()->Traverse(tmp, cb);
|
||||
}
|
||||
@ -4423,7 +4423,7 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE_WITH_DESTROY(nsGenericElement,
|
||||
nsresult
|
||||
nsGenericElement::PostQueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
nsIDocument *document = GetOwnerDoc();
|
||||
nsIDocument *document = OwnerDoc();
|
||||
if (document) {
|
||||
return document->BindingManager()->GetBindingImplementation(this, aIID,
|
||||
aInstancePtr);
|
||||
@ -4450,7 +4450,7 @@ nsGenericElement::AddScriptEventListener(nsIAtom* aEventName,
|
||||
const nsAString& aValue,
|
||||
bool aDefer)
|
||||
{
|
||||
nsIDocument *ownerDoc = GetOwnerDoc();
|
||||
nsIDocument *ownerDoc = OwnerDoc();
|
||||
if (!ownerDoc || ownerDoc->IsLoadedAsData()) {
|
||||
// Make this a no-op rather than throwing an error to avoid
|
||||
// the error causing problems setting the attribute.
|
||||
@ -4664,7 +4664,7 @@ nsGenericElement::SetAttrAndNotify(PRInt32 aNamespaceID,
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (document || HasFlag(NODE_FORCE_XBL_BINDINGS)) {
|
||||
nsIDocument* ownerDoc = GetOwnerDoc();
|
||||
nsIDocument* ownerDoc = OwnerDoc();
|
||||
if (ownerDoc) {
|
||||
nsRefPtr<nsXBLBinding> binding =
|
||||
ownerDoc->BindingManager()->GetBinding(this);
|
||||
@ -4710,7 +4710,7 @@ nsGenericElement::SetAttrAndNotify(PRInt32 aNamespaceID,
|
||||
}
|
||||
mutation.mAttrChange = aModType;
|
||||
|
||||
mozAutoSubtreeModified subtree(GetOwnerDoc(), this);
|
||||
mozAutoSubtreeModified subtree(OwnerDoc(), this);
|
||||
(new nsPLDOMEvent(this, mutation))->RunDOMEventWhenSafe();
|
||||
}
|
||||
|
||||
@ -4894,7 +4894,7 @@ nsGenericElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (document || HasFlag(NODE_FORCE_XBL_BINDINGS)) {
|
||||
nsIDocument* ownerDoc = GetOwnerDoc();
|
||||
nsIDocument* ownerDoc = OwnerDoc();
|
||||
if (ownerDoc) {
|
||||
nsRefPtr<nsXBLBinding> binding =
|
||||
ownerDoc->BindingManager()->GetBinding(this);
|
||||
@ -4927,7 +4927,7 @@ nsGenericElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
mutation.mPrevAttrValue = do_GetAtom(value);
|
||||
mutation.mAttrChange = nsIDOMMutationEvent::REMOVAL;
|
||||
|
||||
mozAutoSubtreeModified subtree(GetOwnerDoc(), this);
|
||||
mozAutoSubtreeModified subtree(OwnerDoc(), this);
|
||||
(new nsPLDOMEvent(this, mutation))->RunDOMEventWhenSafe();
|
||||
}
|
||||
|
||||
@ -5057,7 +5057,7 @@ nsGenericElement::List(FILE* out, PRInt32 aIndent,
|
||||
nsGenericElement* nonConstThis = const_cast<nsGenericElement*>(this);
|
||||
|
||||
// XXX sXBL/XBL2 issue! Owner or current document?
|
||||
nsIDocument *document = GetOwnerDoc();
|
||||
nsIDocument *document = OwnerDoc();
|
||||
if (document) {
|
||||
// Note: not listing nsIAnonymousContentCreator-created content...
|
||||
|
||||
@ -5365,7 +5365,7 @@ nsGenericElement::PostHandleEventForLinks(nsEventChainPostVisitor& aVisitor)
|
||||
void
|
||||
nsGenericElement::FireNodeRemovedForChildren()
|
||||
{
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
// Optimize the common case
|
||||
if (!nsContentUtils::
|
||||
HasMutationListeners(doc, NS_EVENT_BITS_MUTATION_NODEREMOVED)) {
|
||||
@ -5398,7 +5398,7 @@ ParseSelectorList(nsINode* aNode,
|
||||
{
|
||||
NS_ENSURE_ARG(aNode);
|
||||
|
||||
nsIDocument* doc = aNode->GetOwnerDoc();
|
||||
nsIDocument* doc = aNode->OwnerDoc();
|
||||
NS_ENSURE_STATE(doc);
|
||||
|
||||
nsCSSParser parser(doc->CSSLoader());
|
||||
@ -5441,7 +5441,7 @@ nsGenericElement::doQuerySelector(nsINode* aRoot, const nsAString& aSelector,
|
||||
|
||||
TreeMatchContext matchingContext(false,
|
||||
nsRuleWalker::eRelevantLinkUnvisited,
|
||||
aRoot->GetOwnerDoc());
|
||||
aRoot->OwnerDoc());
|
||||
for (nsIContent* cur = aRoot->GetFirstChild();
|
||||
cur;
|
||||
cur = cur->GetNextNode(aRoot)) {
|
||||
@ -5475,7 +5475,7 @@ nsGenericElement::doQuerySelectorAll(nsINode* aRoot,
|
||||
|
||||
TreeMatchContext matchingContext(false,
|
||||
nsRuleWalker::eRelevantLinkUnvisited,
|
||||
aRoot->GetOwnerDoc());
|
||||
aRoot->OwnerDoc());
|
||||
for (nsIContent* cur = aRoot->GetFirstChild();
|
||||
cur;
|
||||
cur = cur->GetNextNode(aRoot)) {
|
||||
@ -5501,7 +5501,7 @@ nsGenericElement::MozMatchesSelector(const nsAString& aSelector, nsresult* aResu
|
||||
if (NS_SUCCEEDED(*aResult)) {
|
||||
TreeMatchContext matchingContext(false,
|
||||
nsRuleWalker::eRelevantLinkUnvisited,
|
||||
GetOwnerDoc());
|
||||
OwnerDoc());
|
||||
matches = nsCSSRuleProcessor::SelectorListMatches(this, matchingContext,
|
||||
selectorList);
|
||||
}
|
||||
@ -5582,7 +5582,7 @@ nsINode::Contains(const nsINode* aOther) const
|
||||
return true;
|
||||
}
|
||||
if (!aOther ||
|
||||
GetOwnerDoc() != aOther->GetOwnerDoc() ||
|
||||
OwnerDoc() != aOther->OwnerDoc() ||
|
||||
IsInDoc() != aOther->IsInDoc() ||
|
||||
!(aOther->IsElement() ||
|
||||
aOther->IsNodeOfType(nsINode::eCONTENT)) ||
|
||||
@ -5591,7 +5591,7 @@ nsINode::Contains(const nsINode* aOther) const
|
||||
}
|
||||
|
||||
const nsIContent* other = static_cast<const nsIContent*>(aOther);
|
||||
if (this == GetOwnerDoc()) {
|
||||
if (this == OwnerDoc()) {
|
||||
// document.contains(aOther) returns true if aOther is in the document,
|
||||
// but is not in any anonymous subtree.
|
||||
// IsInDoc() check is done already before this.
|
||||
|
@ -903,13 +903,13 @@ protected:
|
||||
}
|
||||
|
||||
void RegisterFreezableElement() {
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
if (doc) {
|
||||
doc->RegisterFreezableElement(this);
|
||||
}
|
||||
}
|
||||
void UnregisterFreezableElement() {
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
if (doc) {
|
||||
doc->UnregisterFreezableElement(this);
|
||||
}
|
||||
|
@ -864,7 +864,7 @@ nsImageLoadingContent::GetOurDocument()
|
||||
nsCOMPtr<nsIContent> thisContent = do_QueryInterface(this);
|
||||
NS_ENSURE_TRUE(thisContent, nsnull);
|
||||
|
||||
return thisContent->GetOwnerDoc();
|
||||
return thisContent->OwnerDoc();
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -75,7 +75,7 @@ using namespace mozilla::dom;
|
||||
#define IMPL_MUTATION_NOTIFICATION(func_, content_, params_) \
|
||||
PR_BEGIN_MACRO \
|
||||
nsINode* node = content_; \
|
||||
NS_ASSERTION(node->GetOwnerDoc() == doc, "Bogus document"); \
|
||||
NS_ASSERTION(node->OwnerDoc() == doc, "Bogus document"); \
|
||||
if (doc) { \
|
||||
static_cast<nsIMutationObserver*>(doc->BindingManager())-> \
|
||||
func_ params_; \
|
||||
@ -97,7 +97,7 @@ void
|
||||
nsNodeUtils::CharacterDataWillChange(nsIContent* aContent,
|
||||
CharacterDataChangeInfo* aInfo)
|
||||
{
|
||||
nsIDocument* doc = aContent->GetOwnerDoc();
|
||||
nsIDocument* doc = aContent->OwnerDoc();
|
||||
IMPL_MUTATION_NOTIFICATION(CharacterDataWillChange, aContent,
|
||||
(doc, aContent, aInfo));
|
||||
}
|
||||
@ -106,7 +106,7 @@ void
|
||||
nsNodeUtils::CharacterDataChanged(nsIContent* aContent,
|
||||
CharacterDataChangeInfo* aInfo)
|
||||
{
|
||||
nsIDocument* doc = aContent->GetOwnerDoc();
|
||||
nsIDocument* doc = aContent->OwnerDoc();
|
||||
IMPL_MUTATION_NOTIFICATION(CharacterDataChanged, aContent,
|
||||
(doc, aContent, aInfo));
|
||||
}
|
||||
@ -117,7 +117,7 @@ nsNodeUtils::AttributeWillChange(Element* aElement,
|
||||
nsIAtom* aAttribute,
|
||||
PRInt32 aModType)
|
||||
{
|
||||
nsIDocument* doc = aElement->GetOwnerDoc();
|
||||
nsIDocument* doc = aElement->OwnerDoc();
|
||||
IMPL_MUTATION_NOTIFICATION(AttributeWillChange, aElement,
|
||||
(doc, aElement, aNameSpaceID, aAttribute,
|
||||
aModType));
|
||||
@ -129,7 +129,7 @@ nsNodeUtils::AttributeChanged(Element* aElement,
|
||||
nsIAtom* aAttribute,
|
||||
PRInt32 aModType)
|
||||
{
|
||||
nsIDocument* doc = aElement->GetOwnerDoc();
|
||||
nsIDocument* doc = aElement->OwnerDoc();
|
||||
IMPL_MUTATION_NOTIFICATION(AttributeChanged, aElement,
|
||||
(doc, aElement, aNameSpaceID, aAttribute,
|
||||
aModType));
|
||||
@ -140,7 +140,7 @@ nsNodeUtils::ContentAppended(nsIContent* aContainer,
|
||||
nsIContent* aFirstNewContent,
|
||||
PRInt32 aNewIndexInContainer)
|
||||
{
|
||||
nsIDocument* doc = aContainer->GetOwnerDoc();
|
||||
nsIDocument* doc = aContainer->OwnerDoc();
|
||||
|
||||
IMPL_MUTATION_NOTIFICATION(ContentAppended, aContainer,
|
||||
(doc, aContainer, aFirstNewContent,
|
||||
@ -156,7 +156,7 @@ nsNodeUtils::ContentInserted(nsINode* aContainer,
|
||||
aContainer->IsNodeOfType(nsINode::eDOCUMENT),
|
||||
"container must be an nsIContent or an nsIDocument");
|
||||
nsIContent* container;
|
||||
nsIDocument* doc = aContainer->GetOwnerDoc();
|
||||
nsIDocument* doc = aContainer->OwnerDoc();
|
||||
nsIDocument* document;
|
||||
if (aContainer->IsNodeOfType(nsINode::eCONTENT)) {
|
||||
container = static_cast<nsIContent*>(aContainer);
|
||||
@ -181,7 +181,7 @@ nsNodeUtils::ContentRemoved(nsINode* aContainer,
|
||||
aContainer->IsNodeOfType(nsINode::eDOCUMENT),
|
||||
"container must be an nsIContent or an nsIDocument");
|
||||
nsIContent* container;
|
||||
nsIDocument* doc = aContainer->GetOwnerDoc();
|
||||
nsIDocument* doc = aContainer->OwnerDoc();
|
||||
nsIDocument* document;
|
||||
if (aContainer->IsNodeOfType(nsINode::eCONTENT)) {
|
||||
container = static_cast<nsIContent*>(aContainer);
|
||||
@ -267,7 +267,7 @@ nsNodeUtils::LastRelease(nsINode* aNode)
|
||||
if (aNode->HasProperties()) {
|
||||
// Strong reference to the document so that deleting properties can't
|
||||
// delete the document.
|
||||
nsCOMPtr<nsIDocument> document = aNode->GetOwnerDoc();
|
||||
nsCOMPtr<nsIDocument> document = aNode->OwnerDoc();
|
||||
if (document) {
|
||||
document->DeleteAllPropertiesFor(aNode);
|
||||
}
|
||||
@ -300,7 +300,7 @@ nsNodeUtils::LastRelease(nsINode* aNode)
|
||||
}
|
||||
|
||||
if (aNode->IsElement()) {
|
||||
nsIDocument* ownerDoc = aNode->GetOwnerDoc();
|
||||
nsIDocument* ownerDoc = aNode->OwnerDoc();
|
||||
Element* elem = aNode->AsElement();
|
||||
if (ownerDoc) {
|
||||
ownerDoc->ClearBoxObjectFor(elem);
|
||||
@ -415,7 +415,7 @@ void
|
||||
nsNodeUtils::TraverseUserData(nsINode* aNode,
|
||||
nsCycleCollectionTraversalCallback &aCb)
|
||||
{
|
||||
nsIDocument* ownerDoc = aNode->GetOwnerDoc();
|
||||
nsIDocument* ownerDoc = aNode->OwnerDoc();
|
||||
if (!ownerDoc) {
|
||||
return;
|
||||
}
|
||||
@ -438,7 +438,7 @@ nsNodeUtils::CloneNodeImpl(nsINode *aNode, bool aDeep,
|
||||
getter_AddRefs(newNode));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsIDocument *ownerDoc = aNode->GetOwnerDoc();
|
||||
nsIDocument *ownerDoc = aNode->OwnerDoc();
|
||||
if (ownerDoc && aCallUserDataHandlers) {
|
||||
rv = CallUserDataHandlers(nodesWithProperties, ownerDoc,
|
||||
nsIDOMUserDataHandler::NODE_CLONED, true);
|
||||
@ -492,7 +492,7 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep,
|
||||
bool hasHadScriptHandlingObject = false;
|
||||
if (!newDoc->GetScriptHandlingObject(hasHadScriptHandlingObject) &&
|
||||
!hasHadScriptHandlingObject) {
|
||||
nsIDocument* currentDoc = aNode->GetOwnerDoc();
|
||||
nsIDocument* currentDoc = aNode->OwnerDoc();
|
||||
NS_ENSURE_STATE(currentDoc &&
|
||||
(nsContentUtils::IsChromeDoc(currentDoc) ||
|
||||
(!currentDoc->GetScriptHandlingObject(hasHadScriptHandlingObject) &&
|
||||
@ -533,7 +533,7 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep,
|
||||
}
|
||||
}
|
||||
else if (nodeInfoManager) {
|
||||
nsIDocument* oldDoc = aNode->GetOwnerDoc();
|
||||
nsIDocument* oldDoc = aNode->OwnerDoc();
|
||||
bool wasRegistered = false;
|
||||
if (oldDoc && aNode->IsElement()) {
|
||||
Element* element = aNode->AsElement();
|
||||
@ -546,7 +546,7 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep,
|
||||
elem->NodeInfoChanged(newNodeInfo);
|
||||
}
|
||||
|
||||
nsIDocument* newDoc = aNode->GetOwnerDoc();
|
||||
nsIDocument* newDoc = aNode->OwnerDoc();
|
||||
if (newDoc) {
|
||||
// XXX what if oldDoc is null, we don't know if this should be
|
||||
// registered or not! Can that really happen?
|
||||
@ -716,7 +716,7 @@ nsNodeUtils::UnlinkUserData(nsINode *aNode)
|
||||
|
||||
// Strong reference to the document so that deleting properties can't
|
||||
// delete the document.
|
||||
nsCOMPtr<nsIDocument> document = aNode->GetOwnerDoc();
|
||||
nsCOMPtr<nsIDocument> document = aNode->OwnerDoc();
|
||||
if (document) {
|
||||
document->PropertyTable(DOM_USER_DATA)->DeleteAllPropertiesFor(aNode);
|
||||
document->PropertyTable(DOM_USER_DATA_HANDLER)->DeleteAllPropertiesFor(aNode);
|
||||
|
@ -603,7 +603,7 @@ nsObjectLoadingContent::OnStartRequest(nsIRequest *aRequest,
|
||||
do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
|
||||
NS_ASSERTION(thisContent, "must be a content");
|
||||
|
||||
nsIDocument* doc = thisContent->GetOwnerDoc();
|
||||
nsIDocument* doc = thisContent->OwnerDoc();
|
||||
if (!doc) {
|
||||
Fallback(false);
|
||||
return NS_BINDING_ABORTED;
|
||||
@ -945,7 +945,7 @@ nsObjectLoadingContent::HasNewFrame(nsIObjectFrame* aFrame)
|
||||
nsCOMPtr<nsIContent> thisContent =
|
||||
do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
|
||||
NS_ASSERTION(thisContent, "must be a content");
|
||||
nsIDocument* doc = thisContent->GetOwnerDoc();
|
||||
nsIDocument* doc = thisContent->OwnerDoc();
|
||||
if (!doc || doc->IsStaticDocument() || doc->IsBeingUsedAsImage()) {
|
||||
return NS_OK;
|
||||
}
|
||||
@ -1124,7 +1124,7 @@ nsObjectLoadingContent::LoadObject(const nsAString& aURI,
|
||||
do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
|
||||
NS_ASSERTION(thisContent, "must be a content");
|
||||
|
||||
nsIDocument* doc = thisContent->GetOwnerDoc();
|
||||
nsIDocument* doc = thisContent->OwnerDoc();
|
||||
nsCOMPtr<nsIURI> baseURI;
|
||||
GetObjectBaseURI(thisContent, getter_AddRefs(baseURI));
|
||||
|
||||
@ -1199,7 +1199,7 @@ nsObjectLoadingContent::LoadObject(nsIURI* aURI,
|
||||
do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
|
||||
NS_ASSERTION(thisContent, "must be a content");
|
||||
|
||||
nsIDocument* doc = thisContent->GetOwnerDoc();
|
||||
nsIDocument* doc = thisContent->OwnerDoc();
|
||||
if (!doc || doc->IsBeingUsedAsImage()) {
|
||||
return NS_OK;
|
||||
}
|
||||
@ -1769,7 +1769,7 @@ nsObjectLoadingContent::GetObjectBaseURI(nsIContent* thisContent, nsIURI** aURI)
|
||||
codebase);
|
||||
if (!codebase.IsEmpty()) {
|
||||
nsContentUtils::NewURIWithDocumentCharset(aURI, codebase,
|
||||
thisContent->GetOwnerDoc(),
|
||||
thisContent->OwnerDoc(),
|
||||
baseURI);
|
||||
} else {
|
||||
baseURI.swap(*aURI);
|
||||
|
@ -1296,7 +1296,7 @@ nsresult nsRange::CutContents(nsIDOMDocumentFragment** aFragment)
|
||||
nsresult rv;
|
||||
|
||||
nsCOMPtr<nsIDocument> doc =
|
||||
do_QueryInterface(mStartParent->GetOwnerDoc());
|
||||
do_QueryInterface(mStartParent->OwnerDoc());
|
||||
if (!doc) return NS_ERROR_UNEXPECTED;
|
||||
|
||||
nsCOMPtr<nsIDOMNode> commonAncestor;
|
||||
@ -1313,7 +1313,7 @@ nsresult nsRange::CutContents(nsIDOMDocumentFragment** aFragment)
|
||||
nsCOMPtr<nsIDOMNode> commonCloneAncestor(do_QueryInterface(retval));
|
||||
|
||||
// Batch possible DOMSubtreeModified events.
|
||||
mozAutoSubtreeModified subtree(mRoot ? mRoot->GetOwnerDoc(): nsnull, nsnull);
|
||||
mozAutoSubtreeModified subtree(mRoot ? mRoot->OwnerDoc(): nsnull, nsnull);
|
||||
|
||||
// Save the range end points locally to avoid interference
|
||||
// of Range gravity during our edits!
|
||||
@ -1662,7 +1662,7 @@ nsRange::CloneContents(nsIDOMDocumentFragment** aReturn)
|
||||
if (NS_FAILED(res)) return res;
|
||||
|
||||
nsCOMPtr<nsIDOMDocument> document =
|
||||
do_QueryInterface(mStartParent->GetOwnerDoc());
|
||||
do_QueryInterface(mStartParent->OwnerDoc());
|
||||
NS_ASSERTION(document, "CloneContents needs a document to continue.");
|
||||
if (!document) return NS_ERROR_FAILURE;
|
||||
|
||||
@ -2323,7 +2323,7 @@ nsRange::GetUsedFontFaces(nsIDOMFontFaceList** aResult)
|
||||
nsCOMPtr<nsIDOMNode> endContainer = do_QueryInterface(mEndParent);
|
||||
|
||||
// Flush out layout so our frames are up to date.
|
||||
nsIDocument* doc = mStartParent->GetOwnerDoc();
|
||||
nsIDocument* doc = mStartParent->OwnerDoc();
|
||||
NS_ENSURE_TRUE(doc, NS_ERROR_UNEXPECTED);
|
||||
doc->FlushPendingNotifications(Flush_Frames);
|
||||
|
||||
|
@ -165,7 +165,7 @@ nsScriptElement::MaybeProcessScript()
|
||||
|
||||
mAlreadyStarted = true;
|
||||
|
||||
nsIDocument* ownerDoc = cont->GetOwnerDoc();
|
||||
nsIDocument* ownerDoc = cont->OwnerDoc();
|
||||
nsCOMPtr<nsIParser> parser = ((nsIScriptElement*) this)->GetCreatorParser();
|
||||
if (parser) {
|
||||
nsCOMPtr<nsIContentSink> sink = parser->GetContentSink();
|
||||
|
@ -772,7 +772,7 @@ nsScriptLoader::ProcessRequest(nsScriptLoadRequest* aRequest)
|
||||
else {
|
||||
script = &aRequest->mScriptText;
|
||||
|
||||
doc = scriptElem->GetOwnerDoc();
|
||||
doc = scriptElem->OwnerDoc();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIScriptElement> oldParserInsertedScript;
|
||||
@ -785,7 +785,7 @@ nsScriptLoader::ProcessRequest(nsScriptLoadRequest* aRequest)
|
||||
FireScriptAvailable(NS_OK, aRequest);
|
||||
|
||||
bool runScript = true;
|
||||
nsContentUtils::DispatchTrustedEvent(scriptElem->GetOwnerDoc(),
|
||||
nsContentUtils::DispatchTrustedEvent(scriptElem->OwnerDoc(),
|
||||
scriptElem,
|
||||
NS_LITERAL_STRING("beforescriptexecute"),
|
||||
true, true, &runScript);
|
||||
@ -802,7 +802,7 @@ nsScriptLoader::ProcessRequest(nsScriptLoadRequest* aRequest)
|
||||
doc->EndEvaluatingExternalScript();
|
||||
}
|
||||
|
||||
nsContentUtils::DispatchTrustedEvent(scriptElem->GetOwnerDoc(),
|
||||
nsContentUtils::DispatchTrustedEvent(scriptElem->OwnerDoc(),
|
||||
scriptElem,
|
||||
NS_LITERAL_STRING("afterscriptexecute"),
|
||||
true, false);
|
||||
@ -856,7 +856,7 @@ nsScriptLoader::EvaluateScript(nsScriptLoadRequest* aRequest,
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContent> scriptContent(do_QueryInterface(aRequest->mElement));
|
||||
nsIDocument* ownerDoc = scriptContent->GetOwnerDoc();
|
||||
nsIDocument* ownerDoc = scriptContent->OwnerDoc();
|
||||
if (ownerDoc != mDocument) {
|
||||
// Willful violation of HTML5 as of 2010-12-01
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -310,7 +310,7 @@ nsStyledElementNotElementCSSInlineStyle::ParseStyleAttribute(const nsAString& aV
|
||||
nsAttrValue& aResult,
|
||||
bool aForceInDataDoc)
|
||||
{
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
|
||||
if (doc && (aForceInDataDoc ||
|
||||
!doc->IsLoadedAsData() ||
|
||||
|
@ -1205,7 +1205,7 @@ nsTreeSanitizer::SanitizeAttributes(mozilla::dom::Element* aElement,
|
||||
if (kNameSpaceID_None == attrNs) {
|
||||
if (aAllowStyle && nsGkAtoms::style == attrLocal) {
|
||||
nsCOMPtr<nsIURI> baseURI = aElement->GetBaseURI();
|
||||
nsIDocument* document = aElement->GetOwnerDoc();
|
||||
nsIDocument* document = aElement->OwnerDoc();
|
||||
// Pass the CSS Loader object to the parser, to allow parser error
|
||||
// reports to include the outer window ID.
|
||||
nsCSSParser parser(document->CSSLoader());
|
||||
@ -1374,7 +1374,7 @@ nsTreeSanitizer::Sanitize(nsIContent* aFragment) {
|
||||
nsCOMPtr<nsIURI> baseURI = node->GetBaseURI();
|
||||
if (SanitizeStyleSheet(styleText,
|
||||
sanitizedStyle,
|
||||
aFragment->GetOwnerDoc(),
|
||||
aFragment->OwnerDoc(),
|
||||
baseURI)) {
|
||||
nsContentUtils::SetNodeTextContent(node, sanitizedStyle, true);
|
||||
} else {
|
||||
|
@ -619,7 +619,7 @@ protected:
|
||||
nsIPresShell *GetPresShell() {
|
||||
nsCOMPtr<nsIContent> content = do_QueryObject(mCanvasElement);
|
||||
if (content) {
|
||||
nsIDocument* ownerDoc = content->GetOwnerDoc();
|
||||
nsIDocument* ownerDoc = content->OwnerDoc();
|
||||
return ownerDoc ? ownerDoc->GetShell() : nsnull;
|
||||
}
|
||||
if (mDocShell) {
|
||||
@ -873,7 +873,7 @@ nsCanvasRenderingContext2D::SetStyleFromStringOrInterface(const nsAString& aStr,
|
||||
|
||||
if (!aStr.IsVoid()) {
|
||||
nsIDocument* document = mCanvasElement ?
|
||||
HTMLCanvasElement()->GetOwnerDoc() : nsnull;
|
||||
HTMLCanvasElement()->OwnerDoc() : nsnull;
|
||||
|
||||
// Pass the CSS Loader object to the parser, to allow parser error
|
||||
// reports to include the outer window ID.
|
||||
@ -914,7 +914,7 @@ nsCanvasRenderingContext2D::SetStyleFromStringOrInterface(const nsAString& aStr,
|
||||
EmptyString(), 0, 0,
|
||||
nsIScriptError::warningFlag,
|
||||
"Canvas",
|
||||
mCanvasElement ? HTMLCanvasElement()->GetOwnerDoc() : nsnull);
|
||||
mCanvasElement ? HTMLCanvasElement()->OwnerDoc() : nsnull);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -1187,7 +1187,7 @@ nsCanvasRenderingContext2D::EnsureSurface()
|
||||
nsCOMPtr<nsIContent> content = do_QueryObject(mCanvasElement);
|
||||
nsIDocument* ownerDoc = nsnull;
|
||||
if (content)
|
||||
ownerDoc = content->GetOwnerDoc();
|
||||
ownerDoc = content->OwnerDoc();
|
||||
nsRefPtr<LayerManager> layerManager = nsnull;
|
||||
|
||||
if (ownerDoc)
|
||||
@ -1920,7 +1920,7 @@ NS_IMETHODIMP
|
||||
nsCanvasRenderingContext2D::SetShadowColor(const nsAString& colorstr)
|
||||
{
|
||||
nsIDocument* document = mCanvasElement ?
|
||||
HTMLCanvasElement()->GetOwnerDoc() : nsnull;
|
||||
HTMLCanvasElement()->OwnerDoc() : nsnull;
|
||||
|
||||
// Pass the CSS Loader object to the parser, to allow parser error reports
|
||||
// to include the outer window ID.
|
||||
@ -2427,7 +2427,7 @@ CreateFontStyleRule(const nsAString& aFont,
|
||||
bool changed;
|
||||
|
||||
nsIPrincipal* principal = aNode->NodePrincipal();
|
||||
nsIDocument* document = aNode->GetOwnerDoc();
|
||||
nsIDocument* document = aNode->OwnerDoc();
|
||||
|
||||
nsIURI* docURL = document->GetDocumentURI();
|
||||
nsIURI* baseURL = document->GetDocBaseURI();
|
||||
@ -3692,7 +3692,7 @@ nsCanvasRenderingContext2D::DrawWindow(nsIDOMWindow* aWindow, float aX, float aY
|
||||
nscolor bgColor;
|
||||
|
||||
nsIDocument* elementDoc = mCanvasElement ?
|
||||
HTMLCanvasElement()->GetOwnerDoc() : nsnull;
|
||||
HTMLCanvasElement()->OwnerDoc() : nsnull;
|
||||
|
||||
// Pass the CSS Loader object to the parser, to allow parser error reports
|
||||
// to include the outer window ID.
|
||||
|
@ -610,7 +610,7 @@ protected:
|
||||
nsIPresShell *GetPresShell() {
|
||||
nsCOMPtr<nsIContent> content = do_QueryObject(mCanvasElement);
|
||||
if (content) {
|
||||
nsIDocument* ownerDoc = content->GetOwnerDoc();
|
||||
nsIDocument* ownerDoc = content->OwnerDoc();
|
||||
return ownerDoc ? ownerDoc->GetShell() : nsnull;
|
||||
}
|
||||
if (mDocShell) {
|
||||
@ -1066,7 +1066,7 @@ nsCanvasRenderingContext2DAzure::SetStyleFromStringOrInterface(const nsAString&
|
||||
|
||||
if (!aStr.IsVoid()) {
|
||||
nsIDocument* document = mCanvasElement ?
|
||||
HTMLCanvasElement()->GetOwnerDoc() : nsnull;
|
||||
HTMLCanvasElement()->OwnerDoc() : nsnull;
|
||||
|
||||
// Pass the CSS Loader object to the parser, to allow parser error
|
||||
// reports to include the outer window ID.
|
||||
@ -1103,7 +1103,7 @@ nsCanvasRenderingContext2DAzure::SetStyleFromStringOrInterface(const nsAString&
|
||||
EmptyString(), 0, 0,
|
||||
nsIScriptError::warningFlag,
|
||||
"Canvas",
|
||||
mCanvasElement ? HTMLCanvasElement()->GetOwnerDoc() : nsnull);
|
||||
mCanvasElement ? HTMLCanvasElement()->OwnerDoc() : nsnull);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -1241,7 +1241,7 @@ nsCanvasRenderingContext2DAzure::SetDimensions(PRInt32 width, PRInt32 height)
|
||||
nsCOMPtr<nsIContent> content = do_QueryObject(mCanvasElement);
|
||||
nsIDocument* ownerDoc = nsnull;
|
||||
if (content) {
|
||||
ownerDoc = content->GetOwnerDoc();
|
||||
ownerDoc = content->OwnerDoc();
|
||||
}
|
||||
|
||||
nsRefPtr<LayerManager> layerManager = nsnull;
|
||||
@ -2020,7 +2020,7 @@ NS_IMETHODIMP
|
||||
nsCanvasRenderingContext2DAzure::SetShadowColor(const nsAString& colorstr)
|
||||
{
|
||||
nsIDocument* document = mCanvasElement ?
|
||||
HTMLCanvasElement()->GetOwnerDoc() : nsnull;
|
||||
HTMLCanvasElement()->OwnerDoc() : nsnull;
|
||||
|
||||
// Pass the CSS Loader object to the parser, to allow parser error reports
|
||||
// to include the outer window ID.
|
||||
@ -2675,7 +2675,7 @@ CreateFontStyleRule(const nsAString& aFont,
|
||||
bool changed;
|
||||
|
||||
nsIPrincipal* principal = aNode->NodePrincipal();
|
||||
nsIDocument* document = aNode->GetOwnerDoc();
|
||||
nsIDocument* document = aNode->OwnerDoc();
|
||||
|
||||
nsIURI* docURL = document->GetDocumentURI();
|
||||
nsIURI* baseURL = document->GetDocBaseURI();
|
||||
@ -3905,7 +3905,7 @@ nsCanvasRenderingContext2DAzure::DrawWindow(nsIDOMWindow* aWindow, float aX, flo
|
||||
nscolor bgColor;
|
||||
|
||||
nsIDocument* elementDoc = mCanvasElement ?
|
||||
HTMLCanvasElement()->GetOwnerDoc() : nsnull;
|
||||
HTMLCanvasElement()->OwnerDoc() : nsnull;
|
||||
|
||||
// Pass the CSS Loader object to the parser, to allow parser error reports
|
||||
// to include the outer window ID.
|
||||
|
@ -87,7 +87,7 @@ public:
|
||||
nsLoadBlockingPLDOMEvent(nsINode *aEventNode, const nsAString& aEventType,
|
||||
bool aBubbles, bool aDispatchChromeOnly)
|
||||
: nsPLDOMEvent(aEventNode, aEventType, aBubbles, aDispatchChromeOnly),
|
||||
mBlockedDoc(aEventNode->GetOwnerDoc())
|
||||
mBlockedDoc(aEventNode->OwnerDoc())
|
||||
{
|
||||
if (mBlockedDoc) {
|
||||
mBlockedDoc->BlockOnload();
|
||||
@ -96,7 +96,7 @@ public:
|
||||
|
||||
nsLoadBlockingPLDOMEvent(nsINode *aEventNode, nsIDOMEvent *aEvent)
|
||||
: nsPLDOMEvent(aEventNode, aEvent),
|
||||
mBlockedDoc(aEventNode->GetOwnerDoc())
|
||||
mBlockedDoc(aEventNode->OwnerDoc())
|
||||
{
|
||||
if (mBlockedDoc) {
|
||||
mBlockedDoc->BlockOnload();
|
||||
|
@ -425,7 +425,7 @@ static nsIDocument* GetDocumentForReport(nsEvent* aEvent)
|
||||
{
|
||||
nsCOMPtr<nsINode> node = do_QueryInterface(aEvent->currentTarget);
|
||||
if (node)
|
||||
return node->GetOwnerDoc();
|
||||
return node->OwnerDoc();
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aEvent->currentTarget);
|
||||
if (!window)
|
||||
@ -491,7 +491,7 @@ nsDOMEvent::PreventDefault()
|
||||
node = do_QueryInterface(win->GetExtantDocument());
|
||||
}
|
||||
}
|
||||
if (node && !nsContentUtils::IsChromeDoc(node->GetOwnerDoc())) {
|
||||
if (node && !nsContentUtils::IsChromeDoc(node->OwnerDoc())) {
|
||||
mEvent->flags |= NS_EVENT_FLAG_NO_DEFAULT_CALLED_IN_CONTENT;
|
||||
}
|
||||
}
|
||||
|
@ -514,7 +514,7 @@ nsEventDispatcher::Dispatch(nsISupports* aTarget,
|
||||
}
|
||||
|
||||
NS_ENSURE_STATE(node);
|
||||
nsIDocument* doc = node->GetOwnerDoc();
|
||||
nsIDocument* doc = node->OwnerDoc();
|
||||
if (!nsContentUtils::IsChromeDoc(doc)) {
|
||||
nsPIDOMWindow* win = doc ? doc->GetInnerWindow() : nsnull;
|
||||
// If we can't dispatch the event to chrome, do nothing.
|
||||
@ -543,7 +543,7 @@ nsEventDispatcher::Dispatch(nsISupports* aTarget,
|
||||
if (target->GetContextForEventHandlers(&rv) ||
|
||||
NS_FAILED(rv)) {
|
||||
nsCOMPtr<nsINode> node = do_QueryInterface(target);
|
||||
if (node && nsContentUtils::IsChromeDoc(node->GetOwnerDoc())) {
|
||||
if (node && nsContentUtils::IsChromeDoc(node->OwnerDoc())) {
|
||||
NS_WARNING("Fix the caller!");
|
||||
} else {
|
||||
NS_ERROR("This is unsafe! Fix the caller!");
|
||||
|
@ -196,7 +196,7 @@ nsEventListenerManager::GetInnerWindowForTarget()
|
||||
if (node) {
|
||||
// XXX sXBL/XBL2 issue -- do we really want the owner here? What
|
||||
// if that's the XBL document?
|
||||
nsIDocument* document = node->GetOwnerDoc();
|
||||
nsIDocument* document = node->OwnerDoc();
|
||||
if (document)
|
||||
return document->GetInnerWindow();
|
||||
}
|
||||
@ -467,7 +467,7 @@ nsEventListenerManager::AddScriptEventListener(nsIAtom *aName,
|
||||
// Try to get context from doc
|
||||
// XXX sXBL/XBL2 issue -- do we really want the owner here? What
|
||||
// if that's the XBL document?
|
||||
doc = node->GetOwnerDoc();
|
||||
doc = node->OwnerDoc();
|
||||
if (doc)
|
||||
global = doc->GetScriptGlobalObject();
|
||||
} else {
|
||||
@ -646,7 +646,7 @@ nsEventListenerManager::CompileEventHandlerInternal(nsListenerStruct *aListenerS
|
||||
nsCAutoString url (NS_LITERAL_CSTRING("-moz-evil:lying-event-listener"));
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
if (content) {
|
||||
doc = content->GetOwnerDoc();
|
||||
doc = content->OwnerDoc();
|
||||
} else {
|
||||
nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(mTarget);
|
||||
if (win) {
|
||||
|
@ -574,7 +574,7 @@ nsMouseWheelTransaction::OnFailToScrollTarget()
|
||||
if (Preferences::GetBool("test.mousescroll", false)) {
|
||||
// This event is used for automated tests, see bug 442774.
|
||||
nsContentUtils::DispatchTrustedEvent(
|
||||
sTargetFrame->GetContent()->GetOwnerDoc(),
|
||||
sTargetFrame->GetContent()->OwnerDoc(),
|
||||
sTargetFrame->GetContent(),
|
||||
NS_LITERAL_STRING("MozMouseScrollFailed"),
|
||||
true, true);
|
||||
@ -602,7 +602,7 @@ nsMouseWheelTransaction::OnTimeout(nsITimer* aTimer, void* aClosure)
|
||||
if (Preferences::GetBool("test.mousescroll", false)) {
|
||||
// This event is used for automated tests, see bug 442774.
|
||||
nsContentUtils::DispatchTrustedEvent(
|
||||
frame->GetContent()->GetOwnerDoc(),
|
||||
frame->GetContent()->OwnerDoc(),
|
||||
frame->GetContent(),
|
||||
NS_LITERAL_STRING("MozMouseScrollTransactionTimeout"),
|
||||
true, true);
|
||||
@ -891,7 +891,7 @@ nsEventStateManager::~nsEventStateManager()
|
||||
}
|
||||
}
|
||||
|
||||
if (sDragOverContent && sDragOverContent->GetOwnerDoc() == mDocument) {
|
||||
if (sDragOverContent && sDragOverContent->OwnerDoc() == mDocument) {
|
||||
sDragOverContent = nsnull;
|
||||
}
|
||||
|
||||
@ -1431,7 +1431,7 @@ IsAccessKeyTarget(nsIContent* aContent, nsIFrame* aFrame, nsAString& aKey)
|
||||
return false;
|
||||
|
||||
nsCOMPtr<nsIDOMXULDocument> xulDoc =
|
||||
do_QueryInterface(aContent->GetOwnerDoc());
|
||||
do_QueryInterface(aContent->OwnerDoc());
|
||||
if (!xulDoc && !aContent->IsXUL())
|
||||
return true;
|
||||
|
||||
@ -3856,7 +3856,7 @@ public:
|
||||
: mESM(aESM), mEvent(aEvent), mType(aType)
|
||||
{
|
||||
nsPIDOMWindow* win =
|
||||
aTarget ? aTarget->GetOwnerDoc()->GetInnerWindow() : nsnull;
|
||||
aTarget ? aTarget->OwnerDoc()->GetInnerWindow() : nsnull;
|
||||
if (win && win->HasMouseEnterLeaveEventListeners()) {
|
||||
mRelatedTarget = aRelatedTarget ?
|
||||
aRelatedTarget->FindFirstNonNativeAnonymous() : nsnull;
|
||||
@ -4647,7 +4647,7 @@ nsEventStateManager::ContentRemoved(nsIDocument* aDocument, nsIContent* aContent
|
||||
}
|
||||
|
||||
if (sDragOverContent &&
|
||||
sDragOverContent->GetOwnerDoc() == aContent->GetOwnerDoc() &&
|
||||
sDragOverContent->OwnerDoc() == aContent->OwnerDoc() &&
|
||||
nsContentUtils::ContentIsDescendantOf(sDragOverContent, aContent)) {
|
||||
sDragOverContent = nsnull;
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ NS_IMETHODIMP nsPLDOMEvent::Run()
|
||||
bool defaultActionEnabled; // This is not used because the caller is async
|
||||
target->DispatchEvent(mEvent, &defaultActionEnabled);
|
||||
} else {
|
||||
nsIDocument* doc = mEventNode->GetOwnerDoc();
|
||||
nsIDocument* doc = mEventNode->OwnerDoc();
|
||||
if (doc) {
|
||||
if (mDispatchChromeOnly) {
|
||||
nsContentUtils::DispatchChromeEvent(doc, mEventNode, mEventType,
|
||||
|
@ -868,7 +868,7 @@ GetSubmissionFromForm(nsGenericHTMLElement* aForm,
|
||||
enctype == NS_FORM_ENCTYPE_TEXTPLAIN) {
|
||||
*aFormSubmission = new nsFSTextPlain(charset, aOriginatingElement);
|
||||
} else {
|
||||
nsIDocument* doc = aForm->GetOwnerDoc();
|
||||
nsIDocument* doc = aForm->OwnerDoc();
|
||||
if (enctype == NS_FORM_ENCTYPE_MULTIPART ||
|
||||
enctype == NS_FORM_ENCTYPE_TEXTPLAIN) {
|
||||
nsAutoString enctypeStr;
|
||||
|
@ -199,7 +199,7 @@ public:
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
nsIDocument* document = mElement->GetOwnerDoc();
|
||||
nsIDocument* document = mElement->OwnerDoc();
|
||||
if (!document) {
|
||||
return NS_OK;
|
||||
}
|
||||
@ -227,7 +227,7 @@ public:
|
||||
|
||||
// If something is focused in the same document, ignore autofocus.
|
||||
if (!fm->GetFocusedContent() ||
|
||||
fm->GetFocusedContent()->GetOwnerDoc() != document) {
|
||||
fm->GetFocusedContent()->OwnerDoc() != document) {
|
||||
return mElement->Focus();
|
||||
}
|
||||
|
||||
@ -677,7 +677,7 @@ nsGenericHTMLElement::GetInnerHTML(nsAString& aInnerHTML)
|
||||
{
|
||||
aInnerHTML.Truncate();
|
||||
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
if (!doc) {
|
||||
return NS_OK; // We rely on the document for doing HTML conversion
|
||||
}
|
||||
@ -748,7 +748,7 @@ nsGenericHTMLElement::FireMutationEventsForDirectParsing(nsIDocument* aDoc,
|
||||
nsresult
|
||||
nsGenericHTMLElement::SetInnerHTML(const nsAString& aInnerHTML)
|
||||
{
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
NS_ENSURE_STATE(doc);
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
@ -834,7 +834,7 @@ nsGenericHTMLElement::InsertAdjacentHTML(const nsAString& aPosition,
|
||||
destination = this;
|
||||
}
|
||||
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
NS_ENSURE_STATE(doc);
|
||||
|
||||
// Needed when insertAdjacentHTML is used in combination with contenteditable
|
||||
@ -958,7 +958,7 @@ nsGenericHTMLElement::GetSpellcheck(bool* aSpellcheck)
|
||||
}
|
||||
|
||||
// Is this a chrome element?
|
||||
if (nsContentUtils::IsChromeDoc(GetOwnerDoc())) {
|
||||
if (nsContentUtils::IsChromeDoc(OwnerDoc())) {
|
||||
return NS_OK; // Not spellchecked by default
|
||||
}
|
||||
|
||||
@ -1264,7 +1264,7 @@ nsGenericHTMLElement::GetEventListenerManagerForAttr(nsIAtom* aAttrName,
|
||||
// normal.
|
||||
// XXXbz sXBL/XBL2 issue: should we instead use GetCurrentDoc() here,
|
||||
// override BindToTree for those classes and munge event listeners there?
|
||||
nsIDocument *document = GetOwnerDoc();
|
||||
nsIDocument *document = OwnerDoc();
|
||||
|
||||
// FIXME (https://bugzilla.mozilla.org/show_bug.cgi?id=431767)
|
||||
// nsDocument::GetInnerWindow can return an outer window in some cases,
|
||||
@ -1378,7 +1378,7 @@ nsGenericHTMLElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
|
||||
void
|
||||
nsGenericHTMLElement::GetBaseTarget(nsAString& aBaseTarget) const
|
||||
{
|
||||
nsIDocument* ownerDoc = GetOwnerDoc();
|
||||
nsIDocument* ownerDoc = OwnerDoc();
|
||||
if (ownerDoc) {
|
||||
ownerDoc->GetBaseTarget(aBaseTarget);
|
||||
} else {
|
||||
@ -2342,7 +2342,7 @@ nsGenericHTMLElement::GetURIAttr(nsIAtom* aAttr, nsIAtom* aBaseAttr, nsIURI** aU
|
||||
nsCOMPtr<nsIURI> baseAttrURI;
|
||||
nsresult rv =
|
||||
nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(baseAttrURI),
|
||||
baseAttrValue, GetOwnerDoc(),
|
||||
baseAttrValue, OwnerDoc(),
|
||||
baseURI);
|
||||
if (NS_FAILED(rv)) {
|
||||
return true;
|
||||
@ -2355,7 +2355,7 @@ nsGenericHTMLElement::GetURIAttr(nsIAtom* aAttr, nsIAtom* aBaseAttr, nsIURI** aU
|
||||
// return true, and *aURI will be null.
|
||||
nsContentUtils::NewURIWithDocumentCharset(aURI,
|
||||
attr->GetStringValue(),
|
||||
GetOwnerDoc(), baseURI);
|
||||
OwnerDoc(), baseURI);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -2368,7 +2368,7 @@ nsGenericHTMLElement::GetURIListAttr(nsIAtom* aAttr, nsAString& aResult)
|
||||
if (!GetAttr(kNameSpaceID_None, aAttr, value))
|
||||
return NS_OK;
|
||||
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
nsCOMPtr<nsIURI> baseURI = GetBaseURI();
|
||||
|
||||
// Value contains relative URIs split on spaces (U+0020)
|
||||
@ -2973,7 +2973,7 @@ nsGenericHTMLFormElement::AddFormIdObserver()
|
||||
"we should be in a document!");
|
||||
|
||||
nsAutoString formId;
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
GetAttr(kNameSpaceID_None, nsGkAtoms::form, formId);
|
||||
NS_ASSERTION(!formId.IsEmpty(),
|
||||
"@form value should not be the empty string!");
|
||||
@ -2986,7 +2986,7 @@ void
|
||||
nsGenericHTMLFormElement::RemoveFormIdObserver()
|
||||
{
|
||||
/**
|
||||
* We are using GetOwnerDoc() because we don't really care about having the
|
||||
* We are using OwnerDoc() because we don't really care about having the
|
||||
* element actually being in the tree. If it is not and @form value changes,
|
||||
* this method will be called for nothing but removing an observer which does
|
||||
* not exist doesn't cost so much (no entry in the hash table) so having a
|
||||
@ -2994,7 +2994,7 @@ nsGenericHTMLFormElement::RemoveFormIdObserver()
|
||||
* complex for nothing.
|
||||
*/
|
||||
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
|
||||
// At this point, we may not have a document anymore. In that case, we can't
|
||||
// remove the observer. The document did that for us.
|
||||
@ -3365,7 +3365,7 @@ nsGenericHTMLFrameElement::CopyInnerTo(nsGenericElement* aDest) const
|
||||
nsresult rv = nsGenericHTMLElement::CopyInnerTo(aDest);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsIDocument* doc = aDest->GetOwnerDoc();
|
||||
nsIDocument* doc = aDest->OwnerDoc();
|
||||
if (doc->IsStaticDocument() && mFrameLoader) {
|
||||
nsGenericHTMLFrameElement* dest =
|
||||
static_cast<nsGenericHTMLFrameElement*>(aDest);
|
||||
@ -3426,7 +3426,7 @@ nsresult nsGenericHTMLElement::MozRequestFullScreen()
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
NS_ENSURE_STATE(doc);
|
||||
nsCOMPtr<nsIDOMDocument> domDocument(do_QueryInterface(doc));
|
||||
NS_ENSURE_STATE(domDocument);
|
||||
|
@ -204,7 +204,7 @@ nsHTMLAnchorElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Prefetch links
|
||||
if (aDocument && nsHTMLDNSPrefetch::IsAllowed(GetOwnerDoc())) {
|
||||
if (aDocument && nsHTMLDNSPrefetch::IsAllowed(OwnerDoc())) {
|
||||
nsHTMLDNSPrefetch::PrefetchLow(this);
|
||||
}
|
||||
return rv;
|
||||
|
@ -439,7 +439,7 @@ nsHTMLBodyElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
|
||||
nsGenericHTMLElement::WalkContentStyleRules(aRuleWalker);
|
||||
|
||||
if (!mContentStyleRule && IsInDoc()) {
|
||||
// XXXbz should this use GetOwnerDoc() or GetCurrentDoc()?
|
||||
// XXXbz should this use OwnerDoc() or GetCurrentDoc()?
|
||||
// sXBL/XBL2 issue!
|
||||
mContentStyleRule = new BodyRule(this);
|
||||
NS_IF_ADDREF(mContentStyleRule);
|
||||
@ -516,7 +516,7 @@ nsHTMLBodyElement::GetAssociatedEditor()
|
||||
NS_IMETHODIMP nsHTMLBodyElement::GetOn##name_(JSContext *cx, \
|
||||
jsval *vp) { \
|
||||
/* XXXbz note to self: add tests for this! */ \
|
||||
nsPIDOMWindow* win = GetOwnerDoc()->GetInnerWindow(); \
|
||||
nsPIDOMWindow* win = OwnerDoc()->GetInnerWindow(); \
|
||||
if (win && win->IsInnerWindow()) { \
|
||||
nsCOMPtr<nsIInlineEventHandlers> ev = do_QueryInterface(win); \
|
||||
return ev->GetOn##name_(cx, vp); \
|
||||
@ -526,7 +526,7 @@ nsHTMLBodyElement::GetAssociatedEditor()
|
||||
} \
|
||||
NS_IMETHODIMP nsHTMLBodyElement::SetOn##name_(JSContext *cx, \
|
||||
const jsval &v) { \
|
||||
nsPIDOMWindow* win = GetOwnerDoc()->GetInnerWindow(); \
|
||||
nsPIDOMWindow* win = OwnerDoc()->GetInnerWindow(); \
|
||||
if (win && win->IsInnerWindow()) { \
|
||||
nsCOMPtr<nsIInlineEventHandlers> ev = do_QueryInterface(win); \
|
||||
return ev->SetOn##name_(cx, v); \
|
||||
@ -536,7 +536,7 @@ nsHTMLBodyElement::GetAssociatedEditor()
|
||||
#define WINDOW_EVENT(name_, id_, type_, struct_) \
|
||||
NS_IMETHODIMP nsHTMLBodyElement::GetOn##name_(JSContext *cx, \
|
||||
jsval *vp) { \
|
||||
nsPIDOMWindow* win = GetOwnerDoc()->GetInnerWindow(); \
|
||||
nsPIDOMWindow* win = OwnerDoc()->GetInnerWindow(); \
|
||||
if (win && win->IsInnerWindow()) { \
|
||||
return win->GetOn##name_(cx, vp); \
|
||||
} \
|
||||
@ -545,7 +545,7 @@ nsHTMLBodyElement::GetAssociatedEditor()
|
||||
} \
|
||||
NS_IMETHODIMP nsHTMLBodyElement::SetOn##name_(JSContext *cx, \
|
||||
const jsval &v) { \
|
||||
nsPIDOMWindow* win = GetOwnerDoc()->GetInnerWindow(); \
|
||||
nsPIDOMWindow* win = OwnerDoc()->GetInnerWindow(); \
|
||||
if (win && win->IsInnerWindow()) { \
|
||||
return win->SetOn##name_(cx, v); \
|
||||
} \
|
||||
|
@ -156,7 +156,7 @@ nsHTMLCanvasElement::CopyInnerTo(nsGenericElement* aDest) const
|
||||
{
|
||||
nsresult rv = nsGenericHTMLElement::CopyInnerTo(aDest);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (aDest->GetOwnerDoc()->IsStaticDocument()) {
|
||||
if (aDest->OwnerDoc()->IsStaticDocument()) {
|
||||
nsHTMLCanvasElement* dest = static_cast<nsHTMLCanvasElement*>(aDest);
|
||||
nsCOMPtr<nsISupports> cxt;
|
||||
dest->GetContext(NS_LITERAL_STRING("2d"), JSVAL_VOID, getter_AddRefs(cxt));
|
||||
|
@ -292,7 +292,7 @@ nsHTMLDNSPrefetch::nsDeferrals::SubmitQueue()
|
||||
|
||||
while (mHead != mTail) {
|
||||
nsCOMPtr<nsIContent> content = do_QueryReferent(mEntries[mTail].mElement);
|
||||
if (content && content->GetOwnerDoc()) {
|
||||
if (content && content->OwnerDoc()) {
|
||||
nsCOMPtr<Link> link = do_QueryInterface(content);
|
||||
nsCOMPtr<nsIURI> hrefURI(link ? link->GetURI() : nsnull);
|
||||
if (hrefURI)
|
||||
|
@ -742,7 +742,7 @@ nsHTMLFormElement::DoSubmit(nsEvent* aEvent)
|
||||
|
||||
// XXXbz if the script global is that for an sXBL/XBL2 doc, it won't
|
||||
// be a window...
|
||||
nsPIDOMWindow *window = GetOwnerDoc()->GetWindow();
|
||||
nsPIDOMWindow *window = OwnerDoc()->GetWindow();
|
||||
|
||||
if (window) {
|
||||
mSubmitPopupState = window->GetPopupControlState();
|
||||
@ -973,7 +973,7 @@ nsHTMLFormElement::NotifySubmitObservers(nsIURI* aActionURL,
|
||||
// XXXbz what do the submit observers actually want? The window
|
||||
// of the document this is shown in? Or something else?
|
||||
// sXBL/XBL2 issue
|
||||
nsCOMPtr<nsPIDOMWindow> window = GetOwnerDoc()->GetWindow();
|
||||
nsCOMPtr<nsPIDOMWindow> window = OwnerDoc()->GetWindow();
|
||||
|
||||
bool loop = true;
|
||||
while (NS_SUCCEEDED(theEnum->HasMoreElements(&loop)) && loop) {
|
||||
@ -1464,7 +1464,7 @@ nsHTMLFormElement::GetActionURL(nsIURI** aActionURL,
|
||||
}
|
||||
|
||||
// Get base URL
|
||||
nsIDocument *document = GetOwnerDoc();
|
||||
nsIDocument *document = OwnerDoc();
|
||||
nsIURI *docURI = document->GetDocumentURI();
|
||||
NS_ENSURE_TRUE(docURI, NS_ERROR_UNEXPECTED);
|
||||
|
||||
@ -1635,7 +1635,7 @@ nsHTMLFormElement::CheckFormValidity(nsIMutableArray* aInvalidElements) const
|
||||
!cvElmt->IsValid()) {
|
||||
ret = false;
|
||||
bool defaultAction = true;
|
||||
nsContentUtils::DispatchTrustedEvent(sortedControls[i]->GetOwnerDoc(),
|
||||
nsContentUtils::DispatchTrustedEvent(sortedControls[i]->OwnerDoc(),
|
||||
static_cast<nsIContent*>(sortedControls[i]),
|
||||
NS_LITERAL_STRING("invalid"),
|
||||
false, true, &defaultAction);
|
||||
|
@ -258,7 +258,7 @@ nsHTMLFrameSetElement::ParseRowCol(const nsAString & aValue,
|
||||
}
|
||||
|
||||
// Pre-grab the compat mode; we may need it later in the loop.
|
||||
bool isInQuirks = InNavQuirksMode(GetOwnerDoc());
|
||||
bool isInQuirks = InNavQuirksMode(OwnerDoc());
|
||||
|
||||
// Parse each comma separated token
|
||||
|
||||
@ -360,7 +360,7 @@ nsHTMLFrameSetElement::ParseRowCol(const nsAString & aValue,
|
||||
NS_IMETHODIMP nsHTMLFrameSetElement::GetOn##name_(JSContext *cx, \
|
||||
jsval *vp) { \
|
||||
/* XXXbz note to self: add tests for this! */ \
|
||||
nsPIDOMWindow* win = GetOwnerDoc()->GetInnerWindow(); \
|
||||
nsPIDOMWindow* win = OwnerDoc()->GetInnerWindow(); \
|
||||
if (win && win->IsInnerWindow()) { \
|
||||
nsCOMPtr<nsIInlineEventHandlers> ev = do_QueryInterface(win); \
|
||||
return ev->GetOn##name_(cx, vp); \
|
||||
@ -370,7 +370,7 @@ nsHTMLFrameSetElement::ParseRowCol(const nsAString & aValue,
|
||||
} \
|
||||
NS_IMETHODIMP nsHTMLFrameSetElement::SetOn##name_(JSContext *cx, \
|
||||
const jsval &v) { \
|
||||
nsPIDOMWindow* win = GetOwnerDoc()->GetInnerWindow(); \
|
||||
nsPIDOMWindow* win = OwnerDoc()->GetInnerWindow(); \
|
||||
if (win && win->IsInnerWindow()) { \
|
||||
nsCOMPtr<nsIInlineEventHandlers> ev = do_QueryInterface(win); \
|
||||
return ev->SetOn##name_(cx, v); \
|
||||
@ -381,7 +381,7 @@ nsHTMLFrameSetElement::ParseRowCol(const nsAString & aValue,
|
||||
NS_IMETHODIMP nsHTMLFrameSetElement::GetOn##name_(JSContext *cx, \
|
||||
jsval *vp) { \
|
||||
/* XXXbz note to self: add tests for this! */ \
|
||||
nsPIDOMWindow* win = GetOwnerDoc()->GetInnerWindow(); \
|
||||
nsPIDOMWindow* win = OwnerDoc()->GetInnerWindow(); \
|
||||
if (win && win->IsInnerWindow()) { \
|
||||
return win->GetOn##name_(cx, vp); \
|
||||
} \
|
||||
@ -390,7 +390,7 @@ nsHTMLFrameSetElement::ParseRowCol(const nsAString & aValue,
|
||||
} \
|
||||
NS_IMETHODIMP nsHTMLFrameSetElement::SetOn##name_(JSContext *cx, \
|
||||
const jsval &v) { \
|
||||
nsPIDOMWindow* win = GetOwnerDoc()->GetInnerWindow(); \
|
||||
nsPIDOMWindow* win = OwnerDoc()->GetInnerWindow(); \
|
||||
if (win && win->IsInnerWindow()) { \
|
||||
return win->SetOn##name_(cx, v); \
|
||||
} \
|
||||
|
@ -445,9 +445,9 @@ nsHTMLImageElement::IsHTMLFocusable(bool aWithMouse,
|
||||
nsAutoString usemap;
|
||||
GetUseMap(usemap);
|
||||
// XXXbz which document should this be using? sXBL/XBL2 issue! I
|
||||
// think that GetOwnerDoc() is right, since we don't want to
|
||||
// think that OwnerDoc() is right, since we don't want to
|
||||
// assume stuff about the document we're bound to.
|
||||
if (GetOwnerDoc() && GetOwnerDoc()->FindImageMap(usemap)) {
|
||||
if (OwnerDoc() && OwnerDoc()->FindImageMap(usemap)) {
|
||||
if (aTabIndex) {
|
||||
// Use tab index on individual map areas
|
||||
*aTabIndex = (sTabFocusModel & eTabFocus_linksMask)? 0 : -1;
|
||||
@ -650,7 +650,7 @@ nsHTMLImageElement::GetNaturalWidth(PRUint32* aNaturalWidth)
|
||||
nsresult
|
||||
nsHTMLImageElement::CopyInnerTo(nsGenericElement* aDest) const
|
||||
{
|
||||
if (aDest->GetOwnerDoc()->IsStaticDocument()) {
|
||||
if (aDest->OwnerDoc()->IsStaticDocument()) {
|
||||
CreateStaticImageClone(static_cast<nsHTMLImageElement*>(aDest));
|
||||
}
|
||||
return nsGenericHTMLElement::CopyInnerTo(aDest);
|
||||
|
@ -241,7 +241,7 @@ public:
|
||||
AsyncClickHandler(nsHTMLInputElement* aInput)
|
||||
: mInput(aInput) {
|
||||
|
||||
nsIDocument* doc = aInput->GetOwnerDoc();
|
||||
nsIDocument* doc = aInput->OwnerDoc();
|
||||
if (doc) {
|
||||
nsPIDOMWindow* win = doc->GetWindow();
|
||||
if (win)
|
||||
@ -262,7 +262,7 @@ AsyncClickHandler::Run()
|
||||
nsresult rv;
|
||||
|
||||
// Get parent nsPIDOMWindow object.
|
||||
nsCOMPtr<nsIDocument> doc = mInput->GetOwnerDoc();
|
||||
nsCOMPtr<nsIDocument> doc = mInput->OwnerDoc();
|
||||
if (!doc)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
@ -432,7 +432,7 @@ AsyncClickHandler::Run()
|
||||
// event because it will think this is done by a script.
|
||||
// So, we can safely send one by ourself.
|
||||
mInput->SetFiles(newFiles, true);
|
||||
nsContentUtils::DispatchTrustedEvent(mInput->GetOwnerDoc(),
|
||||
nsContentUtils::DispatchTrustedEvent(mInput->OwnerDoc(),
|
||||
static_cast<nsIDOMHTMLInputElement*>(mInput.get()),
|
||||
NS_LITERAL_STRING("change"), true,
|
||||
false);
|
||||
@ -690,7 +690,7 @@ nsHTMLInputElement::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
|
||||
}
|
||||
break;
|
||||
case NS_FORM_INPUT_FILE:
|
||||
if (it->GetOwnerDoc()->IsStaticDocument()) {
|
||||
if (it->OwnerDoc()->IsStaticDocument()) {
|
||||
// We're going to be used in print preview. Since the doc is static
|
||||
// we can just grab the pretty string and use it as wallpaper
|
||||
GetDisplayFileName(it->mStaticDocFileList);
|
||||
@ -708,7 +708,7 @@ nsHTMLInputElement::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
|
||||
}
|
||||
break;
|
||||
case NS_FORM_INPUT_IMAGE:
|
||||
if (it->GetOwnerDoc()->IsStaticDocument()) {
|
||||
if (it->OwnerDoc()->IsStaticDocument()) {
|
||||
CreateStaticImageClone(it);
|
||||
}
|
||||
break;
|
||||
@ -1124,7 +1124,7 @@ nsHTMLInputElement::SetUserInput(const nsAString& aValue)
|
||||
SetValueInternal(aValue, true, true);
|
||||
}
|
||||
|
||||
return nsContentUtils::DispatchTrustedEvent(GetOwnerDoc(),
|
||||
return nsContentUtils::DispatchTrustedEvent(OwnerDoc(),
|
||||
static_cast<nsIDOMHTMLInputElement*>(this),
|
||||
NS_LITERAL_STRING("input"), true,
|
||||
true);
|
||||
@ -1241,7 +1241,7 @@ nsHTMLInputElement::SetPlaceholderClass(bool aVisible, bool aNotify)
|
||||
void
|
||||
nsHTMLInputElement::GetDisplayFileName(nsAString& aValue) const
|
||||
{
|
||||
if (GetOwnerDoc()->IsStaticDocument()) {
|
||||
if (OwnerDoc()->IsStaticDocument()) {
|
||||
aValue = mStaticDocFileList;
|
||||
return;
|
||||
}
|
||||
@ -2042,7 +2042,7 @@ nsHTMLInputElement::PostHandleEvent(nsEventChainPostVisitor& aVisitor)
|
||||
DoSetChecked(originalCheckedValue, true, true);
|
||||
}
|
||||
} else {
|
||||
nsContentUtils::DispatchTrustedEvent(GetOwnerDoc(),
|
||||
nsContentUtils::DispatchTrustedEvent(OwnerDoc(),
|
||||
static_cast<nsIDOMHTMLInputElement*>(this),
|
||||
NS_LITERAL_STRING("change"), true,
|
||||
false);
|
||||
@ -3737,7 +3737,7 @@ nsHTMLInputElement::HasPatternMismatch() const
|
||||
return false;
|
||||
}
|
||||
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
if (!doc) {
|
||||
return false;
|
||||
}
|
||||
|
@ -225,14 +225,14 @@ nsHTMLLinkElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
NS_IMETHODIMP
|
||||
nsHTMLLinkElement::LinkAdded()
|
||||
{
|
||||
CreateAndDispatchEvent(GetOwnerDoc(), NS_LITERAL_STRING("DOMLinkAdded"));
|
||||
CreateAndDispatchEvent(OwnerDoc(), NS_LITERAL_STRING("DOMLinkAdded"));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLLinkElement::LinkRemoved()
|
||||
{
|
||||
CreateAndDispatchEvent(GetOwnerDoc(), NS_LITERAL_STRING("DOMLinkRemoved"));
|
||||
CreateAndDispatchEvent(OwnerDoc(), NS_LITERAL_STRING("DOMLinkRemoved"));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -226,7 +226,7 @@ public:
|
||||
if (IsCancelled())
|
||||
return NS_OK;
|
||||
LOG_EVENT(PR_LOG_DEBUG, ("%p Dispatching simple event source error", mElement.get()));
|
||||
return nsContentUtils::DispatchTrustedEvent(mElement->GetOwnerDoc(),
|
||||
return nsContentUtils::DispatchTrustedEvent(mElement->OwnerDoc(),
|
||||
mSource,
|
||||
NS_LITERAL_STRING("error"),
|
||||
false,
|
||||
@ -1910,7 +1910,7 @@ nsresult nsHTMLMediaElement::NewURIFromString(const nsAutoString& aURISpec, nsIU
|
||||
|
||||
*aURI = nsnull;
|
||||
|
||||
nsCOMPtr<nsIDocument> doc = GetOwnerDoc();
|
||||
nsCOMPtr<nsIDocument> doc = OwnerDoc();
|
||||
if (!doc) {
|
||||
return NS_ERROR_DOM_INVALID_STATE_ERR;
|
||||
}
|
||||
@ -2254,7 +2254,7 @@ ImageContainer* nsHTMLMediaElement::GetImageContainer()
|
||||
return nsnull;
|
||||
|
||||
nsRefPtr<LayerManager> manager =
|
||||
nsContentUtils::PersistentLayerManagerForDocument(GetOwnerDoc());
|
||||
nsContentUtils::PersistentLayerManagerForDocument(OwnerDoc());
|
||||
if (!manager)
|
||||
return nsnull;
|
||||
|
||||
@ -2275,7 +2275,7 @@ nsresult nsHTMLMediaElement::DispatchAudioAvailableEvent(float* aFrameBuffer,
|
||||
// which frees the memory when it's destroyed.
|
||||
nsAutoArrayPtr<float> frameBuffer(aFrameBuffer);
|
||||
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(GetOwnerDoc());
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(OwnerDoc());
|
||||
nsCOMPtr<nsIDOMEventTarget> target(do_QueryObject(this));
|
||||
NS_ENSURE_TRUE(domDoc && target, NS_ERROR_INVALID_ARG);
|
||||
|
||||
@ -2306,7 +2306,7 @@ nsresult nsHTMLMediaElement::DispatchEvent(const nsAString& aName)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return nsContentUtils::DispatchTrustedEvent(GetOwnerDoc(),
|
||||
return nsContentUtils::DispatchTrustedEvent(OwnerDoc(),
|
||||
static_cast<nsIContent*>(this),
|
||||
aName,
|
||||
false,
|
||||
@ -2373,7 +2373,7 @@ void nsHTMLMediaElement::UpdateMediaSize(nsIntSize size)
|
||||
|
||||
void nsHTMLMediaElement::NotifyOwnerDocumentActivityChanged()
|
||||
{
|
||||
nsIDocument* ownerDoc = GetOwnerDoc();
|
||||
nsIDocument* ownerDoc = OwnerDoc();
|
||||
// Don't pause if we have no ownerDoc. Something native must have created
|
||||
// us and be expecting us to work without a document.
|
||||
bool pauseForInactiveDocument =
|
||||
@ -2405,7 +2405,7 @@ void nsHTMLMediaElement::AddRemoveSelfReference()
|
||||
// potential listener for every event. We would also have to keep the
|
||||
// element alive if it was playing and producing audio output --- right now
|
||||
// that's covered by the !mPaused check.
|
||||
nsIDocument* ownerDoc = GetOwnerDoc();
|
||||
nsIDocument* ownerDoc = OwnerDoc();
|
||||
|
||||
// See the comment at the top of this file for the explanation of this
|
||||
// boolean expression.
|
||||
@ -2544,7 +2544,7 @@ void nsHTMLMediaElement::ChangeDelayLoadStatus(bool aDelay) {
|
||||
mDelayingLoadEvent = aDelay;
|
||||
|
||||
if (aDelay) {
|
||||
mLoadBlockedDoc = GetOwnerDoc();
|
||||
mLoadBlockedDoc = OwnerDoc();
|
||||
mLoadBlockedDoc->BlockOnload();
|
||||
LOG(PR_LOG_DEBUG, ("%p ChangeDelayLoadStatus(%d) doc=0x%p", this, aDelay, mLoadBlockedDoc.get()));
|
||||
} else {
|
||||
@ -2565,7 +2565,7 @@ void nsHTMLMediaElement::ChangeDelayLoadStatus(bool aDelay) {
|
||||
|
||||
already_AddRefed<nsILoadGroup> nsHTMLMediaElement::GetDocumentLoadGroup()
|
||||
{
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
return doc ? doc->GetDocumentLoadGroup() : nsnull;
|
||||
}
|
||||
|
||||
@ -2574,7 +2574,7 @@ nsHTMLMediaElement::CopyInnerTo(nsGenericElement* aDest) const
|
||||
{
|
||||
nsresult rv = nsGenericHTMLElement::CopyInnerTo(aDest);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (aDest->GetOwnerDoc()->IsStaticDocument()) {
|
||||
if (aDest->OwnerDoc()->IsStaticDocument()) {
|
||||
nsHTMLMediaElement* dest = static_cast<nsHTMLMediaElement*>(aDest);
|
||||
if (mPrintSurface) {
|
||||
dest->mPrintSurface = mPrintSurface;
|
||||
@ -2627,7 +2627,7 @@ void nsHTMLMediaElement::SetRequestHeaders(nsIHttpChannel* aChannel)
|
||||
NS_LITERAL_CSTRING(""), false);
|
||||
|
||||
// Set the Referer header
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
if (doc) {
|
||||
aChannel->SetReferrer(doc->GetDocumentURI());
|
||||
}
|
||||
|
@ -207,7 +207,7 @@ nsHTMLMenuElement::CanLoadIcon(nsIContent* aContent, const nsAString& aIcon)
|
||||
return false;
|
||||
}
|
||||
|
||||
nsIDocument* doc = aContent->GetOwnerDoc();
|
||||
nsIDocument* doc = aContent->OwnerDoc();
|
||||
if (!doc) {
|
||||
return false;
|
||||
}
|
||||
|
@ -438,7 +438,7 @@ nsHTMLObjectElement::GetContentDocument(nsIDOMDocument **aContentDocument)
|
||||
}
|
||||
|
||||
// XXXbz should this use GetCurrentDoc()? sXBL/XBL2 issue!
|
||||
nsIDocument *sub_doc = GetOwnerDoc()->GetSubDocumentFor(this);
|
||||
nsIDocument *sub_doc = OwnerDoc()->GetSubDocumentFor(this);
|
||||
if (!sub_doc) {
|
||||
return NS_OK;
|
||||
}
|
||||
@ -547,7 +547,7 @@ nsHTMLObjectElement::CopyInnerTo(nsGenericElement* aDest) const
|
||||
nsresult rv = nsGenericHTMLFormElement::CopyInnerTo(aDest);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (aDest->GetOwnerDoc()->IsStaticDocument()) {
|
||||
if (aDest->OwnerDoc()->IsStaticDocument()) {
|
||||
CreateStaticClone(static_cast<nsHTMLObjectElement*>(aDest));
|
||||
}
|
||||
|
||||
|
@ -456,7 +456,7 @@ nsHTMLOptionElement::CopyInnerTo(nsGenericElement* aDest) const
|
||||
nsresult rv = nsGenericHTMLElement::CopyInnerTo(aDest);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (aDest->GetOwnerDoc()->IsStaticDocument()) {
|
||||
if (aDest->OwnerDoc()->IsStaticDocument()) {
|
||||
static_cast<nsHTMLOptionElement*>(aDest)->SetSelected(Selected());
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -234,7 +234,7 @@ nsHTMLSharedElement::GetHref(nsAString& aValue)
|
||||
GetAttr(kNameSpaceID_None, nsGkAtoms::href, href);
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
if (doc) {
|
||||
nsContentUtils::NewURIWithDocumentCharset(
|
||||
getter_AddRefs(uri), href, doc, doc->GetDocumentURI());
|
||||
|
@ -378,7 +378,7 @@ nsHTMLSharedObjectElement::GetSVGDocument(nsIDOMDocument **aResult)
|
||||
}
|
||||
|
||||
// XXXbz should this use GetCurrentDoc()? sXBL/XBL2 issue!
|
||||
nsIDocument *sub_doc = GetOwnerDoc()->GetSubDocumentFor(this);
|
||||
nsIDocument *sub_doc = OwnerDoc()->GetSubDocumentFor(this);
|
||||
if (!sub_doc) {
|
||||
return NS_OK;
|
||||
}
|
||||
@ -504,7 +504,7 @@ nsHTMLSharedObjectElement::CopyInnerTo(nsGenericElement* aDest) const
|
||||
nsresult rv = nsGenericHTMLElement::CopyInnerTo(aDest);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (aDest->GetOwnerDoc()->IsStaticDocument()) {
|
||||
if (aDest->OwnerDoc()->IsStaticDocument()) {
|
||||
CreateStaticClone(static_cast<nsHTMLSharedObjectElement*>(aDest));
|
||||
}
|
||||
|
||||
|
@ -290,7 +290,7 @@ nsHTMLTableCellElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||
// reset large colspan values as IE and opera do
|
||||
// quirks mode does not honor the special html 4 value of 0
|
||||
if (val > MAX_COLSPAN || val < 0 ||
|
||||
(0 == val && InNavQuirksMode(GetOwnerDoc()))) {
|
||||
(0 == val && InNavQuirksMode(OwnerDoc()))) {
|
||||
aResult.SetTo(1);
|
||||
}
|
||||
}
|
||||
@ -301,7 +301,7 @@ nsHTMLTableCellElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||
if (res) {
|
||||
PRInt32 val = aResult.GetIntegerValue();
|
||||
// quirks mode does not honor the special html 4 value of 0
|
||||
if (val < 0 || (0 == val && InNavQuirksMode(GetOwnerDoc()))) {
|
||||
if (val < 0 || (0 == val && InNavQuirksMode(OwnerDoc()))) {
|
||||
aResult.SetTo(1);
|
||||
}
|
||||
}
|
||||
|
@ -1290,7 +1290,7 @@ nsHTMLTextAreaElement::CopyInnerTo(nsGenericElement* aDest) const
|
||||
nsresult rv = nsGenericHTMLFormElement::CopyInnerTo(aDest);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (aDest->GetOwnerDoc()->IsStaticDocument()) {
|
||||
if (aDest->OwnerDoc()->IsStaticDocument()) {
|
||||
nsAutoString value;
|
||||
const_cast<nsHTMLTextAreaElement*>(this)->GetValue(value);
|
||||
static_cast<nsHTMLTextAreaElement*>(aDest)->SetValue(value);
|
||||
|
@ -131,7 +131,7 @@ nsIConstraintValidation::CheckValidity(bool* aValidity)
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(this);
|
||||
NS_ASSERTION(content, "This class should be inherited by HTML elements only!");
|
||||
|
||||
return nsContentUtils::DispatchTrustedEvent(content->GetOwnerDoc(), content,
|
||||
return nsContentUtils::DispatchTrustedEvent(content->OwnerDoc(), content,
|
||||
NS_LITERAL_STRING("invalid"),
|
||||
false, true);
|
||||
}
|
||||
|
@ -2533,7 +2533,7 @@ public:
|
||||
}
|
||||
|
||||
NS_IMETHOD Run() {
|
||||
if (mElement && mElement->GetOwnerDoc() == mDoc) {
|
||||
if (mElement && mElement->OwnerDoc() == mDoc) {
|
||||
mDoc->DeferredContentEditableCountChange(mElement);
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -581,7 +581,7 @@ nsMathMLElement::IsLink(nsIURI** aURI) const
|
||||
nsAutoString hrefStr;
|
||||
href->ToString(hrefStr);
|
||||
nsContentUtils::NewURIWithDocumentCharset(aURI, hrefStr,
|
||||
GetOwnerDoc(), baseURI);
|
||||
OwnerDoc(), baseURI);
|
||||
// must promise out param is non-null if we return true
|
||||
return !!*aURI;
|
||||
}
|
||||
@ -612,7 +612,7 @@ nsMathMLElement::GetLinkTarget(nsAString& aTarget)
|
||||
case 1:
|
||||
return;
|
||||
}
|
||||
nsIDocument* ownerDoc = GetOwnerDoc();
|
||||
nsIDocument* ownerDoc = OwnerDoc();
|
||||
if (ownerDoc) {
|
||||
ownerDoc->GetBaseTarget(aTarget);
|
||||
}
|
||||
|
@ -255,7 +255,7 @@ nsSVGAElement::IsLink(nsIURI** aURI) const
|
||||
nsAutoString str;
|
||||
mStringAttributes[HREF].GetAnimValue(str, this);
|
||||
nsContentUtils::NewURIWithDocumentCharset(aURI, str,
|
||||
GetOwnerDoc(), baseURI);
|
||||
OwnerDoc(), baseURI);
|
||||
// must promise out param is non-null if we return true
|
||||
return !!*aURI;
|
||||
}
|
||||
@ -281,7 +281,7 @@ nsSVGAElement::GetLinkTarget(nsAString& aTarget)
|
||||
case 1:
|
||||
return;
|
||||
}
|
||||
nsIDocument* ownerDoc = GetOwnerDoc();
|
||||
nsIDocument* ownerDoc = OwnerDoc();
|
||||
if (ownerDoc) {
|
||||
ownerDoc->GetBaseTarget(aTarget);
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ nsSVGAnimateTransformElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||
atom != nsGkAtoms::rotate &&
|
||||
atom != nsGkAtoms::skewX &&
|
||||
atom != nsGkAtoms::skewY) {
|
||||
ReportAttributeParseFailure(GetOwnerDoc(), aAttribute, aValue);
|
||||
ReportAttributeParseFailure(OwnerDoc(), aAttribute, aValue);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -310,7 +310,7 @@ nsSVGAnimationElement::BindToTree(nsIDocument* aDocument,
|
||||
void
|
||||
nsSVGAnimationElement::UnbindFromTree(bool aDeep, bool aNullParent)
|
||||
{
|
||||
nsIDocument *doc = GetOwnerDoc();
|
||||
nsIDocument *doc = OwnerDoc();
|
||||
if (doc) {
|
||||
nsSMILAnimationController *controller = doc->GetAnimationController();
|
||||
if (controller) {
|
||||
@ -357,7 +357,7 @@ nsSVGAnimationElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||
if (foundMatch) {
|
||||
AnimationNeedsResample();
|
||||
if (NS_FAILED(rv)) {
|
||||
ReportAttributeParseFailure(GetOwnerDoc(), aAttribute, aValue);
|
||||
ReportAttributeParseFailure(OwnerDoc(), aAttribute, aValue);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -500,7 +500,7 @@ nsSVGAnimationElement::UpdateHrefTarget(nsIContent* aNodeForContext,
|
||||
nsCOMPtr<nsIURI> targetURI;
|
||||
nsCOMPtr<nsIURI> baseURI = GetBaseURI();
|
||||
nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(targetURI),
|
||||
aHrefStr, GetOwnerDoc(), baseURI);
|
||||
aHrefStr, OwnerDoc(), baseURI);
|
||||
mHrefTarget.Reset(aNodeForContext, targetURI);
|
||||
AnimationTargetChanged();
|
||||
}
|
||||
|
@ -543,7 +543,7 @@ nsSVGElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||
|
||||
if (foundMatch) {
|
||||
if (NS_FAILED(rv)) {
|
||||
ReportAttributeParseFailure(GetOwnerDoc(), aAttribute, aValue);
|
||||
ReportAttributeParseFailure(OwnerDoc(), aAttribute, aValue);
|
||||
return false;
|
||||
}
|
||||
aResult.SetTo(aValue);
|
||||
@ -812,7 +812,7 @@ nsSVGElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
|
||||
// whether this is a "no-animation restyle". (This should match the check
|
||||
// in nsHTMLCSSStyleSheet::RulesMatching(), where we determine whether to
|
||||
// apply the SMILOverrideStyle.)
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
NS_ASSERTION(doc, "SVG element without doc");
|
||||
if (doc) {
|
||||
nsIPresShell* shell = doc->GetShell();
|
||||
@ -1129,7 +1129,7 @@ nsSVGElement::UpdateContentStyleRule()
|
||||
return;
|
||||
}
|
||||
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
if (!doc) {
|
||||
NS_ERROR("SVG element without owner document");
|
||||
return;
|
||||
@ -1193,7 +1193,7 @@ nsSVGElement::UpdateAnimatedContentStyleRule()
|
||||
NS_ABORT_IF_FALSE(!GetAnimatedContentStyleRule(),
|
||||
"Animated content style rule already set");
|
||||
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
if (!doc) {
|
||||
NS_ERROR("SVG element without owner document");
|
||||
return;
|
||||
|
@ -5437,7 +5437,7 @@ nsSVGFEImageElement::LoadSVGImage(bool aForce, bool aNotify)
|
||||
NS_MakeAbsoluteURI(href, href, baseURI);
|
||||
|
||||
// Make sure we don't get in a recursive death-spiral
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
if (doc) {
|
||||
nsCOMPtr<nsIURI> hrefAsURI;
|
||||
if (NS_SUCCEEDED(StringToURI(href, doc, getter_AddRefs(hrefAsURI)))) {
|
||||
|
@ -295,7 +295,7 @@ nsSVGImageElement::DidAnimateString(PRUint8 aAttrEnum)
|
||||
nsresult
|
||||
nsSVGImageElement::CopyInnerTo(nsGenericElement* aDest) const
|
||||
{
|
||||
if (aDest->GetOwnerDoc()->IsStaticDocument()) {
|
||||
if (aDest->OwnerDoc()->IsStaticDocument()) {
|
||||
CreateStaticImageClone(static_cast<nsSVGImageElement*>(aDest));
|
||||
}
|
||||
return nsSVGImageElementBase::CopyInnerTo(aDest);
|
||||
|
@ -245,7 +245,7 @@ nsSVGMpathElement::UpdateHrefTarget(nsIContent* aParent,
|
||||
nsCOMPtr<nsIURI> targetURI;
|
||||
nsCOMPtr<nsIURI> baseURI = GetBaseURI();
|
||||
nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(targetURI),
|
||||
aHrefStr, GetOwnerDoc(), baseURI);
|
||||
aHrefStr, OwnerDoc(), baseURI);
|
||||
|
||||
// Stop observing old target (if any)
|
||||
if (mHrefTarget.get()) {
|
||||
|
@ -248,7 +248,7 @@ protected:
|
||||
|
||||
bool IsRoot() const {
|
||||
NS_ASSERTION((IsInDoc() && !GetParent()) ==
|
||||
(GetOwnerDoc() && (GetOwnerDoc()->GetRootElement() == this)),
|
||||
(OwnerDoc() && (OwnerDoc()->GetRootElement() == this)),
|
||||
"Can't determine if we're root");
|
||||
return IsInDoc() && !GetParent();
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ nsSVGStylableElement::DidAnimateClass()
|
||||
}
|
||||
mClassAnimAttr->ParseAtomArray(src);
|
||||
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
NS_ASSERTION(doc, "If we're animating we should have an owner");
|
||||
if (doc) {
|
||||
nsIPresShell* shell = doc->GetShell();
|
||||
|
@ -318,8 +318,8 @@ nsSVGUseElement::CreateAnonymousContent()
|
||||
nsCOMPtr<nsIDOMNode> newnode;
|
||||
nsCOMArray<nsINode> unused;
|
||||
nsNodeInfoManager* nodeInfoManager =
|
||||
targetContent->GetOwnerDoc() == GetOwnerDoc() ?
|
||||
nsnull : GetOwnerDoc()->NodeInfoManager();
|
||||
targetContent->OwnerDoc() == OwnerDoc() ?
|
||||
nsnull : OwnerDoc()->NodeInfoManager();
|
||||
nsNodeUtils::Clone(targetContent, true, nodeInfoManager, unused,
|
||||
getter_AddRefs(newnode));
|
||||
|
||||
|
@ -932,7 +932,7 @@ nsBindingManager::RemoveLayeredBinding(nsIContent* aContent, nsIURI* aURL)
|
||||
// XXXbz should that be ownerdoc? Wouldn't we need a ref to the
|
||||
// currentdoc too? What's the one that should be passed to
|
||||
// ChangeDocument?
|
||||
nsCOMPtr<nsIDocument> doc = aContent->GetOwnerDoc();
|
||||
nsCOMPtr<nsIDocument> doc = aContent->OwnerDoc();
|
||||
NS_ASSERTION(doc, "No owner document?");
|
||||
|
||||
// Finally remove the binding...
|
||||
@ -1251,7 +1251,7 @@ nsBindingManager::GetBindingImplementation(nsIContent* aContent, REFNSIID aIID,
|
||||
// We have never made a wrapper for this implementation.
|
||||
// Create an XPC wrapper for the script object and hand it back.
|
||||
|
||||
nsIDocument* doc = aContent->GetOwnerDoc();
|
||||
nsIDocument* doc = aContent->OwnerDoc();
|
||||
if (!doc)
|
||||
return NS_NOINTERFACE;
|
||||
|
||||
|
@ -178,7 +178,7 @@ XBLResolve(JSContext *cx, JSObject *obj, jsid id, uintN flags,
|
||||
}
|
||||
|
||||
// This mirrors code in nsXBLProtoImpl::InstallImplementation
|
||||
nsIDocument* doc = content->GetOwnerDoc();
|
||||
nsIDocument* doc = content->OwnerDoc();
|
||||
if (!doc) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
@ -276,7 +276,7 @@ nsXBLBinding::nsXBLBinding(nsXBLPrototypeBinding* aBinding)
|
||||
nsXBLBinding::~nsXBLBinding(void)
|
||||
{
|
||||
if (mContent) {
|
||||
nsXBLBinding::UninstallAnonymousContent(mContent->GetOwnerDoc(), mContent);
|
||||
nsXBLBinding::UninstallAnonymousContent(mContent->OwnerDoc(), mContent);
|
||||
}
|
||||
delete mInsertionPointTable;
|
||||
nsXBLDocumentInfo* info = mPrototypeBinding->XBLDocumentInfo();
|
||||
@ -303,7 +303,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_NATIVE(nsXBLBinding)
|
||||
// XXX Probably can't unlink mPrototypeBinding->XBLDocumentInfo(), because
|
||||
// mPrototypeBinding is weak.
|
||||
if (tmp->mContent) {
|
||||
nsXBLBinding::UninstallAnonymousContent(tmp->mContent->GetOwnerDoc(),
|
||||
nsXBLBinding::UninstallAnonymousContent(tmp->mContent->OwnerDoc(),
|
||||
tmp->mContent);
|
||||
}
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mContent)
|
||||
@ -553,7 +553,7 @@ RealizeDefaultContent(nsISupports* aKey,
|
||||
data->mRv = NS_ERROR_FAILURE;
|
||||
return PL_DHASH_STOP;
|
||||
}
|
||||
nsIDocument *document = insParent->GetOwnerDoc();
|
||||
nsIDocument *document = insParent->OwnerDoc();
|
||||
if (!document) {
|
||||
data->mRv = NS_ERROR_FAILURE;
|
||||
return PL_DHASH_STOP;
|
||||
@ -641,7 +641,7 @@ nsXBLBinding::GenerateAnonymousContent()
|
||||
#endif
|
||||
|
||||
if (hasContent || hasInsertionPoints) {
|
||||
nsIDocument* doc = mBoundElement->GetOwnerDoc();
|
||||
nsIDocument* doc = mBoundElement->OwnerDoc();
|
||||
|
||||
// XXX doc will be null if we're in the midst of paint suppression.
|
||||
if (! doc)
|
||||
@ -834,7 +834,7 @@ nsXBLBinding::InstallEventHandlers()
|
||||
return;
|
||||
|
||||
bool isChromeDoc =
|
||||
nsContentUtils::IsChromeDoc(mBoundElement->GetOwnerDoc());
|
||||
nsContentUtils::IsChromeDoc(mBoundElement->OwnerDoc());
|
||||
bool isChromeBinding = mPrototypeBinding->IsChrome();
|
||||
nsXBLPrototypeHandler* curr;
|
||||
for (curr = handlerChain; curr; curr = curr->GetNextHandler()) {
|
||||
@ -1378,7 +1378,7 @@ nsXBLBinding::AllowScripts()
|
||||
return false;
|
||||
}
|
||||
|
||||
nsIDocument* doc = mBoundElement ? mBoundElement->GetOwnerDoc() : nsnull;
|
||||
nsIDocument* doc = mBoundElement ? mBoundElement->OwnerDoc() : nsnull;
|
||||
if (!doc) {
|
||||
return false;
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ nsXBLInsertionPoint::nsXBLInsertionPoint(nsIContent* aParentElement,
|
||||
nsXBLInsertionPoint::~nsXBLInsertionPoint()
|
||||
{
|
||||
if (mDefaultContent) {
|
||||
nsXBLBinding::UninstallAnonymousContent(mDefaultContent->GetOwnerDoc(),
|
||||
nsXBLBinding::UninstallAnonymousContent(mDefaultContent->OwnerDoc(),
|
||||
mDefaultContent);
|
||||
}
|
||||
}
|
||||
@ -62,7 +62,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_NATIVE(nsXBLInsertionPoint)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMARRAY(mElements)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mDefaultContentTemplate)
|
||||
if (tmp->mDefaultContent) {
|
||||
nsXBLBinding::UninstallAnonymousContent(tmp->mDefaultContent->GetOwnerDoc(),
|
||||
nsXBLBinding::UninstallAnonymousContent(tmp->mDefaultContent->OwnerDoc(),
|
||||
tmp->mDefaultContent);
|
||||
}
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mDefaultContent)
|
||||
@ -113,6 +113,6 @@ nsXBLInsertionPoint::UnbindDefaultContent()
|
||||
}
|
||||
|
||||
// Undo InstallAnonymousContent.
|
||||
nsXBLBinding::UninstallAnonymousContent(mDefaultContent->GetOwnerDoc(),
|
||||
nsXBLBinding::UninstallAnonymousContent(mDefaultContent->OwnerDoc(),
|
||||
mDefaultContent);
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ nsXBLProtoImpl::InstallImplementation(nsXBLPrototypeBinding* aBinding, nsIConten
|
||||
|
||||
// If the way this gets the script context changes, fix
|
||||
// nsXBLProtoImplAnonymousMethod::Execute
|
||||
nsIDocument* document = aBoundElement->GetOwnerDoc();
|
||||
nsIDocument* document = aBoundElement->OwnerDoc();
|
||||
if (!document) return NS_OK;
|
||||
|
||||
nsIScriptGlobalObject *global = document->GetScopeObject();
|
||||
@ -138,7 +138,7 @@ nsXBLProtoImpl::InitTargetObjects(nsXBLPrototypeBinding* aBinding,
|
||||
return NS_OK; // This can be ok, if all we've got are fields (and no methods/properties).
|
||||
}
|
||||
|
||||
nsIDocument *ownerDoc = aBoundElement->GetOwnerDoc();
|
||||
nsIDocument *ownerDoc = aBoundElement->OwnerDoc();
|
||||
nsIScriptGlobalObject *sgo;
|
||||
|
||||
if (!ownerDoc || !(sgo = ownerDoc->GetScopeObject())) {
|
||||
|
@ -130,7 +130,7 @@ nsXBLProtoImplMethod::InstallMember(nsIScriptContext* aContext,
|
||||
"Should not be installing an uncompiled method");
|
||||
JSContext* cx = aContext->GetNativeContext();
|
||||
|
||||
nsIDocument *ownerDoc = aBoundElement->GetOwnerDoc();
|
||||
nsIDocument *ownerDoc = aBoundElement->OwnerDoc();
|
||||
nsIScriptGlobalObject *sgo;
|
||||
|
||||
if (!ownerDoc || !(sgo = ownerDoc->GetScopeObject())) {
|
||||
@ -279,7 +279,7 @@ nsXBLProtoImplAnonymousMethod::Execute(nsIContent* aBoundElement)
|
||||
|
||||
// Get the script context the same way
|
||||
// nsXBLProtoImpl::InstallImplementation does.
|
||||
nsIDocument* document = aBoundElement->GetOwnerDoc();
|
||||
nsIDocument* document = aBoundElement->OwnerDoc();
|
||||
if (!document) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ nsXBLProtoImplProperty::InstallMember(nsIScriptContext* aContext,
|
||||
"Should not be installing an uncompiled property");
|
||||
JSContext* cx = aContext->GetNativeContext();
|
||||
|
||||
nsIDocument *ownerDoc = aBoundElement->GetOwnerDoc();
|
||||
nsIDocument *ownerDoc = aBoundElement->OwnerDoc();
|
||||
nsIScriptGlobalObject *sgo;
|
||||
|
||||
if (!ownerDoc || !(sgo = ownerDoc->GetScopeObject())) {
|
||||
|
@ -883,7 +883,7 @@ nsXBLPrototypeBinding::LocateInstance(nsIContent* aBoundElement,
|
||||
if (childPoint && aBoundElement) {
|
||||
// First we have to locate this insertion point and use its index and its
|
||||
// count to detemine our precise position within the template.
|
||||
nsIDocument* doc = aBoundElement->GetOwnerDoc();
|
||||
nsIDocument* doc = aBoundElement->OwnerDoc();
|
||||
nsXBLBinding *binding = doc->BindingManager()->GetBinding(aBoundElement);
|
||||
nsIContent *anonContent = nsnull;
|
||||
|
||||
|
@ -292,7 +292,7 @@ nsXBLPrototypeHandler::ExecuteHandler(nsIDOMEventTarget* aTarget,
|
||||
nsCOMPtr<nsIContent> content(do_QueryInterface(aTarget));
|
||||
if (!content)
|
||||
return NS_OK;
|
||||
boundDocument = content->GetOwnerDoc();
|
||||
boundDocument = content->OwnerDoc();
|
||||
if (!boundDocument)
|
||||
return NS_OK;
|
||||
}
|
||||
@ -422,7 +422,7 @@ nsXBLPrototypeHandler::DispatchXBLCommand(nsIDOMEventTarget* aTarget, nsIDOMEven
|
||||
// normally. It's not clear that the owner doc is the right
|
||||
// thing.
|
||||
if (elt)
|
||||
doc = elt->GetOwnerDoc();
|
||||
doc = elt->OwnerDoc();
|
||||
|
||||
if (!doc)
|
||||
doc = do_QueryInterface(aTarget);
|
||||
@ -986,7 +986,7 @@ nsXBLPrototypeHandler::ReportKeyConflict(const PRUnichar* aKey, const PRUnichar*
|
||||
doc = docInfo->GetDocument();
|
||||
}
|
||||
} else if (aKeyElement) {
|
||||
doc = aKeyElement->GetOwnerDoc();
|
||||
doc = aKeyElement->OwnerDoc();
|
||||
}
|
||||
|
||||
const PRUnichar* params[] = { aKey, aModifiers };
|
||||
|
@ -547,7 +547,7 @@ nsXBLService::LoadBindings(nsIContent* aContent, nsIURI* aURL,
|
||||
|
||||
nsresult rv;
|
||||
|
||||
nsCOMPtr<nsIDocument> document = aContent->GetOwnerDoc();
|
||||
nsCOMPtr<nsIDocument> document = aContent->OwnerDoc();
|
||||
|
||||
// XXX document may be null if we're in the midst of paint suppression
|
||||
if (!document)
|
||||
@ -657,7 +657,7 @@ nsXBLService::LoadBindings(nsIContent* aContent, nsIURI* aURL,
|
||||
nsresult
|
||||
nsXBLService::FlushStyleBindings(nsIContent* aContent)
|
||||
{
|
||||
nsCOMPtr<nsIDocument> document = aContent->GetOwnerDoc();
|
||||
nsCOMPtr<nsIDocument> document = aContent->OwnerDoc();
|
||||
|
||||
// XXX doc will be null if we're in the midst of paint suppression.
|
||||
if (! document)
|
||||
@ -686,7 +686,7 @@ NS_IMETHODIMP
|
||||
nsXBLService::ResolveTag(nsIContent* aContent, PRInt32* aNameSpaceID,
|
||||
nsIAtom** aResult)
|
||||
{
|
||||
nsIDocument* document = aContent->GetOwnerDoc();
|
||||
nsIDocument* document = aContent->OwnerDoc();
|
||||
if (document) {
|
||||
*aResult = document->BindingManager()->ResolveTag(aContent, aNameSpaceID);
|
||||
NS_IF_ADDREF(*aResult);
|
||||
@ -865,7 +865,7 @@ nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI,
|
||||
nsCAutoString ref;
|
||||
aURI->GetRef(ref);
|
||||
|
||||
nsCOMPtr<nsIDocument> boundDocument = aBoundElement->GetOwnerDoc();
|
||||
nsCOMPtr<nsIDocument> boundDocument = aBoundElement->OwnerDoc();
|
||||
|
||||
nsRefPtr<nsXBLDocumentInfo> docInfo;
|
||||
nsresult rv = LoadBindingDocumentInfo(aBoundElement, boundDocument, aURI,
|
||||
|
@ -179,7 +179,7 @@ nsXMLStylesheetPI::GetStyleSheetURL(bool* aIsInline)
|
||||
|
||||
nsIURI *baseURL;
|
||||
nsCAutoString charset;
|
||||
nsIDocument *document = GetOwnerDoc();
|
||||
nsIDocument *document = OwnerDoc();
|
||||
if (document) {
|
||||
baseURL = mOverriddenBaseURI ?
|
||||
mOverriddenBaseURI.get() :
|
||||
|
@ -87,7 +87,7 @@ URIUtils::ResetWithSource(nsIDocument *aNewDoc, nsIDOMNode *aSourceNode)
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocument> sourceDoc = node->GetOwnerDoc();
|
||||
nsCOMPtr<nsIDocument> sourceDoc = node->OwnerDoc();
|
||||
if (!sourceDoc) {
|
||||
NS_ERROR("no source document found");
|
||||
// XXXbz passing nsnull as the first arg to Reset is illegal
|
||||
|
@ -574,7 +574,7 @@ txXPathNodeUtils::getDocument(const txXPathNode& aNode)
|
||||
txXPathNode*
|
||||
txXPathNodeUtils::getOwnerDocument(const txXPathNode& aNode)
|
||||
{
|
||||
nsIDocument* document = aNode.mNode->GetOwnerDoc();
|
||||
nsIDocument* document = aNode.mNode->OwnerDoc();
|
||||
return document ? new txXPathNode(document) : nsnull;
|
||||
}
|
||||
|
||||
|
@ -156,10 +156,10 @@ createAndAddToResult(nsIAtom* aName, const nsSubstring& aValue,
|
||||
txNodeSet* aResultSet, nsIContent* aResultHolder)
|
||||
{
|
||||
NS_ASSERTION(aResultHolder->IsNodeOfType(nsINode::eDOCUMENT_FRAGMENT) &&
|
||||
aResultHolder->GetOwnerDoc(),
|
||||
aResultHolder->OwnerDoc(),
|
||||
"invalid result-holder");
|
||||
|
||||
nsIDocument* doc = aResultHolder->GetOwnerDoc();
|
||||
nsIDocument* doc = aResultHolder->OwnerDoc();
|
||||
nsCOMPtr<nsIContent> elem;
|
||||
nsresult rv = doc->CreateElem(nsDependentAtomString(aName),
|
||||
nsnull, kNameSpaceID_None, false,
|
||||
|
@ -720,7 +720,7 @@ TX_CompileStylesheet(nsINode* aNode, txMozillaXSLTProcessor* aProcessor,
|
||||
txStylesheet** aStylesheet)
|
||||
{
|
||||
// If we move GetBaseURI to nsINode this can be simplified.
|
||||
nsCOMPtr<nsIDocument> doc = aNode->GetOwnerDoc();
|
||||
nsCOMPtr<nsIDocument> doc = aNode->OwnerDoc();
|
||||
NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
|
@ -64,7 +64,7 @@ txMozillaTextOutput::txMozillaTextOutput(nsIDOMDocumentFragment* aDest)
|
||||
{
|
||||
MOZ_COUNT_CTOR(txMozillaTextOutput);
|
||||
mTextParent = do_QueryInterface(aDest);
|
||||
mDocument = mTextParent->GetOwnerDoc();
|
||||
mDocument = mTextParent->OwnerDoc();
|
||||
}
|
||||
|
||||
txMozillaTextOutput::~txMozillaTextOutput()
|
||||
|
@ -117,7 +117,7 @@ txMozillaXMLOutput::txMozillaXMLOutput(txOutputFormat* aFormat,
|
||||
mOutputFormat.setFromDefaults();
|
||||
|
||||
mCurrentNode = do_QueryInterface(aFragment);
|
||||
mDocument = mCurrentNode->GetOwnerDoc();
|
||||
mDocument = mCurrentNode->OwnerDoc();
|
||||
if (mDocument) {
|
||||
mNodeInfoManager = mDocument->NodeInfoManager();
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user