| Summary: | PDF.js content script is adding custom cocoa style unconditionally | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Carlos Garcia Campos <cgarcia> | ||||
| Component: | Assignee: | Nobody <webkit-unassigned> | |||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | bfulgham, cdumez, changseok, esprehn+autocc, ews-watchlist, gyuyoung.kim, joepeck, ntim, thorton, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 235969, 237527 | ||||||
| Attachments: |
|
||||||
|
Description
Carlos Garcia Campos
2022-03-07 02:52:09 PST
Created attachment 453953 [details]
Patch
Comment on attachment 453953 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=453953&action=review > Source/WebCore/html/PDFDocument.cpp:217 > +#if PLATFORM(COCOA) > + link->setAttribute(hrefAttr, "webkit-pdfjs-viewer://pdfjs/extras/cocoa/style.css"_s); > +#endif Do #if preprocessing conditions not work in the JS file? If they do, I'd rather see this logic in the JS file. Comment on attachment 453953 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=453953&action=review >> Source/WebCore/html/PDFDocument.cpp:217 >> +#endif > > Do #if preprocessing conditions not work in the JS file? If they do, I'd rather see this logic in the JS file. I don't think so, the script is injected as is, without any preprocessing. I don't know how to make it platform dependent in a JS file, that's why I moved it to cpp. Committed r290983 (248161@main): <https://commits.webkit.org/248161@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 453953 [details]. |