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

UI-Side Compositing : Text on a Button in PDF and inputted text appear upside down #13041

Merged
merged 1 commit into from Apr 24, 2023

Conversation

rr-codes
Copy link
Contributor

@rr-codes rr-codes commented Apr 21, 2023

9358d2a

UI-Side Compositing : Text on a Button in PDF and inputted text appear upside down
https://bugs.webkit.org/show_bug.cgi?id=255797
rdar://107127603

Reviewed by Megan Gardner.

With UI-side compositing, PDF annotations were rendered upside-down due to `isGeometryFlipped`
being `true` for their layers.

This PR fixes this by adopting a PDFKit delegate method on the PDF layer controller's delegate
to access each annotation's layers, and then flips them vertically with a transform to get them
to be the correct orientation.

* Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:
(-[WKPDFLayerControllerDelegate initWithPDFPlugin:]):
(-[WKPDFLayerControllerDelegate pdfLayerController:didUpdateLayer:forAnnotation:]):
(WebKit::PDFPlugin::setView):

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

@rr-codes rr-codes requested a review from cdumez as a code owner April 21, 2023 18:19
@rr-codes rr-codes self-assigned this Apr 21, 2023
@rr-codes rr-codes added the PDF For bugs in WebKit's built-in PDF support. label Apr 21, 2023
Copy link
Contributor

@megangardner megangardner left a comment

Choose a reason for hiding this comment

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

Any way to write a test for this?

@rr-codes rr-codes added the merge-queue Applied to send a pull request to merge-queue label Apr 24, 2023
…r upside down

https://bugs.webkit.org/show_bug.cgi?id=255797
rdar://107127603

Reviewed by Megan Gardner.

With UI-side compositing, PDF annotations were rendered upside-down due to `isGeometryFlipped`
being `true` for their layers.

This PR fixes this by adopting a PDFKit delegate method on the PDF layer controller's delegate
to access each annotation's layers, and then flips them vertically with a transform to get them
to be the correct orientation.

* Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:
(-[WKPDFLayerControllerDelegate initWithPDFPlugin:]):
(-[WKPDFLayerControllerDelegate pdfLayerController:didUpdateLayer:forAnnotation:]):
(WebKit::PDFPlugin::setView):

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

Committed 263343@main (9358d2a): https://commits.webkit.org/263343@main

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

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PDF For bugs in WebKit's built-in PDF support.
Projects
None yet
4 participants