Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 017e7fd5e52a85f2b434ea1d018e192cca1c91a3
      
https://github.com/WebKit/WebKit/commit/017e7fd5e52a85f2b434ea1d018e192cca1c91a3
  Author: Tyler Wilcock <[email protected]>
  Date:   2023-05-17 (Wed, 17 May 2023)

  Changed paths:
    A LayoutTests/accessibility/mac/lazy-spellchecking-expected.txt
    A LayoutTests/accessibility/mac/lazy-spellchecking.html
    M LayoutTests/platform/mac-wk1/TestExpectations
    M Source/WebCore/accessibility/AXObjectCache.cpp
    M Source/WebCore/accessibility/AXObjectCache.h
    M Source/WebCore/accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm
    M Source/WebCore/accessibility/mac/AXObjectCacheMac.mm
    M Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm
    M Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.h
    M Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.h
    M Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
    M Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h
    M Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp
    M Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.h
    M Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityController.idl
    M Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp

  Log Message:
  -----------
  AX: Use AXDidSpellCheck to allow assistive technologies to lazily resolve 
spell-checking
https://bugs.webkit.org/show_bug.cgi?id=256629
rdar://problem/109191055

Reviewed by Chris Fleizach.

Eager spellchecking (which is always the behavior prior to this patch) can 
cause performance issues because
TextCheckerMac::checkTextOfParagraph can be very, very slow. Slow is fine if 
you're requesting this information
asynchronously, but we are not.

With this patch, we make use of a new attribute: AXDidSpellCheck. When set to 
@NO, AXDidSpellCheck can inform ATs
that we did not perform an eager spellcheck, and that they should spellcheck 
when they need it. Beyond only doing work
when needed, ATs can generally spellcheck more cheaply than WebKit, since 
spellchecking from WebKit requires
waiting on the main-thread to perform sync IPC to the UI process.

* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::setForceDeferredSpellChecking):
* Source/WebCore/accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::forceDeferredSpellChecking):
(WebCore::AXObjectCache::shouldSpellCheck):
(WebCore::setForceDeferredSpellChecking):
(WebCore::AXObjectCache::shouldSpellCheckEagerly): Deleted.
* Source/WebCore/accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm:
(WebCore::AXIsolatedObject::attributedStringForTextMarkerRange const):
* Source/WebCore/accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::shouldSpellCheck):
(WebCore::AXObjectCache::shouldSpellCheckEagerly): Deleted.
* Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm:
(WebCore::attributedStringSetSpelling):
(WebCore::attributedStringCreate):
(WebCore::attributedStringSetSpellingEagerly): Deleted.
* Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.h:
* Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKAccessibilitySetForceDeferredSpellChecking):
* Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
* Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:
(WTR::AccessibilityController::setForceDeferredSpellChecking):
* Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.h:
* Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityController.idl:
* Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):

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


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

Reply via email to