| Summary: | Add an SPI to allow UserStyleSheet injection to target a specific WKWebView | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Antoine Quint <graouts> | ||||||
| Component: | WebKit API | Assignee: | Antoine Quint <graouts> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | achristensen, beidson, cdumez, esprehn+autocc, ews-watchlist, kangil.han, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| See Also: |
https://bugs.webkit.org/show_bug.cgi?id=208644 https://bugs.webkit.org/show_bug.cgi?id=209934 |
||||||||
| Attachments: |
|
||||||||
|
Description
Antoine Quint
2020-03-04 08:51:43 PST
Created attachment 392421 [details]
Patch
Created attachment 392433 [details]
Patch
Comment on attachment 392433 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=392433&action=review > Source/WebKit/UIProcess/API/Cocoa/_WKUserStyleSheet.h:47 > +- (instancetype)initWithSource:(NSString *)source forWKWebView:(WKWebView *)webView forMainFrameOnly:(BOOL)forMainFrameOnly userContentWorld:(_WKUserContentWorld *)userContentWorld; Nit: extra space. > Source/WebKit/WebProcess/UserContent/WebUserContentController.cpp:457 > + page->injectUserStyleSheet(userStyleSheet); Why do we need a separate way to inject a stylesheet? Can't we just use the existing way, but if there is a page id and it's different than the current page id, do nothing? Comment on attachment 392433 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=392433&action=review > Source/WebKit/UIProcess/API/Cocoa/_WKUserStyleSheet.mm:53 > +- (instancetype)initWithSource:(NSString *)source forWKWebView:(WKWebView *)webView forMainFrameOnly:(BOOL)forMainFrameOnly userContentWorld:(_WKUserContentWorld *)userContentWorld Extra space here too >> Source/WebKit/WebProcess/UserContent/WebUserContentController.cpp:457 >> + page->injectUserStyleSheet(userStyleSheet); > > Why do we need a separate way to inject a stylesheet? Can't we just use the existing way, but if there is a page id and it's different than the current page id, do nothing? I know the answer - WebCore page's don't know their page id, so the page id check has to be up in WebKit. Committed r257870: <https://trac.webkit.org/changeset/257870> Some followup work in bug 208644. |