Bug 1263787 - Kill off the deprecated nsINode::GetCrossShadowCurrentDoc. r=baku

This commit is contained in:
Jonathan Watt 2016-03-31 13:20:14 +01:00
Родитель 9480920b04
Коммит de4c3d11fe
11 изменённых файлов: 30 добавлений и 38 удалений

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

@ -1034,7 +1034,7 @@ nsAccessibilityService::CreateAccessible(nsINode* aNode,
}
// We have a content node.
if (!aNode->GetCrossShadowCurrentDoc()) {
if (!aNode->GetComposedDoc()) {
NS_WARNING("Creating accessible for node with no document");
return nullptr;
}

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

@ -1197,7 +1197,7 @@ DocAccessible::GetAccessibleByUniqueIDInSubtree(void* aUniqueID)
Accessible*
DocAccessible::GetAccessibleOrContainer(nsINode* aNode) const
{
if (!aNode || !aNode->GetCrossShadowCurrentDoc())
if (!aNode || !aNode->GetComposedDoc())
return nullptr;
nsINode* currNode = aNode;

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

@ -201,7 +201,7 @@ Element::IntrinsicState() const
void
Element::NotifyStateChange(EventStates aStates)
{
nsIDocument* doc = GetCrossShadowCurrentDoc();
nsIDocument* doc = GetComposedDoc();
if (doc) {
nsAutoScriptBlocker scriptBlocker;
doc->ContentStateChanged(this, aStates);
@ -227,7 +227,7 @@ Element::UpdateState(bool aNotify)
if (aNotify) {
EventStates changedStates = oldState ^ mState;
if (!changedStates.IsEmpty()) {
nsIDocument* doc = GetCrossShadowCurrentDoc();
nsIDocument* doc = GetComposedDoc();
if (doc) {
nsAutoScriptBlocker scriptBlocker;
doc->ContentStateChanged(this, changedStates);
@ -1014,7 +1014,7 @@ Element::CreateShadowRoot(ErrorResult& aError)
return nullptr;
}
nsIDocument* doc = GetCrossShadowCurrentDoc();
nsIDocument* doc = GetComposedDoc();
nsIContent* destroyedFramesFor = nullptr;
if (doc) {
nsIPresShell* shell = doc->GetShell();
@ -1065,7 +1065,7 @@ Element::CreateShadowRoot(ErrorResult& aError)
// Recreate the frame for the bound content because binding a ShadowRoot
// changes how things are rendered.
if (doc) {
MOZ_ASSERT(doc == GetCrossShadowCurrentDoc());
MOZ_ASSERT(doc == GetComposedDoc());
nsIPresShell* shell = doc->GetShell();
if (shell) {
shell->CreateFramesFor(destroyedFramesFor);

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

@ -317,7 +317,7 @@ nsINode::GetSelectionRootContent(nsIPresShell* aPresShell)
if (!IsNodeOfType(eCONTENT))
return nullptr;
if (GetCrossShadowCurrentDoc() != aPresShell->GetDocument()) {
if (GetComposedDoc() != aPresShell->GetDocument()) {
return nullptr;
}
@ -333,7 +333,7 @@ nsINode::GetSelectionRootContent(nsIPresShell* aPresShell)
nsIEditor* editor = nsContentUtils::GetHTMLEditor(presContext);
if (editor) {
// This node is in HTML editor.
nsIDocument* doc = GetCrossShadowCurrentDoc();
nsIDocument* doc = GetComposedDoc();
if (!doc || doc->HasFlag(NODE_IS_EDITABLE) ||
!HasFlag(NODE_IS_EDITABLE)) {
nsIContent* editorRoot = GetEditorRootContent(editor);
@ -1568,7 +1568,7 @@ nsINode::doInsertChildAt(nsIContent* aKid, uint32_t aIndex,
// Do this before checking the child-count since this could cause mutations
nsIDocument* doc = GetUncomposedDoc();
mozAutoDocUpdate updateBatch(GetCrossShadowCurrentDoc(), UPDATE_CONTENT_MODEL, aNotify);
mozAutoDocUpdate updateBatch(GetComposedDoc(), UPDATE_CONTENT_MODEL, aNotify);
if (OwnerDoc() != aKid->OwnerDoc()) {
rv = AdoptNodeIntoOwnerDoc(this, aKid);
@ -1708,7 +1708,7 @@ nsINode::doRemoveChildAt(uint32_t aIndex, bool aNotify,
IndexOf(aKid) == (int32_t)aIndex, "Bogus aKid");
nsMutationGuard::DidMutate();
mozAutoDocUpdate updateBatch(GetCrossShadowCurrentDoc(), UPDATE_CONTENT_MODEL, aNotify);
mozAutoDocUpdate updateBatch(GetComposedDoc(), UPDATE_CONTENT_MODEL, aNotify);
nsIContent* previousSibling = aKid->GetPreviousSibling();
@ -2177,7 +2177,7 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
}
}
mozAutoDocUpdate batch(GetCrossShadowCurrentDoc(), UPDATE_CONTENT_MODEL, true);
mozAutoDocUpdate batch(GetComposedDoc(), UPDATE_CONTENT_MODEL, true);
nsAutoMutationBatch mb;
// Figure out which index we want to insert at. Note that we use

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

@ -532,14 +532,6 @@ public:
GetComposedDocInternal() : GetUncomposedDoc();
}
/**
* @deprecated
*/
nsIDocument* GetCrossShadowCurrentDoc() const
{
return GetComposedDoc();
}
/**
* Returns true if GetComposedDoc() would return a non-null value.
*/

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

@ -117,7 +117,7 @@ nsScriptElement::MaybeProcessScript()
"You forgot to add self as observer");
if (mAlreadyStarted || !mDoneAddingChildren ||
!cont->GetCrossShadowCurrentDoc() || mMalformed || !HasScriptContent()) {
!cont->GetComposedDoc() || mMalformed || !HasScriptContent()) {
return false;
}

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

@ -1544,7 +1544,7 @@ EventStateManager::FireContextClick()
}
}
nsIDocument* doc = mGestureDownContent->GetCrossShadowCurrentDoc();
nsIDocument* doc = mGestureDownContent->GetComposedDoc();
AutoHandlingUserInputStatePusher userInpStatePusher(true, &event, doc);
// dispatch to DOM
@ -2975,7 +2975,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
// NOTE: The newFocus isn't editable that also means it's not in
// designMode. In designMode, all contents are not focusable.
if (newFocus && !newFocus->IsEditable()) {
nsIDocument *doc = newFocus->GetCrossShadowCurrentDoc();
nsIDocument *doc = newFocus->GetComposedDoc();
if (doc && newFocus == doc->GetRootElement()) {
nsIContent *bodyContent =
nsLayoutUtils::GetEditableRootContentByContentEditable(doc);
@ -4933,7 +4933,7 @@ EventStateManager::SetContentState(nsIContent* aContent, EventStates aState)
newHover = aContent;
} else {
NS_ASSERTION(!aContent ||
aContent->GetCrossShadowCurrentDoc() ==
aContent->GetComposedDoc() ==
mPresContext->PresShell()->GetDocument(),
"Unexpected document");
nsIFrame *frame = aContent ? aContent->GetPrimaryFrame() : nullptr;

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

@ -62,7 +62,7 @@ HTMLScriptElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
aCompileEventHandlers);
NS_ENSURE_SUCCESS(rv, rv);
if (GetCrossShadowCurrentDoc()) {
if (GetComposedDoc()) {
MaybeProcessScript();
}

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

@ -72,7 +72,7 @@ RestyleTracker::ProcessOneRestyle(Element* aElement,
NS_PRECONDITION((aRestyleHint & eRestyle_LaterSiblings) == 0,
"Someone should have handled this before calling us");
NS_PRECONDITION(Document(), "Must have a document");
NS_PRECONDITION(aElement->GetCrossShadowCurrentDoc() == Document(),
NS_PRECONDITION(aElement->GetComposedDoc() == Document(),
"Element has unexpected document");
LOG_RESTYLE("aRestyleHint = %s, aChangeHint = %s",
@ -172,7 +172,7 @@ RestyleTracker::DoProcessRestyles()
// haven't, for example, already been restyled).
// It's important to not mess with the flags on entries not in our
// document.
if (element->GetCrossShadowCurrentDoc() == Document() &&
if (element->GetComposedDoc() == Document() &&
element->HasFlag(RestyleBit()) &&
(iter.Data()->mRestyleHint & eRestyle_LaterSiblings)) {
laterSiblingArr.AppendElement(element);
@ -234,7 +234,7 @@ RestyleTracker::DoProcessRestyles()
// Do the document check before calling GetRestyleData, since we
// don't want to do the sibling-processing GetRestyleData does if
// the node is no longer relevant.
if (element->GetCrossShadowCurrentDoc() != Document()) {
if (element->GetComposedDoc() != Document()) {
// Content node has been removed from our document; nothing else
// to do here
LOG_RESTYLE("skipping, no longer in the document");
@ -296,7 +296,7 @@ RestyleTracker::DoProcessRestyles()
// haven't, for example, already been restyled).
// It's important to not mess with the flags on entries not in our
// document.
if (element->GetCrossShadowCurrentDoc() != Document() ||
if (element->GetComposedDoc() != Document() ||
!element->HasFlag(RestyleBit())) {
LOG_RESTYLE("skipping pending restyle %s, already restyled or no "
"longer in the document",
@ -310,7 +310,7 @@ RestyleTracker::DoProcessRestyles()
(element->GetFlattenedTreeParent() &&
(!element->GetFlattenedTreeParent()->GetPrimaryFrame() ||
element->GetFlattenedTreeParent()->GetPrimaryFrame()->IsLeaf() ||
element->GetCrossShadowCurrentDoc()->GetShell()->FrameManager()
element->GetComposedDoc()->GetShell()->FrameManager()
->GetDisplayContentsStyleFor(element))) ||
// Or not reachable due to an async reinsert we have
// pending? If so, we'll have a reframe hint around.
@ -397,7 +397,7 @@ RestyleTracker::DoProcessRestyles()
bool
RestyleTracker::GetRestyleData(Element* aElement, nsAutoPtr<RestyleData>& aData)
{
NS_PRECONDITION(aElement->GetCrossShadowCurrentDoc() == Document(),
NS_PRECONDITION(aElement->GetComposedDoc() == Document(),
"Unexpected document; this will lead to incorrect behavior!");
if (!aElement->HasFlag(RestyleBit())) {

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

@ -9477,7 +9477,7 @@ nsCSSFrameConstructor::RecreateFramesForContent(nsIContent* aContent,
// anyway).
// Rebuilding the frame tree can have bad effects, especially if it's the
// frame tree for chrome (see bug 157322).
NS_ENSURE_TRUE(aContent->GetCrossShadowCurrentDoc(), NS_ERROR_FAILURE);
NS_ENSURE_TRUE(aContent->GetComposedDoc(), NS_ERROR_FAILURE);
// Is the frame ib-split? If so, we need to reframe the containing
// block *here*, rather than trying to remove and re-insert the

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

@ -4809,7 +4809,7 @@ PresShell::CreateRangePaintInfo(nsIDOMRange* aRange,
// range.
nsINode* startParent = range->GetStartParent();
nsINode* endParent = range->GetEndParent();
nsIDocument* doc = startParent->GetCrossShadowCurrentDoc();
nsIDocument* doc = startParent->GetComposedDoc();
if (startParent == doc || endParent == doc) {
ancestorFrame = rootFrame;
}
@ -6574,7 +6574,7 @@ nsIContent*
PresShell::GetCurrentEventContent()
{
if (mCurrentEventContent &&
mCurrentEventContent->GetCrossShadowCurrentDoc() != mDocument) {
mCurrentEventContent->GetComposedDoc() != mDocument) {
mCurrentEventContent = nullptr;
mCurrentEventFrame = nullptr;
}
@ -6615,7 +6615,7 @@ PresShell::GetEventTargetContent(WidgetEvent* aEvent)
nsIFrame* currentEventFrame = GetCurrentEventFrame();
if (currentEventFrame) {
currentEventFrame->GetContentForEvent(aEvent, getter_AddRefs(content));
NS_ASSERTION(!content || content->GetCrossShadowCurrentDoc() == mDocument,
NS_ASSERTION(!content || content->GetComposedDoc() == mDocument,
"handing out content from a different doc");
}
}
@ -6647,7 +6647,7 @@ PresShell::PopCurrentEventInfo()
// Don't use it if it has moved to a different document.
if (mCurrentEventContent &&
mCurrentEventContent->GetCrossShadowCurrentDoc() != mDocument) {
mCurrentEventContent->GetComposedDoc() != mDocument) {
mCurrentEventContent = nullptr;
mCurrentEventFrame = nullptr;
}
@ -7380,7 +7380,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
} else if (capturingContent) {
// if the mouse is being captured then retarget the mouse event at the
// document that is being captured.
retargetEventDoc = capturingContent->GetCrossShadowCurrentDoc();
retargetEventDoc = capturingContent->GetComposedDoc();
#ifdef ANDROID
} else if ((aEvent->mClass == eTouchEventClass) ||
(aEvent->mClass == eMouseEventClass) ||
@ -7494,7 +7494,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
if (!captureRetarget) {
// A check was already done above to ensure that capturingContent is
// in this presshell.
NS_ASSERTION(capturingContent->GetCrossShadowCurrentDoc() == GetDocument(),
NS_ASSERTION(capturingContent->GetComposedDoc() == GetDocument(),
"Unexpected document");
nsIFrame* captureFrame = capturingContent->GetPrimaryFrame();
if (captureFrame) {
@ -7651,7 +7651,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
capturingContent))) {
// A check was already done above to ensure that capturingContent is
// in this presshell.
NS_ASSERTION(capturingContent->GetCrossShadowCurrentDoc() == GetDocument(),
NS_ASSERTION(capturingContent->GetComposedDoc() == GetDocument(),
"Unexpected document");
nsIFrame* capturingFrame = capturingContent->GetPrimaryFrame();
if (capturingFrame) {