Bug 237516

Summary: PDF.js content script is adding custom cocoa style unconditionally
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: PDFAssignee: 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 Flags
Patch none

Carlos Garcia Campos
Reported 2022-03-07 02:52:09 PST
I should be possible to add different style depending on the platform.
Attachments
Patch (5.96 KB, patch)
2022-03-07 02:56 PST, Carlos Garcia Campos
no flags
Carlos Garcia Campos
Comment 1 2022-03-07 02:56:02 PST
Tim Nguyen (:ntim)
Comment 2 2022-03-07 08:48:21 PST
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.
Carlos Garcia Campos
Comment 3 2022-03-08 00:33:07 PST
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.
EWS
Comment 4 2022-03-08 01:26:50 PST
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].
Radar WebKit Bug Importer
Comment 5 2022-03-08 01:27:21 PST
Note You need to log in before you can comment on or make changes to this bug.