[webkit-reviews] review granted: [Bug 235970] Create PDFDocument stub : [Attachment 450700] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 2 16:30:04 PST 2022


Brent Fulgham <bfulgham at webkit.org> has granted Tim Nguyen (:ntim)
<ntim at apple.com>'s request for review:
Bug 235970: Create PDFDocument stub
https://bugs.webkit.org/show_bug.cgi?id=235970

Attachment 450700: Patch

https://bugs.webkit.org/attachment.cgi?id=450700&action=review




--- Comment #3 from Brent Fulgham <bfulgham at webkit.org> ---
Comment on attachment 450700
  --> https://bugs.webkit.org/attachment.cgi?id=450700
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=450700&action=review

I think this looks fine as a first step, but needs a few adjustments before you
land.

> Source/WebCore/dom/DOMImplementation.cpp:156
> +    if (settings.pdfJSViewerEnabled() &&
MIMETypeRegistry::isPDFMIMEType(contentType))

You should check for nullptr frame, like we do for the image case.

> Source/WebCore/html/PDFDocument.cpp:97
> +    // FIXME: add actual viewer URL

// FIXME: Replace about:blank with actual viewer URL

> Source/WebCore/html/PDFDocument.cpp:106
> +    body->setAttribute(styleAttr, "margin: 0px;height: 100vh;");

body->setAttribute(styleAttr, AtomString("margin: 0px;height: 100vh;",
AtomString::ConstructFromLiteral));

> Source/WebCore/html/PDFDocument.cpp:111
> +    iframe->setAttribute(styleAttr, "width: 100%; height: 100%; border: 0;
display: block;");

iframe->setAttribute(styleAttr, AtomString("width: 100%; height: 100%; border:
0; display: block;", AtomString::ConstructFromLiteral));

> Source/WebCore/html/PDFDocument.cpp:121
> +    // FIXME: Collect bytes during parsing

We usually do:
notImplemented();

> Source/WebCore/html/PDFDocument.cpp:127
> +    // FIXME: Send bytes as a blob into the iframe, and ask it to render
that blob

Ditto.


More information about the webkit-reviews mailing list