Bug 1917867 - Simplify PresShell event dispatching asserts. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D221843
This commit is contained in:
Emilio Cobos Álvarez 2024-09-12 16:50:26 +00:00
Родитель 041f31b1d3
Коммит ae1b209b84
1 изменённых файлов: 5 добавлений и 11 удалений

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

@ -8412,18 +8412,12 @@ nsresult PresShell::EventHandler::HandleEventWithTarget(
nsIContent** aTargetContent, nsIContent* aOverrideClickTarget) {
MOZ_ASSERT(aEvent);
MOZ_DIAGNOSTIC_ASSERT(aEvent->IsTrusted());
#if DEBUG
MOZ_ASSERT(!aNewEventFrame ||
aNewEventFrame->PresContext()->GetPresShell() == mPresShell,
MOZ_ASSERT(!aNewEventFrame || aNewEventFrame->PresShell() == mPresShell,
"wrong shell");
if (aNewEventContent) {
Document* doc = aNewEventContent->GetComposedDoc();
NS_ASSERTION(doc, "event for content that isn't in a document");
// NOTE: We don't require that the document still have a PresShell.
// See bug 1375940.
}
#endif
// NOTE: We don't require that the document still have a PresShell.
// See bug 1375940.
NS_ASSERTION(!aNewEventContent || aNewEventContent->IsInComposedDoc(),
"event for content that isn't in a document");
NS_ENSURE_STATE(!aNewEventContent ||
aNewEventContent->GetComposedDoc() == GetDocument());
if (aEvent->mClass == ePointerEventClass ||