-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Cocoa] Upstream support for system context retrieval through UIIntelligenceSupport #29843
Conversation
EWS run on previous version of this PR (hash 7e788bb) |
EWS run on previous version of this PR (hash 99e6bd8) |
Oh, looks like I've inadvertently disabled text extraction when running layout tests on downlevel OSes. I'll need to restore that part (by reintroducing a TestOption to enable text extraction APIs). Thanks for the reviews — will fix these tests and reupload.. |
EWS run on current version of this PR (hash c8750d9) |
…ligenceSupport https://bugs.webkit.org/show_bug.cgi?id=275510 Reviewed by Aditya Keerthi and Megan Gardner. Upstream support for system context retrieval through the UIIntelligenceSupport framework on iOS 18 and macOS Sequoia. See below for more comments. * LayoutTests/fast/text-extraction/basic-text-extraction.html: * LayoutTests/fast/text-extraction/text-extraction-when-scrolled.html: Add an explicit `textExtractionEnabled=true` to enable use of the text extraction SPI. * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WTF/wtf/PlatformHave.h: Add a new compile-time flag: `HAVE(UIINTELLIGENCESUPPORT_FRAMEWORK)`. Use this flag to enable the runtime flag `TextExtractionEnabled` by default on supported platforms. * Source/WebKit/Configurations/WebKitSwift.xcconfig: Remove `WKWebView+TextExtraction.swift` as an excluded source, now that the file is no longer in WebKitAdditions. * Source/WebKit/DerivedSources-input.xcfilelist: * Source/WebKit/DerivedSources.make: * Source/WebKit/UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didCommitLoadForFrame): Remove an unnecessary compile-time flag, `ENABLE(TEXT_EXTRACTION)`. This was only used to avoid eagerly loading `libWebKitSwift` on platforms where support for UIIntelligenceSupport is missing; it's a bit cleaner to just turn the runtime feature off by default when the above compile-time flag, `HAVE(UIINTELLIGENCESUPPORT_FRAMEWORK)`, is off. * Source/WebKit/WebKit.xcodeproj/project.pbxproj: * Source/WebKit/WebKitSwift/TextExtraction/WKWebView+TextExtraction.swift: Added. Move this source file to `WebKitSwift/`, from WebKitAdditions. (createEditable(for:)): (createElementContent(for:)): (createIntelligenceElement(_:)): (WKWebView._intelligenceBaseClass): (WKWebView._intelligenceCollectContent(in:collector:)): (WKWebView._intelligenceCollectRemoteContent(in:remoteContextWrapper:)): (WKWebView._requestTextExtraction(in:completionHandler:)): Upstream support code for converting `WKTextExtractionItem` → `IntelligenceElement`. * Tools/WebKitTestRunner/TestOptions.cpp: (WTR::TestOptions::defaults): (WTR::TestOptions::keyTypeMapping): * Tools/WebKitTestRunner/TestOptions.h: (WTR::TestOptions::textExtractionEnabled const): * Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm: (WTR::TestController::cocoaResetStateToConsistentValues): Reintroduce a test option to enable TextExtraction, since enablement is now properly gated on `HAVE(UIINTELLIGENCESUPPORT_FRAMEWORK)`. Prior to this upstreaming, it was unconditionally (and unnecessarily) enabled everywhere. Canonical link: https://commits.webkit.org/280051@main
c8750d9
to
66195e9
Compare
Committed 280051@main (66195e9): https://commits.webkit.org/280051@main Reviewed commits have been landed. Closing PR #29843 and removing active labels. |
66195e9
c8750d9
🛠 jsc-armv7🧪 jsc-armv7-tests