Skip to content

Commit

Permalink
Document UnifiedPDFPlugin coordinate spaces
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=265803

Reviewed by Wenson Hsieh and Richard Robinson.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:

Canonical link: https://commits.webkit.org/271506@main
  • Loading branch information
hortont424 committed Dec 4, 2023
1 parent 42db72e commit 7d7b457
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,24 @@ class UnifiedPDFPlugin final : public PDFPluginBase, public WebCore::GraphicsLay
void didEndMagnificationGesture() override;
void setPageScaleFactor(double scale, std::optional<WebCore::IntPoint> origin) final;

/*
Unified PDF Plugin coordinate spaces, in depth order:
- "root view": same as the rest of WebKit.
- "plugin": the space of the plugin element (origin at the top left,
ignoring all internal transforms).
- "contents": the space of the contents layer, with scrolling subtracted
out and page scale multiplied in; the painting space.
- "document": the space that the PDF pages are laid down in, with
PDFDocumentLayout's width-fitting scale divided out; includes margins.
- "page": the space of each actual PDFPage, as used by PDFKit; origin at
the bottom left of the crop box; page rotation multiplied in.
*/

WebCore::IntSize documentSize() const;
WebCore::IntSize contentsSize() const override;
unsigned firstPageHeight() const override;
Expand Down

0 comments on commit 7d7b457

Please sign in to comment.