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

REGRESSION (GPU Process): Data detector border doesn't appear when hovering over text in Mail #13447

Merged
merged 1 commit into from
May 4, 2023

Conversation

pxlcoder
Copy link
Member

@pxlcoder pxlcoder commented May 4, 2023

a8ec36c

REGRESSION (GPU Process): Data detector border doesn't appear when hovering over text in Mail
https://bugs.webkit.org/show_bug.cgi?id=256320
rdar://108559329

Reviewed by Tim Horton.

DataDetectors UI in Mail is implemented using an injected bundle. Specifically,
the `PageOverlay` API is used to draw the content. Following the introduction of
the GPU Process on macOS, there is no longer a platform graphics context in the
Web Process. Consequently, WebKit hands DataDetectors.framework a `NULL`
`CGContextRef` to draw into, resulting in no content being drawn.

To fix, create a temporary image buffer in the Web Process, for clients of
the injected bundle `PageOverlay` API to draw into. The image buffer is then
drawn into the `GraphicsContext` using an existing drawing command.

* Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:

To limit the size of the temporary image buffer, the size is restricted to the
size of the dirty rect. This also requires translating the image buffer's
context, as clients are drawing relative to (0, 0).

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

24c2ac0

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

@pxlcoder pxlcoder requested a review from cdumez as a code owner May 4, 2023 17:46
@pxlcoder pxlcoder self-assigned this May 4, 2023
@pxlcoder pxlcoder added the Platform Portability improvements and other general platform improvements not driven directly by site bugs. label May 4, 2023
Copy link
Contributor

@hortont424 hortont424 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 Q: how did no test catch this? I guess we only have API tests so they don't check the pixels?

@pxlcoder
Copy link
Member Author

pxlcoder commented May 4, 2023

1 Q: how did no test catch this? I guess we only have API tests so they don't check the pixels?

It looks like we only have a single test that uses the injected bundle PageOverlay API? That test also appears to be disabled...

(ProcessSwap.PageOverlayLayerPersistence)

@pxlcoder pxlcoder added the merge-queue Applied to send a pull request to merge-queue label May 4, 2023
…vering over text in Mail

https://bugs.webkit.org/show_bug.cgi?id=256320
rdar://108559329

Reviewed by Tim Horton.

DataDetectors UI in Mail is implemented using an injected bundle. Specifically,
the `PageOverlay` API is used to draw the content. Following the introduction of
the GPU Process on macOS, there is no longer a platform graphics context in the
Web Process. Consequently, WebKit hands DataDetectors.framework a `NULL`
`CGContextRef` to draw into, resulting in no content being drawn.

To fix, create a temporary image buffer in the Web Process, for clients of
the injected bundle `PageOverlay` API to draw into. The image buffer is then
drawn into the `GraphicsContext` using an existing drawing command.

* Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:

To limit the size of the temporary image buffer, the size is restricted to the
size of the dirty rect. This also requires translating the image buffer's
context, as clients are drawing relative to (0, 0).

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

Committed 263700@main (a8ec36c): https://commits.webkit.org/263700@main

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

@webkit-commit-queue webkit-commit-queue merged commit a8ec36c into WebKit:main May 4, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform Portability improvements and other general platform improvements not driven directly by site bugs.
Projects
None yet
4 participants