Most of the css in content extensions will probably be applied to all pages. We don't want to compile a bunch of .* triggers, so let's add a faster way to do this. This might not be the best way to do this. I'm open to better ideas. We mentioned making a new default style sheet, but I'm not sure if we actually want to do that.
Created attachment 247878 [details] Patch
Created attachment 247888 [details] Patch
Comment on attachment 247888 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=247888&action=review > Source/WebCore/contentextensions/ContentExtensionCompiler.cpp:114 > + if (trigger.urlFilter == ".*") We should not do that. There are other ways to write the same thing. You could do "(.+)?" for example. The way to detect that is check if: -There is any final state in the epsilon closure of the start state. -Alternatively, every transition from the epsilon closure of the start state ends in a state closed on a final state. > Source/WebCore/contentextensions/ContentExtensionParser.cpp:54 > + trigger.urlFilter = ".*"; I guess you could also leave the trigger empty and just accept that in the other parts. > LayoutTests/ChangeLog:11 > + * http/tests/usercontentfilter/basic-filter.html: > + * http/tests/usercontentfilter/basic-filter.html.json: > + * http/tests/usercontentfilter/block-all.html: Added. > + * http/tests/usercontentfilter/block-all.html.json: Added. Wooot! More tests. You make me feel bad about my patch :)
*** This bug has been marked as a duplicate of bug 142799 ***