Bug 1263785 - Kill off the deprecated nsINode::GetCurrentDoc. r=baku

This commit is contained in:
Jonathan Watt 2016-03-31 12:46:32 +01:00
Родитель fb7bb15e68
Коммит 9480920b04
53 изменённых файлов: 91 добавлений и 99 удалений

Просмотреть файл

@ -360,7 +360,7 @@ nsAccessibilityService::Observe(nsISupports *aSubject, const char *aTopic,
void
nsAccessibilityService::NotifyOfAnchorJumpTo(nsIContent* aTargetNode)
{
nsIDocument* documentNode = aTargetNode->GetCurrentDoc();
nsIDocument* documentNode = aTargetNode->GetUncomposedDoc();
if (documentNode) {
DocAccessible* document = GetDocAccessible(documentNode);
if (document)

Просмотреть файл

@ -78,7 +78,7 @@ nsCoreUtils::DispatchClickEvent(nsITreeBoxObject *aTreeBoxObj,
return;
nsCOMPtr<nsIContent> tcContent(do_QueryInterface(tcElm));
nsIDocument *document = tcContent->GetCurrentDoc();
nsIDocument *document = tcContent->GetUncomposedDoc();
if (!document)
return;

Просмотреть файл

@ -278,7 +278,7 @@ Accessible::AccessKey() const
}
// Determine the access modifier used in this context.
nsIDocument* document = mContent->GetCurrentDoc();
nsIDocument* document = mContent->GetUncomposedDoc();
if (!document)
return KeyBinding();

Просмотреть файл

@ -32,7 +32,7 @@ OuterDocAccessible::
// Request document accessible for the content document to make sure it's
// created. It will appended to outerdoc accessible children asynchronously.
nsIDocument* outerDoc = mContent->GetCurrentDoc();
nsIDocument* outerDoc = mContent->GetUncomposedDoc();
if (outerDoc) {
nsIDocument* innerDoc = outerDoc->GetSubDocumentFor(mContent);
if (innerDoc)

Просмотреть файл

@ -493,7 +493,7 @@ AccessibleWrap::get_accRole(
nsAutoString roleString;
if (msaaRole != ROLE_SYSTEM_CLIENT &&
!content->GetAttr(kNameSpaceID_None, nsGkAtoms::role, roleString)) {
nsIDocument * document = content->GetCurrentDoc();
nsIDocument * document = content->GetUncomposedDoc();
if (!document)
return E_FAIL;

Просмотреть файл

@ -334,7 +334,7 @@ nsDOMWindowUtils::SetDisplayPortForElement(float aXPx, float aYPx,
return NS_ERROR_INVALID_ARG;
}
if (content->GetCurrentDoc() != presShell->GetDocument()) {
if (content->GetUncomposedDoc() != presShell->GetDocument()) {
return NS_ERROR_INVALID_ARG;
}
@ -414,7 +414,7 @@ nsDOMWindowUtils::SetDisplayPortMarginsForElement(float aLeftMargin,
return NS_ERROR_INVALID_ARG;
}
if (content->GetCurrentDoc() != presShell->GetDocument()) {
if (content->GetUncomposedDoc() != presShell->GetDocument()) {
return NS_ERROR_INVALID_ARG;
}
@ -454,7 +454,7 @@ nsDOMWindowUtils::SetDisplayPortBaseForElement(int32_t aX,
return NS_ERROR_INVALID_ARG;
}
if (content->GetCurrentDoc() != presShell->GetDocument()) {
if (content->GetUncomposedDoc() != presShell->GetDocument()) {
return NS_ERROR_INVALID_ARG;
}
@ -1180,7 +1180,7 @@ nsDOMWindowUtils::GetWidgetForElement(nsIDOMElement* aElement)
return GetWidget();
nsCOMPtr<nsIContent> content = do_QueryInterface(aElement);
nsIDocument* doc = content->GetCurrentDoc();
nsIDocument* doc = content->GetUncomposedDoc();
nsIPresShell* presShell = doc ? doc->GetShell() : nullptr;
if (presShell) {
@ -1783,7 +1783,7 @@ nsDOMWindowUtils::DispatchDOMEventViaPresShell(nsIDOMNode* aTarget,
if (content->OwnerDoc()->GetWindow() != window) {
return NS_ERROR_DOM_HIERARCHY_REQUEST_ERR;
}
nsCOMPtr<nsIDocument> targetDoc = content->GetCurrentDoc();
nsCOMPtr<nsIDocument> targetDoc = content->GetUncomposedDoc();
NS_ENSURE_STATE(targetDoc);
RefPtr<nsIPresShell> targetShell = targetDoc->GetShell();
NS_ENSURE_STATE(targetShell);
@ -2248,7 +2248,7 @@ ComputeAnimationValue(nsCSSProperty aProperty,
const nsAString& aInput,
StyleAnimationValue& aOutput)
{
nsIDocument* doc = aElement->GetCurrentDoc();
nsIDocument* doc = aElement->GetUncomposedDoc();
nsIPresShell* shell = doc->GetShell();
if (!shell) {
return false;

Просмотреть файл

@ -74,8 +74,8 @@ public:
* @param aDocument The new document for the content node. May not be null
* if aParent is null. Must match the current document of
* aParent, if aParent is not null (note that
* aParent->GetCurrentDoc() can be null, in which case this
* must also be null).
* aParent->GetUncomposedDoc() can be null, in which case
* this must also be null).
* @param aParent The new parent for the content node. May be null if the
* node is being bound as a direct child of the document.
* @param aBindingParent The new binding parent for the content node.

Просмотреть файл

@ -521,14 +521,6 @@ public:
return IsInUncomposedDoc() ? OwnerDoc() : nullptr;
}
/**
* @deprecated
*/
nsIDocument *GetCurrentDoc() const
{
return GetUncomposedDoc();
}
/**
* This method returns the owner doc if the node is in the
* composed document (as defined in the Shadow DOM spec), otherwise

Просмотреть файл

@ -183,9 +183,9 @@ ContentEventHandler::InitCommon()
NS_ENSURE_TRUE(endNode, NS_ERROR_FAILURE);
// See bug 537041 comment 5, the range could have removed node.
NS_ENSURE_TRUE(startNode->GetCurrentDoc() == mPresShell->GetDocument(),
NS_ENSURE_TRUE(startNode->GetUncomposedDoc() == mPresShell->GetDocument(),
NS_ERROR_NOT_AVAILABLE);
NS_ASSERTION(startNode->GetCurrentDoc() == endNode->GetCurrentDoc(),
NS_ASSERTION(startNode->GetUncomposedDoc() == endNode->GetUncomposedDoc(),
"mFirstSelectedRange crosses the document boundary");
mRootContent = startNode->GetSelectionRootContent(mPresShell);

Просмотреть файл

@ -927,7 +927,7 @@ DataTransfer::GetTransferables(nsIDOMNode* aDragTarget)
return nullptr;
}
nsIDocument* doc = dragNode->GetCurrentDoc();
nsIDocument* doc = dragNode->GetUncomposedDoc();
if (!doc) {
return nullptr;
}

Просмотреть файл

@ -981,14 +981,14 @@ protected:
*/
void AddToNameTable(nsIAtom* aName) {
NS_ASSERTION(HasName(), "Node doesn't have name?");
nsIDocument* doc = GetCurrentDoc();
nsIDocument* doc = GetUncomposedDoc();
if (doc && !IsInAnonymousSubtree()) {
doc->AddToNameTable(this, aName);
}
}
void RemoveFromNameTable() {
if (HasName()) {
nsIDocument* doc = GetCurrentDoc();
nsIDocument* doc = GetUncomposedDoc();
if (doc) {
doc->RemoveFromNameTable(this, GetParsedAttr(nsGkAtoms::name)->
GetAtomValue());
@ -1394,7 +1394,7 @@ protected:
* with the id in @form. Otherwise, it *must* be null.
*
* @note Callers of UpdateFormOwner have to be sure the element is in a
* document (GetCurrentDoc() != nullptr).
* document (GetUncomposedDoc() != nullptr).
*/
void UpdateFormOwner(bool aBindToTree, Element* aFormIdElement);

Просмотреть файл

@ -136,7 +136,7 @@ nsMathMLElement::UnbindFromTree(bool aDeep, bool aNullParent)
// be under a different xml:base, so forget the cached state now.
Link::ResetLinkState(false, Link::ElementHasHref());
nsIDocument* doc = GetCurrentDoc();
nsIDocument* doc = GetUncomposedDoc();
if (doc) {
doc->UnregisterPendingLinkUpdate(this);
}

Просмотреть файл

@ -517,7 +517,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetURL(const char *aURL,
return NS_OK;
}
nsIDocument *doc = content->GetCurrentDoc();
nsIDocument *doc = content->GetUncomposedDoc();
if (!doc) {
return NS_ERROR_FAILURE;
}

Просмотреть файл

@ -30,7 +30,7 @@ GetCSSComputedValue(Element* aElem,
MOZ_ASSERT(nsSMILCSSProperty::IsPropertyAnimatable(aPropID),
"Shouldn't get here for non-animatable properties");
nsIDocument* doc = aElem->GetCurrentDoc();
nsIDocument* doc = aElem->GetUncomposedDoc();
if (!doc) {
// This can happen if we process certain types of restyles mid-sample
// and remove anonymous animated content from the document as a result.

Просмотреть файл

@ -322,7 +322,7 @@ nsSMILCSSValueType::Interpolate(const nsSMILValue& aStartVal,
static nsPresContext*
GetPresContextForElement(Element* aElem)
{
nsIDocument* doc = aElem->GetCurrentDoc();
nsIDocument* doc = aElem->GetUncomposedDoc();
if (!doc) {
// This can happen if we process certain types of restyles mid-sample
// and remove anonymous animated content from the document as a result.
@ -400,7 +400,7 @@ nsSMILCSSValueType::ValueFromString(nsCSSProperty aPropID,
return;
}
nsIDocument* doc = aTargetElement->GetCurrentDoc();
nsIDocument* doc = aTargetElement->GetUncomposedDoc();
if (doc && !nsStyleUtil::CSPAllowsInlineStyle(nullptr,
doc->NodePrincipal(),
doc->GetDocumentURI(),

Просмотреть файл

@ -132,7 +132,7 @@ nsSMILMappedAttribute::FlushChangesToTargetAttr() const
// Clear animated content-style-rule
mElement->DeleteProperty(SMIL_MAPPED_ATTR_ANIMVAL,
SMIL_MAPPED_ATTR_STYLERULE_ATOM);
nsIDocument* doc = mElement->GetCurrentDoc();
nsIDocument* doc = mElement->GetUncomposedDoc();
// Request animation restyle
if (doc) {

Просмотреть файл

@ -113,7 +113,7 @@ nsSMILTimeValueSpec::ResolveReferences(nsIContent* aContextNode)
Element* target = mOwner->GetTargetElement();
mReferencedElement.ResetWithElement(target);
} else if (mParams.mType == nsSMILTimeValueSpecParams::ACCESSKEY) {
nsIDocument* doc = aContextNode->GetCurrentDoc();
nsIDocument* doc = aContextNode->GetUncomposedDoc();
MOZ_ASSERT(doc, "We are in the document but current doc is null");
mReferencedElement.ResetWithElement(doc->GetRootElement());
} else {
@ -350,7 +350,7 @@ nsSMILTimeValueSpec::GetEventListenerManager(Element* aTarget)
nsCOMPtr<EventTarget> target;
if (mParams.mType == nsSMILTimeValueSpecParams::ACCESSKEY) {
nsIDocument* doc = aTarget->GetCurrentDoc();
nsIDocument* doc = aTarget->GetUncomposedDoc();
if (!doc)
return nullptr;
nsPIDOMWindowOuter* win = doc->GetWindow();

Просмотреть файл

@ -100,7 +100,7 @@ namespace
event.mDetail = mDetail;
nsPresContext* context = nullptr;
nsIDocument* doc = mTarget->GetCurrentDoc();
nsIDocument* doc = mTarget->GetUncomposedDoc();
if (doc) {
nsCOMPtr<nsIPresShell> shell = doc->GetShell();
if (shell) {

Просмотреть файл

@ -198,7 +198,7 @@ nsXBLBinding::InstallAnonymousContent(nsIContent* aAnonParent, nsIContent* aElem
// aElement.
// (2) The children's parent back pointer should not be to this synthetic root
// but should instead point to the enclosing parent element.
nsIDocument* doc = aElement->GetCurrentDoc();
nsIDocument* doc = aElement->GetUncomposedDoc();
bool allowScripts = AllowScripts();
nsAutoScriptBlocker scriptBlocker;

Просмотреть файл

@ -233,7 +233,7 @@ nsXBLResourceLoader::NotifyBoundElements()
if (ready) {
// We need the document to flush out frame construction and
// such, so we want to use the current document.
nsIDocument* doc = content->GetCurrentDoc();
nsIDocument* doc = content->GetUncomposedDoc();
if (doc) {
// Flush first to make sure we can get the frame for content

Просмотреть файл

@ -113,7 +113,7 @@ public:
{
// We only need the document here to cause frame construction, so
// we need the current doc, not the owner doc.
nsIDocument* doc = mBoundElement->GetCurrentDoc();
nsIDocument* doc = mBoundElement->GetUncomposedDoc();
if (!doc)
return;
@ -318,7 +318,7 @@ nsXBLStreamListener::HandleEvent(nsIDOMEvent* aEvent)
// ready.
if (count > 0) {
nsXBLBindingRequest* req = mBindingRequests.ElementAt(0);
nsIDocument* document = req->mBoundElement->GetCurrentDoc();
nsIDocument* document = req->mBoundElement->GetUncomposedDoc();
if (document)
document->FlushPendingNotifications(Flush_ContentAndNotify);
}
@ -536,7 +536,7 @@ nsXBLService::AttachGlobalKeyHandler(EventTarget* aTarget)
nsCOMPtr<nsIContent> contentNode(do_QueryInterface(aTarget));
if (contentNode) {
// Only attach if we're really in a document
nsCOMPtr<nsIDocument> doc = contentNode->GetCurrentDoc();
nsCOMPtr<nsIDocument> doc = contentNode->GetUncomposedDoc();
if (doc)
piTarget = doc; // We're a XUL keyset. Attach to our document.
}
@ -582,7 +582,7 @@ nsXBLService::DetachGlobalKeyHandler(EventTarget* aTarget)
return NS_ERROR_FAILURE;
// Only attach if we're really in a document
nsCOMPtr<nsIDocument> doc = contentNode->GetCurrentDoc();
nsCOMPtr<nsIDocument> doc = contentNode->GetUncomposedDoc();
if (doc)
piTarget = do_QueryInterface(doc);

Просмотреть файл

@ -745,7 +745,7 @@ nsXBLWindowKeyHandler::GetElementForHandler(nsXBLPrototypeHandler* aHandler,
}
// XXX Shouldn't we check this earlier?
nsIDocument* doc = keyContent->GetCurrentDoc();
nsIDocument* doc = keyContent->GetUncomposedDoc();
if (NS_WARN_IF(!doc)) {
return false;
}

Просмотреть файл

@ -71,7 +71,7 @@ XMLStylesheetProcessingInstruction::BindToTree(nsIDocument* aDocument,
void
XMLStylesheetProcessingInstruction::UnbindFromTree(bool aDeep, bool aNullParent)
{
nsCOMPtr<nsIDocument> oldDoc = GetCurrentDoc();
nsCOMPtr<nsIDocument> oldDoc = GetUncomposedDoc();
ProcessingInstruction::UnbindFromTree(aDeep, aNullParent);
UpdateStyleSheetInternal(oldDoc, nullptr);

Просмотреть файл

@ -48,7 +48,7 @@ txXPathTreeWalker::moveToRoot()
return;
}
nsIDocument* root = mPosition.mNode->GetCurrentDoc();
nsIDocument* root = mPosition.mNode->GetUncomposedDoc();
if (root) {
mPosition.mIndex = txXPathNode::eDocument;
mPosition.mNode = root;
@ -74,7 +74,7 @@ txXPathTreeWalker::moveToElementById(const nsAString& aID)
return false;
}
nsIDocument* doc = mPosition.mNode->GetCurrentDoc();
nsIDocument* doc = mPosition.mNode->GetUncomposedDoc();
nsCOMPtr<nsIContent> content;
if (doc) {
@ -591,8 +591,8 @@ txXPathNodeUtils::comparePosition(const txXPathNode& aNode,
}
// Get document for both nodes.
nsIDocument* document = aNode.mNode->GetCurrentDoc();
nsIDocument* otherDocument = aOtherNode.mNode->GetCurrentDoc();
nsIDocument* document = aNode.mNode->GetUncomposedDoc();
nsIDocument* otherDocument = aOtherNode.mNode->GetUncomposedDoc();
// If the nodes have different current documents, compare the document
// pointers.

Просмотреть файл

@ -702,7 +702,7 @@ nsEditorSpellCheck::UpdateCurrentDictionary(nsIEditorSpellCheckCallback* aCallba
RefPtr<DictionaryFetcher> fetcher =
new DictionaryFetcher(this, aCallback, mDictionaryFetcherGroup);
rootContent->GetLang(fetcher->mRootContentLang);
nsCOMPtr<nsIDocument> doc = rootContent->GetCurrentDoc();
nsCOMPtr<nsIDocument> doc = rootContent->GetUncomposedDoc();
NS_ENSURE_STATE(doc);
doc->GetContentLanguage(fetcher->mRootDocContentLang);

Просмотреть файл

@ -183,7 +183,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsEditor)
nsIDocument* currentDoc =
tmp->mRootElement ? tmp->mRootElement->GetCurrentDoc() : nullptr;
tmp->mRootElement ? tmp->mRootElement->GetUncomposedDoc() : nullptr;
if (currentDoc &&
nsCCUncollectableMarker::InGeneration(cb, currentDoc->GetMarkedCCGeneration())) {
return NS_SUCCESS_INTERRUPTED_TRAVERSE;
@ -424,7 +424,7 @@ nsEditor::GetDesiredSpellCheckState()
// Some of the page content might be editable and some not, if spellcheck=
// is explicitly set anywhere, so if there's anything editable on the page,
// return true and let the spellchecker figure it out.
nsCOMPtr<nsIHTMLDocument> doc = do_QueryInterface(content->GetCurrentDoc());
nsCOMPtr<nsIHTMLDocument> doc = do_QueryInterface(content->GetUncomposedDoc());
return doc && doc->IsEditingOn();
}

Просмотреть файл

@ -250,7 +250,7 @@ nsHTMLEditor::DeleteRefToAnonymousNode(nsIDOMElement* aElement,
// XXX This is wrong (bug 439258). Once it's fixed, the NS_WARNING
// in RestyleManager::RestyleForRemove should be changed back
// to an assertion.
docObserver->ContentRemoved(content->GetCurrentDoc(),
docObserver->ContentRemoved(content->GetUncomposedDoc(),
aParentContent, content, -1,
content->GetPreviousSibling());
if (document)

Просмотреть файл

@ -534,7 +534,7 @@ nsHTMLCSSUtils::GetComputedStyle(dom::Element* aElement)
{
MOZ_ASSERT(aElement);
nsIDocument* doc = aElement->GetCurrentDoc();
nsIDocument* doc = aElement->GetUncomposedDoc();
NS_ENSURE_TRUE(doc, nullptr);
nsIPresShell* presShell = doc->GetShell();

Просмотреть файл

@ -400,7 +400,7 @@ nsHTMLEditor::FindSelectionRoot(nsINode *aNode)
aNode->IsNodeOfType(nsINode::eCONTENT),
"aNode must be content or document node");
nsCOMPtr<nsIDocument> doc = aNode->GetCurrentDoc();
nsCOMPtr<nsIDocument> doc = aNode->GetUncomposedDoc();
if (!doc) {
return nullptr;
}
@ -5199,7 +5199,7 @@ nsHTMLEditor::IsAcceptableInputEvent(nsIDOMEvent* aEvent)
// Otherwise, check whether the event target is in this document or not.
nsCOMPtr<nsIContent> targetContent = do_QueryInterface(target);
NS_ENSURE_TRUE(targetContent, false);
return document == targetContent->GetCurrentDoc();
return document == targetContent->GetUncomposedDoc();
}
// This HTML editor is for contenteditable. We need to check the validity of

Просмотреть файл

@ -55,7 +55,7 @@ EvictTouchPoint(RefPtr<dom::Touch>& aTouch,
{
nsCOMPtr<nsINode> node(do_QueryInterface(aTouch->mTarget));
if (node) {
nsIDocument* doc = node->GetCurrentDoc();
nsIDocument* doc = node->GetUncomposedDoc();
if (doc && (!aLimitToDocument || aLimitToDocument == doc)) {
nsIPresShell* presShell = doc->GetShell();
if (presShell) {

Просмотреть файл

@ -2711,8 +2711,8 @@ nsCSSFrameConstructor::SetUpDocElementContainingBlock(nsIContent* aDocElement)
{
NS_PRECONDITION(aDocElement, "No element?");
NS_PRECONDITION(!aDocElement->GetParent(), "Not root content?");
NS_PRECONDITION(aDocElement->GetCurrentDoc(), "Not in a document?");
NS_PRECONDITION(aDocElement->GetCurrentDoc()->GetRootElement() ==
NS_PRECONDITION(aDocElement->GetUncomposedDoc(), "Not in a document?");
NS_PRECONDITION(aDocElement->GetUncomposedDoc()->GetRootElement() ==
aDocElement, "Not the root of the document?");
/*

Просмотреть файл

@ -1487,7 +1487,7 @@ nsCSSRendering::PaintBoxShadowInner(nsPresContext* aPresContext,
if (!shadows)
return;
if (aForFrame->IsThemed() && aForFrame->GetContent() &&
!nsContentUtils::IsChromeDoc(aForFrame->GetContent()->GetCurrentDoc())) {
!nsContentUtils::IsChromeDoc(aForFrame->GetContent()->GetUncomposedDoc())) {
// There's no way of getting hold of a shape corresponding to a
// "padding-box" for native-themed widgets, so just don't draw
// inner box-shadows for them. But we allow chrome to paint inner
@ -4788,7 +4788,7 @@ nsImageRenderer::PrepareImage()
nsCOMPtr<nsIURI> targetURI;
nsCOMPtr<nsIURI> base = mForFrame->GetContent()->GetBaseURI();
nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(targetURI), elementId,
mForFrame->GetContent()->GetCurrentDoc(), base);
mForFrame->GetContent()->GetUncomposedDoc(), base);
nsSVGPaintingProperty* property = nsSVGEffects::GetPaintingPropertyForURI(
targetURI, mForFrame->FirstContinuation(),
nsSVGEffects::BackgroundImageProperty());

Просмотреть файл

@ -551,7 +551,7 @@ nsFrameManager::CaptureFrameStateFor(nsIFrame* aFrame,
// Exit early if we get empty key
nsAutoCString stateKey;
nsIContent* content = aFrame->GetContent();
nsIDocument* doc = content ? content->GetCurrentDoc() : nullptr;
nsIDocument* doc = content ? content->GetUncomposedDoc() : nullptr;
rv = statefulFrame->GenerateStateKey(content, doc, stateKey);
if(NS_FAILED(rv) || stateKey.IsEmpty()) {
return;
@ -614,7 +614,7 @@ nsFrameManager::RestoreFrameStateFor(nsIFrame* aFrame,
}
nsAutoCString stateKey;
nsIDocument* doc = content->GetCurrentDoc();
nsIDocument* doc = content->GetUncomposedDoc();
nsresult rv = statefulFrame->GenerateStateKey(content, doc, stateKey);
if (NS_FAILED(rv) || stateKey.IsEmpty()) {
return;

Просмотреть файл

@ -4752,8 +4752,8 @@ PresShell::ClipListToRange(nsDisplayListBuilder *aBuilder,
// Don't try to descend into subdocuments.
// If this ever changes we'd need to add handling for subdocuments with
// different zoom levels.
else if (content->GetCurrentDoc() ==
aRange->GetStartParent()->GetCurrentDoc()) {
else if (content->GetUncomposedDoc() ==
aRange->GetStartParent()->GetUncomposedDoc()) {
// if the node is within the range, append it to the temporary list
bool before, after;
nsresult rv =

Просмотреть файл

@ -3690,7 +3690,7 @@ NS_IMETHODIMP nsFrame::HandleRelease(nsPresContext* aPresContext,
// Also check the selection of the capturing content which might be in a
// different document.
if (!frameSelection && captureContent) {
nsIDocument* doc = captureContent->GetCurrentDoc();
nsIDocument* doc = captureContent->GetUncomposedDoc();
if (doc) {
nsIPresShell* capturingShell = doc->GetShell();
if (capturingShell && capturingShell != PresContext()->GetPresShell()) {

Просмотреть файл

@ -818,7 +818,7 @@ static nsIContent*
GetBrowserRoot(nsIContent* aContent)
{
if (aContent) {
nsIDocument* doc = aContent->GetCurrentDoc();
nsIDocument* doc = aContent->GetUncomposedDoc();
if (nsPIDOMWindowOuter* win = doc->GetWindow()) {
nsCOMPtr<Element> frameElement = win->GetFrameElementInternal();
if (frameElement &&
@ -4505,7 +4505,7 @@ ScrollFrameHelper::FireScrollEvent()
// will bubble to the window)
mozilla::layers::ScrollLinkedEffectDetector detector(content->GetComposedDoc());
if (mIsRoot) {
nsIDocument* doc = content->GetCurrentDoc();
nsIDocument* doc = content->GetUncomposedDoc();
if (doc) {
EventDispatcher::Dispatch(doc, prescontext, &event, nullptr, &status);
}
@ -5716,7 +5716,7 @@ ScrollFrameHelper::FireScrolledAreaEvent()
event.mArea = mScrolledFrame->GetScrollableOverflowRectRelativeToParent();
nsIDocument *doc = content->GetCurrentDoc();
nsIDocument *doc = content->GetUncomposedDoc();
if (doc) {
EventDispatcher::Dispatch(doc, prescontext, &event, nullptr);
}

Просмотреть файл

@ -18,7 +18,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=666225
<pre id="test">
<script type="application/javascript">
/** Test for Bug 666225
Causes ASSERTION: Unexpected document: 'capturingContent->GetCurrentDoc() == GetDocument()' (bug 560764) **/
Causes ASSERTION: Unexpected document: 'capturingContent->GetUncomposedDoc() == GetDocument()' (bug 560764) **/
function click()
{

Просмотреть файл

@ -173,7 +173,7 @@ nsPrintPreviewListener::HandleEvent(nsIDOMEvent* aEvent)
if (eventString.EqualsLiteral("keydown")) {
// Handle tabbing explicitly here since we don't want focus ending up
// inside the content document, bug 244128.
nsIDocument* doc = content->GetCurrentDoc();
nsIDocument* doc = content->GetUncomposedDoc();
NS_ASSERTION(doc, "no document");
nsIDocument* parentDoc = doc->GetParentDocument();

Просмотреть файл

@ -3980,7 +3980,7 @@ TreeMatchContext::InitAncestors(Element *aElement)
mAncestorFilter.mFilter = new AncestorFilter::Filter();
if (MOZ_LIKELY(aElement)) {
MOZ_ASSERT(aElement->GetCurrentDoc() ||
MOZ_ASSERT(aElement->GetUncomposedDoc() ||
aElement->HasFlag(NODE_IS_IN_SHADOW_TREE),
"aElement must be in the document or in shadow tree "
"for the assumption that GetParentNode() is non-null "

Просмотреть файл

@ -80,7 +80,7 @@ nsDOMCSSAttributeDeclaration::SetCSSDeclaration(css::Declaration* aDecl)
nsIDocument*
nsDOMCSSAttributeDeclaration::DocToUpdate()
{
// We need OwnerDoc() rather than GetCurrentDoc() because it might
// We need OwnerDoc() rather than GetUncomposedDoc() because it might
// be the BeginUpdate call that inserts mElement into the document.
return mElement->OwnerDoc();
}

Просмотреть файл

@ -1018,7 +1018,7 @@ nsStyleSet::GetContext(nsStyleContext* aParentContext,
aElementForAnimation->IsHTMLElement(nsGkAtoms::body) &&
aPseudoType == CSSPseudoElementType::NotPseudo &&
PresContext()->CompatibilityMode() == eCompatibility_NavQuirks) {
nsIDocument* doc = aElementForAnimation->GetCurrentDoc();
nsIDocument* doc = aElementForAnimation->GetUncomposedDoc();
if (doc && doc->GetBodyElement() == aElementForAnimation) {
// Update the prescontext's body color
PresContext()->SetBodyTextColor(result->StyleColor()->mColor);

Просмотреть файл

@ -4909,7 +4909,7 @@ SVGTextFrame::GetTextPathPathElement(nsIFrame* aTextPathFrame)
nsCOMPtr<nsIURI> targetURI;
nsCOMPtr<nsIURI> base = content->GetBaseURI();
nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(targetURI), href,
content->GetCurrentDoc(), base);
content->GetUncomposedDoc(), base);
property = nsSVGEffects::GetTextPathProperty(targetURI, aTextPathFrame,
nsSVGEffects::HrefProperty());

Просмотреть файл

@ -123,7 +123,7 @@ nsSVGFilterFrame::GetReferencedFilter()
nsCOMPtr<nsIURI> targetURI;
nsCOMPtr<nsIURI> base = mContent->GetBaseURI();
nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(targetURI), href,
mContent->GetCurrentDoc(), base);
mContent->GetUncomposedDoc(), base);
property =
nsSVGEffects::GetPaintingProperty(targetURI, this, nsSVGEffects::HrefProperty());

Просмотреть файл

@ -331,7 +331,7 @@ nsSVGGradientFrame::GetReferencedGradient()
nsCOMPtr<nsIURI> targetURI;
nsCOMPtr<nsIURI> base = mContent->GetBaseURI();
nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(targetURI), href,
mContent->GetCurrentDoc(), base);
mContent->GetUncomposedDoc(), base);
property =
nsSVGEffects::GetPaintingProperty(targetURI, this, nsSVGEffects::HrefProperty());

Просмотреть файл

@ -114,7 +114,7 @@ nsSVGOuterSVGFrame::Init(nsIContent* aContent,
nsSVGOuterSVGFrameBase::Init(aContent, aParent, aPrevInFlow);
nsIDocument* doc = mContent->GetCurrentDoc();
nsIDocument* doc = mContent->GetUncomposedDoc();
if (doc) {
// we only care about our content's zoom and pan values if it's the root element
if (doc->GetRootElement() == mContent) {
@ -917,7 +917,7 @@ nsSVGOuterSVGFrame::IsRootOfImage()
{
if (!mContent->GetParent()) {
// Our content is the document element
nsIDocument* doc = mContent->GetCurrentDoc();
nsIDocument* doc = mContent->GetUncomposedDoc();
if (doc && doc->IsBeingUsedAsImage()) {
// Our document is being used as an image
return true;

Просмотреть файл

@ -562,7 +562,7 @@ nsSVGPatternFrame::GetReferencedPattern()
nsCOMPtr<nsIURI> targetURI;
nsCOMPtr<nsIURI> base = mContent->GetBaseURI();
nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(targetURI), href,
mContent->GetCurrentDoc(), base);
mContent->GetUncomposedDoc(), base);
property =
nsSVGEffects::GetPaintingProperty(targetURI, this, nsSVGEffects::HrefProperty());

Просмотреть файл

@ -135,7 +135,7 @@ BoxObject::GetPresShell(bool aFlushLayout)
return nullptr;
}
nsCOMPtr<nsIDocument> doc = mContent->GetCurrentDoc();
nsCOMPtr<nsIDocument> doc = mContent->GetUncomposedDoc();
if (!doc) {
return nullptr;
}

Просмотреть файл

@ -782,8 +782,8 @@ nsImageBoxListener::Notify(imgIRequest *request, int32_t aType, const nsIntRect*
NS_IMETHODIMP
nsImageBoxListener::BlockOnload(imgIRequest *aRequest)
{
if (mFrame && mFrame->GetContent() && mFrame->GetContent()->GetCurrentDoc()) {
mFrame->GetContent()->GetCurrentDoc()->BlockOnload();
if (mFrame && mFrame->GetContent() && mFrame->GetContent()->GetUncomposedDoc()) {
mFrame->GetContent()->GetUncomposedDoc()->BlockOnload();
}
return NS_OK;
@ -792,8 +792,8 @@ nsImageBoxListener::BlockOnload(imgIRequest *aRequest)
NS_IMETHODIMP
nsImageBoxListener::UnblockOnload(imgIRequest *aRequest)
{
if (mFrame && mFrame->GetContent() && mFrame->GetContent()->GetCurrentDoc()) {
mFrame->GetContent()->GetCurrentDoc()->UnblockOnload(false);
if (mFrame && mFrame->GetContent() && mFrame->GetContent()->GetUncomposedDoc()) {
mFrame->GetContent()->GetUncomposedDoc()->UnblockOnload(false);
}
return NS_OK;

Просмотреть файл

@ -889,7 +889,7 @@ nsMenuPopupFrame::HidePopup(bool aDeselectMenu, nsPopupState aNewState)
// if the popup had a trigger node set, clear the global window popup node
// as well
if (mTriggerContent) {
nsIDocument* doc = mContent->GetCurrentDoc();
nsIDocument* doc = mContent->GetUncomposedDoc();
if (doc) {
if (nsPIDOMWindowOuter* win = doc->GetWindow()) {
nsCOMPtr<nsPIWindowRoot> root = win->GetTopWindowRoot();

Просмотреть файл

@ -427,7 +427,7 @@ nsXULPopupManager::AdjustPopupsOnWindowChange(nsPIDOMWindowOuter* aWindow)
if (frame->GetAutoPosition()) {
nsIContent* popup = frame->GetContent();
if (popup) {
nsIDocument* document = popup->GetCurrentDoc();
nsIDocument* document = popup->GetUncomposedDoc();
if (document) {
if (nsPIDOMWindowOuter* window = document->GetWindow()) {
window = window->GetPrivateRoot();
@ -543,7 +543,7 @@ nsMenuPopupFrame*
nsXULPopupManager::GetPopupFrameForContent(nsIContent* aContent, bool aShouldFlush)
{
if (aShouldFlush) {
nsIDocument *document = aContent->GetCurrentDoc();
nsIDocument *document = aContent->GetUncomposedDoc();
if (document) {
nsCOMPtr<nsIPresShell> presShell = document->GetShell();
if (presShell)
@ -603,7 +603,7 @@ nsXULPopupManager::InitTriggerEvent(nsIDOMEvent* aEvent, nsIContent* aPopup,
if (inputEvent) {
mCachedModifiers = inputEvent->mModifiers;
}
nsIDocument* doc = aPopup->GetCurrentDoc();
nsIDocument* doc = aPopup->GetUncomposedDoc();
if (doc) {
nsIPresShell* presShell = doc->GetShell();
nsPresContext* presContext;
@ -1439,7 +1439,7 @@ nsXULPopupManager::FirePopupShowingEvent(nsIContent* aPopup,
nsGkAtoms::_true, eCaseMatters)) {
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
if (fm) {
nsIDocument* doc = popup->GetCurrentDoc();
nsIDocument* doc = popup->GetUncomposedDoc();
// Only remove the focus if the currently focused item is ouside the
// popup. It isn't a big deal if the current focus is in a child popup
@ -1497,7 +1497,7 @@ nsXULPopupManager::FirePopupHidingEvent(nsIContent* aPopup,
nsGkAtoms::_true, eCaseMatters)) {
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
if (fm) {
nsIDocument* doc = aPopup->GetCurrentDoc();
nsIDocument* doc = aPopup->GetUncomposedDoc();
// Remove the focus from the focused node only if it is inside the popup.
nsCOMPtr<nsIDOMElement> currentFocusElement;
@ -1665,7 +1665,7 @@ nsXULPopupManager::GetLastTriggerNode(nsIDocument* aDocument, bool aIsTooltip)
// if mOpeningPopup is set, it means that a popupshowing event is being
// fired. In this case, just use the cached node, as the popup is not yet in
// the list of open popups.
if (mOpeningPopup && mOpeningPopup->GetCurrentDoc() == aDocument &&
if (mOpeningPopup && mOpeningPopup->GetUncomposedDoc() == aDocument &&
aIsTooltip == mOpeningPopup->IsXULElement(nsGkAtoms::tooltip)) {
node = do_QueryInterface(nsMenuPopupFrame::GetTriggerContent(GetPopupFrameForContent(mOpeningPopup, false)));
}
@ -1674,7 +1674,7 @@ nsXULPopupManager::GetLastTriggerNode(nsIDocument* aDocument, bool aIsTooltip)
while (item) {
// look for a popup of the same type and document.
if ((item->PopupType() == ePopupTypeTooltip) == aIsTooltip &&
item->Content()->GetCurrentDoc() == aDocument) {
item->Content()->GetUncomposedDoc() == aDocument) {
node = do_QueryInterface(nsMenuPopupFrame::GetTriggerContent(item->Frame()));
if (node)
break;
@ -1923,7 +1923,7 @@ nsXULPopupManager::UpdateMenuItems(nsIContent* aPopup)
// Walk all of the menu's children, checking to see if any of them has a
// command attribute. If so, then several attributes must potentially be updated.
nsCOMPtr<nsIDocument> document = aPopup->GetCurrentDoc();
nsCOMPtr<nsIDocument> document = aPopup->GetUncomposedDoc();
if (!document) {
return;
}
@ -2661,7 +2661,7 @@ nsXULPopupHidingEvent::Run()
{
nsXULPopupManager* pm = nsXULPopupManager::GetInstance();
nsIDocument *document = mPopup->GetCurrentDoc();
nsIDocument *document = mPopup->GetUncomposedDoc();
if (pm && document) {
nsIPresShell* presShell = document->GetShell();
if (presShell) {

Просмотреть файл

@ -106,7 +106,7 @@ nsXULTooltipListener::MouseOut(nsIDOMEvent* aEvent)
nsXULPopupManager* pm = nsXULPopupManager::GetInstance();
if (pm) {
nsCOMPtr<nsIDOMNode> tooltipNode =
pm->GetLastTriggerTooltipNode(currentTooltip->GetCurrentDoc());
pm->GetLastTriggerTooltipNode(currentTooltip->GetUncomposedDoc());
if (tooltipNode == targetNode) {
// if the target node is the current tooltip target node, the mouse
// left the node the tooltip appeared on, so close the tooltip.

Просмотреть файл

@ -69,7 +69,7 @@ nsresult nsMenuItemX::Create(nsMenuX* aParent, const nsString& aLabel, EMenuItem
mMenuGroupOwner->RegisterForContentChanges(mContent, this);
nsIDocument *doc = mContent->GetCurrentDoc();
nsIDocument *doc = mContent->GetUncomposedDoc();
// if we have a command associated with this menu item, register for changes
// to the command DOM node
@ -235,8 +235,8 @@ void nsMenuItemX::SetKeyEquiv()
// Set key shortcut and modifiers
nsAutoString keyValue;
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::key, keyValue);
if (!keyValue.IsEmpty() && mContent->GetCurrentDoc()) {
nsIContent *keyContent = mContent->GetCurrentDoc()->GetElementById(keyValue);
if (!keyValue.IsEmpty() && mContent->GetUncomposedDoc()) {
nsIContent *keyContent = mContent->GetUncomposedDoc()->GetElementById(keyValue);
if (keyContent) {
nsAutoString keyChar;
bool hasKey = keyContent->GetAttr(kNameSpaceID_None, nsGkAtoms::key, keyChar);

Просмотреть файл

@ -472,7 +472,7 @@ GetPresShellForContent(nsIDOMNode* aDOMNode)
if (!content)
return nullptr;
nsCOMPtr<nsIDocument> document = content->GetCurrentDoc();
nsCOMPtr<nsIDocument> document = content->GetUncomposedDoc();
if (document) {
document->FlushPendingNotifications(Flush_Display);