Bug 1459401: Remove unused container argument in EventStateManager::ContentRemoved. r?smaug
Can we assert PresShell::mDocument == ESM::mDocument? If so, we can remove the
other arg too.
MozReview-Commit-ID: HAuTfzuo3iY
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -5376,19 +5376,17 @@ EventStateManager::ResetLastOverForConte
if (aElemWrapper && aElemWrapper->mLastOverElement &&
nsContentUtils::ContentIsDescendantOf(aElemWrapper->mLastOverElement,
aContent)) {
aElemWrapper->mLastOverElement = nullptr;
}
}
void
-EventStateManager::ContentRemoved(nsIDocument* aDocument,
- nsIContent* aMaybeContainer,
- nsIContent* aContent)
+EventStateManager::ContentRemoved(nsIDocument* aDocument, nsIContent* aContent)
{
/*
* Anchor and area elements when focused or hovered might make the UI to show
* the current link. We want to make sure that the UI gets informed when they
* are actually removed from the DOM.
*/
if (aContent->IsAnyOfHTMLElements(nsGkAtoms::a, nsGkAtoms::area) &&
(aContent->AsElement()->State().HasAtLeastOneOfStates(NS_EVENT_STATE_FOCUS |
--- a/dom/events/EventStateManager.h
+++ b/dom/events/EventStateManager.h
@@ -142,18 +142,17 @@ public:
* @return Whether the content was able to change all states. Returns false
* if a resulting DOM event causes the content node passed in
* to not change states. Note, the frame for the content may
* change as a result of the content state change, because of
* frame reconstructions that may occur, but this does not
* affect the return value.
*/
bool SetContentState(nsIContent* aContent, EventStates aState);
- void ContentRemoved(nsIDocument* aDocument, nsIContent* aMaybeContainer,
- nsIContent* aContent);
+ void ContentRemoved(nsIDocument* aDocument, nsIContent* aContent);
bool EventStatusOK(WidgetGUIEvent* aEvent);
/**
* EventStateManager stores IMEContentObserver while it's observing contents.
* Following mehtods are called by IMEContentObserver when it starts to
* observe or stops observing the content.
*/
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -4541,18 +4541,17 @@ PresShell::ContentRemoved(nsIContent* aC
{
NS_PRECONDITION(!mIsDocumentGone, "Unexpected ContentRemoved");
NS_PRECONDITION(aChild->OwnerDoc() == mDocument, "Unexpected document");
nsINode* container = aChild->GetParentNode();
// Notify the ESM that the content has been removed, so that
// it can clean up any state related to the content.
- mPresContext->EventStateManager()
- ->ContentRemoved(mDocument, aChild->GetParent(), aChild);
+ mPresContext->EventStateManager()->ContentRemoved(mDocument, aChild);
nsAutoCauseReflowNotifier crNotifier(this);
// Call this here so it only happens for real content mutations and
// not cases when the frame constructor calls its own methods to force
// frame reconstruction.
nsIContent* oldNextSibling = nullptr;