[Webkit-unassigned] [Bug 168779] New: Spell check not updated if moving with caret by modifying the selection

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 23 08:12:31 PST 2017


            Bug ID: 168779
           Summary: Spell check not updated if moving with caret by
                    modifying the selection
    Classification: Unclassified
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: HTML Editing
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: tpopela at redhat.com
                CC: cgarcia at igalia.com, mcatanzaro at igalia.com,
                    rniwa at webkit.org

Created attachment 302512
  --> https://bugs.webkit.org/attachment.cgi?id=302512&action=review
test case

To describe the problem imagine that you are creating an advanced WYSIWYG editor based on contenteditable. You are modifying the DOM directly (as some of the document's execCommand methods are not sufficient for you) and at some point the spell check for the element is lost. The suggested method (until https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/forceSpellCheck is ready and implemented in WebKit) is to move the caret to the beginning of the element and then by modifying the selection, moving the caret to the end of the element (that's what the attached test case is doing) forces the spell check to be renewed. To speak precisely it forced as after the bug 129024 the spell checking is now done async. Now, if we are moving the caret in a loop then the spell check is scheduled inside Editor::respondToChangedSelection() and we move the caret to the next work, but inside Editor::respondToChangedSelection() the spell check for the current word under caret is skipped as ther

The question is how is the application supposed to refresh the spell check? In Chromium the test case works as expected. In Firefox they are renewing the spell check automatically (if spellcheck="true" is presented). The test case works in WebKit if I add a call to Editor::updateEditorUINowIfScheduled() if the timer is active, but that's not a solution as that's basically reverting the bug 129024. It also works if I'm moving the caret after 1 ms (set through setTimeout()), but that's not a solution as well.

Ryosuke do you have any idea (as you are the one who introduced that change)?

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170223/80171b32/attachment.html>

More information about the webkit-unassigned mailing list