Bug 142298 - content extensions need universal actions
Summary: content extensions need universal actions
Status: RESOLVED DUPLICATE of bug 142799
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-04 12:01 PST by Alex Christensen
Modified: 2015-03-19 08:58 PDT (History)
2 users (show)

See Also:


Attachments
Patch (12.19 KB, patch)
2015-03-04 12:08 PST, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (12.19 KB, patch)
2015-03-04 13:20 PST, Alex Christensen
benjamin: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2015-03-04 12:01:01 PST
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.
Comment 1 Alex Christensen 2015-03-04 12:08:05 PST
Created attachment 247878 [details]
Patch
Comment 2 Alex Christensen 2015-03-04 13:20:50 PST
Created attachment 247888 [details]
Patch
Comment 3 Benjamin Poulain 2015-03-04 17:58:15 PST
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 :)
Comment 4 Alex Christensen 2015-03-19 08:58:01 PDT

*** This bug has been marked as a duplicate of bug 142799 ***