Skip to content
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

[MacOS] WKWebView should have SPI to report whether a PDF is being displayed #28052

Merged
merged 1 commit into from
May 3, 2024

Conversation

aprotyas
Copy link
Member

@aprotyas aprotyas commented May 2, 2024

dc1ebf3

[MacOS] WKWebView should have SPI to report whether a PDF is being displayed
https://bugs.webkit.org/show_bug.cgi?id=273639
rdar://127442624

Reviewed by Tim Horton.

This patch exposes the `_isDisplayingPDF` method on WKWebViewMac, which
clients can query to answer whether the web view is presenting a main
frame PDF.

This also establishes parity with WKWebViewIOS, where the namesake was
added in 149116@main.

* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _isDisplayingPDF]):

Move getter implementation to this shared location.

* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:

Move property declaration to the shared WKPrivate category.

* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _isDisplayingPDF]): Deleted.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKPDFView.mm:
(TEST(WKWebView, IsDisplayingPDF)):

Add an API test exercising the `_isDisplayingPDF` SPI.

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

09f81a5

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ§ͺ api-wpe
βœ… πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1 βœ… πŸ›  wpe-skia
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ›  gtk
βœ… πŸ›  tv   πŸ§ͺ mac-AS-debug-wk2 βœ… πŸ§ͺ gtk-wk2
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-wk2-stress βœ… πŸ§ͺ api-gtk
βœ… πŸ›  watch
βœ… πŸ›  πŸ§ͺ unsafe-merge βœ… πŸ›  watch-sim

@aprotyas aprotyas requested a review from cdumez as a code owner May 2, 2024 18:51
@aprotyas aprotyas self-assigned this May 2, 2024
@aprotyas aprotyas added the WebKit API For issues and bugs in the Web Kit public embedding APIs label May 2, 2024
@aprotyas aprotyas added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label May 3, 2024
…splayed

https://bugs.webkit.org/show_bug.cgi?id=273639
rdar://127442624

Reviewed by Tim Horton.

This patch exposes the `_isDisplayingPDF` method on WKWebViewMac, which
clients can query to answer whether the web view is presenting a main
frame PDF.

This also establishes parity with WKWebViewIOS, where the namesake was
added in 149116@main.

* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _isDisplayingPDF]):

Move getter implementation to this shared location.

* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:

Move property declaration to the shared WKPrivate category.

* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _isDisplayingPDF]): Deleted.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKPDFView.mm:
(TEST(WKWebView, IsDisplayingPDF)):

Add an API test exercising the `_isDisplayingPDF` SPI.

Canonical link: https://commits.webkit.org/278324@main
@webkit-commit-queue
Copy link
Collaborator

Committed 278324@main (dc1ebf3): https://commits.webkit.org/278324@main

Reviewed commits have been landed. Closing PR #28052 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit dc1ebf3 into WebKit:main May 3, 2024
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebKit API For issues and bugs in the Web Kit public embedding APIs
Projects
None yet
4 participants