-
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
[Remote Inspection] Add SPI to make it possible to inspect content under targeted elements #26328
Conversation
EWS run on previous version of this PR (hash c299dd2) |
EWS run on previous version of this PR (hash d9d138f) |
EWS run on previous version of this PR (hash b8eb348) |
EWS run on current version of this PR (hash 108c944) |
bool changed = false; | ||
for (auto& element : elements) { | ||
if (setNeedsVisibilityAdjustmentRecursive(element)) | ||
changed = true; | ||
} | ||
return changed; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return WTF::anyOf(elements, [&] (auto& element) {
return setNeedsVisibilityAdjustmentRecursive(element);
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's actually not quite what I want (since I want to continue calling setNeedsVisibilityAdjustmentRecursive
on the full list of elements, even if changed
already becomes true). I'll leave this as-is (unless there's another more elegant way to write this?)
(Edit: to clarify, WTF::anyOf
will bail early when the lambda returns true
on the first element)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah got it; sounds good!
β¦der targeted elements https://bugs.webkit.org/show_bug.cgi?id=271475 Reviewed by Aditya Keerthi. Introduce `-_adjustVisibilityForTargetedElements:completionHandler:`, and hook it up to the newly- landed visibility adjustment infrastructure in WebCore. See below for more details. * LayoutTests/TestExpectations: * LayoutTests/fast/element-targeting/basic-element-targeting-expected.html: Added. * LayoutTests/fast/element-targeting/basic-element-targeting.html: Added. * LayoutTests/platform/ios-wk2/TestExpectations: * LayoutTests/platform/mac-wk2/TestExpectations: Add a test directory (and basic test) to exercise this new SPI. * LayoutTests/resources/ui-helper.js: (window.UIHelper.requestRenderedTextForSelector): (window.UIHelper.adjustVisibilityForFrontmostTarget): (window.UIHelper): Add a testing hook that allows layout tests to exercise element targeting. * Source/WebCore/page/ElementTargeting.cpp: (WebCore::setNeedsVisibilityAdjustmentRecursive): (WebCore::adjustVisibilityForTargetedElements): * Source/WebCore/page/ElementTargeting.h: * Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _adjustVisibilityForTargetedElements:completionHandler:]): * Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h: * Source/WebKit/UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::adjustVisibilityForTargetedElements): Add plumbing through `WebPageProxy` and `WebPage`, down into WebCore. * Source/WebKit/UIProcess/WebPageProxy.h: * Source/WebKit/WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::adjustVisibilityForTargetedElements): * Source/WebKit/WebProcess/WebPage/WebPage.h: * Source/WebKit/WebProcess/WebPage/WebPage.messages.in: * Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl: * Tools/TestRunnerShared/UIScriptContext/UIScriptController.h: (WTR::UIScriptController::adjustVisibilityForFrontmostTarget): * Tools/WebKitTestRunner/cocoa/UIScriptControllerCocoa.h: * Tools/WebKitTestRunner/cocoa/UIScriptControllerCocoa.mm: (WTR::UIScriptControllerCocoa::adjustVisibilityForFrontmostTarget): Canonical link: https://commits.webkit.org/276573@main
108c944
to
10f56d8
Compare
Committed 276573@main (10f56d8): https://commits.webkit.org/276573@main Reviewed commits have been landed. Closing PR #26328 and removing active labels. |
10f56d8
108c944
π ios-simπ§ͺ wpe-wk2π tvπ§ͺ gtk-wk2π watch