Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d3bab4fdb4dc4cc8da0167cd9c1f141e6b3cf7ea
      
https://github.com/WebKit/WebKit/commit/d3bab4fdb4dc4cc8da0167cd9c1f141e6b3cf7ea
  Author: Chris Dumez <[email protected]>
  Date:   2023-06-21 (Wed, 21 Jun 2023)

  Changed paths:
    M Source/WebCore/editing/AlternativeTextController.cpp
    M Source/WebCore/editing/AlternativeTextController.h

  Log Message:
  -----------
  fast/editing/document-leak-altered-text-field.html is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=258356

Reviewed by Wenson Hsieh.

We would hit an assertion in Editor::markAllMisspellingsAndBadGrammarInRanges()
indicating that unifiedTextCheckerEnabled() is not true. The reason this 
function
returns false is that the Document no longer has a frame.

Normally, the AlternativeTextController::stopAlternativeTextUITimer() gets 
called
to stop the timer when the document gets detached from its frame
(via Editor::clear()). However, here the document is only temporarily detached
from its frame because it is in the back/forward cache and we fail to stop the
timer in this case.

To address the issue, I updated AlternativeTextController's timer to use a
SuspendableTimer instead of a Timer. As a result, the timer will be aware
of the back/forward cache and will suspend as needed so that it doesn't fire
while in the cache (and thus while having no frame).

* Source/WebCore/editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::AlternativeTextController):
(WebCore::AlternativeTextController::stopAlternativeTextUITimer):
* Source/WebCore/editing/AlternativeTextController.h:

Canonical link: https://commits.webkit.org/265380@main


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to