| Summary: | Create PDFDocument stub | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Tim Nguyen (:ntim) <ntim> | ||||||
| Component: | Assignee: | Tim Nguyen (:ntim) <ntim> | |||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | annulen, bfulgham, cdumez, changseok, esprehn+autocc, ews-watchlist, gyuyoung.kim, kangil.han, ryuan.choi, sergio, thorton, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Bug Depends on: | 236529 | ||||||||
| Bug Blocks: | 235969 | ||||||||
| Attachments: |
|
||||||||
|
Description
Tim Nguyen (:ntim)
2022-02-01 12:48:02 PST
Created attachment 450700 [details]
Patch
Comment on attachment 450700 [details] 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. (In reply to Brent Fulgham from comment #3) > Comment on attachment 450700 [details] > 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)); Done. > > 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. First iteration will be URL-based, so I'll remove those comments for now. I'll file an bug to change it from URL-based to blob-based. Created attachment 450739 [details]
[fast-cq] Patch
Committed r289031 (246739@main): <https://commits.webkit.org/246739@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 450739 [details]. |