1
0
mirror of https://github.com/roytam1/UXP.git synced 2026-05-26 13:58:49 +00:00

Issue #2135 - Bug 1433669/Part 2: Flush the document instead of the shell in ContentEventHandler

* Unlike the original patch, I went with just getting a reference to the document rather than replacing mPresShell with mDocument.
This commit is contained in:
FranklinDM
2023-03-04 21:03:25 +08:00
committed by roytam1
parent 2f9186959c
commit 4d778226ed
+3 -4
View File
@@ -116,10 +116,9 @@ ContentEventHandler::InitBasic()
// If text frame which has overflowing selection underline is dirty,
// we need to flush the pending reflow here.
mPresShell->FlushPendingNotifications(Flush_Layout);
// Flushing notifications can cause mPresShell to be destroyed (bug 577963).
NS_ENSURE_TRUE(!mPresShell->IsDestroying(), NS_ERROR_FAILURE);
if (nsIDocument* doc = mPresShell->GetDocument()) {
doc->FlushPendingNotifications(Flush_Layout);
}
return NS_OK;
}