diff options
author | FranklinDM <mrmineshafter17@gmail.com> | 2023-03-04 21:03:25 +0800 |
---|---|---|
committer | FranklinDM <mrmineshafter17@gmail.com> | 2023-03-04 21:32:19 +0800 |
commit | cd76bf5aa1a512823ddd9e8d601667f74178aa90 (patch) | |
tree | e27995b1d5eeb624b3a9b04629340b320b48284e /dom | |
parent | 851e691089d5635d9a2940b89fc8ff227fdaab54 (diff) | |
download | uxp-cd76bf5aa1a512823ddd9e8d601667f74178aa90.tar.gz |
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.
Diffstat (limited to 'dom')
-rw-r--r-- | dom/events/ContentEventHandler.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/dom/events/ContentEventHandler.cpp b/dom/events/ContentEventHandler.cpp index 38c6ad0207..11fb53029b 100644 --- a/dom/events/ContentEventHandler.cpp +++ b/dom/events/ContentEventHandler.cpp @@ -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; } |