RESOLVED FIXED 145069
[Content Extensions] Relax restrictions on triggers that match everything.
https://bugs.webkit.org/show_bug.cgi?id=145069
Summary [Content Extensions] Relax restrictions on triggers that match everything.
Alex Christensen
Reported 2015-05-15 13:19:44 PDT
Right now we have restrictions on rules with triggers that match everything such as .* We do not allow them after ignore-previous-rules. We do not allow them with if-domain or unless-domain. There are simple workarounds for these restrictions such as using [a-zA-Z]* which would have effectively the same behavior but kill performance by matching on almost every character. We should just compile the right thing and let people be able to use .* everywhere and encourage them to put their css at the beginning.
Attachments
Patch (40.52 KB, patch)
2015-05-15 13:31 PDT, Alex Christensen
no flags
Patch (42.38 KB, patch)
2015-05-15 13:57 PDT, Alex Christensen
benjamin: review+
Alex Christensen
Comment 1 2015-05-15 13:31:53 PDT
Alex Christensen
Comment 2 2015-05-15 13:34:26 PDT
Comment on attachment 253219 [details] Patch I need to increment the version number and rebase this after https://bugs.webkit.org/show_bug.cgi?id=145027 but please review.
Alex Christensen
Comment 3 2015-05-15 13:57:59 PDT
Alex Christensen
Comment 4 2015-05-15 22:53:29 PDT
Comment on attachment 253221 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=253221&action=review > Source/WebCore/contentextensions/DFABytecodeInterpreter.cpp:122 > if (instruction == DFABytecodeInstruction::AppendAction) this should be else if
Benjamin Poulain
Comment 5 2015-05-18 14:45:28 PDT
Comment on attachment 253221 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=253221&action=review > Source/WebCore/contentextensions/DFABytecodeCompiler.cpp:53 > + // High bits are used to store flags. Booleans are stored in the 48th and 49th bit. See compileRuleList. Describing the format here guarantees your comment will get out of sync. > Source/WebCore/contentextensions/DFABytecodeCompiler.cpp:66 > + if (action & DisplayNoneStyleSheetFlag) { > + RELEASE_ASSERT(!(action & IfDomainFlag)); > + append<DFABytecodeInstruction>(m_bytecode, DFABytecodeInstruction::AppendActionDefaultStylesheet); > + } else if (action & IfDomainFlag) How do you get into those cases? not(action & 0xFFFF00000000) is a superset of those two tests.
Alex Christensen
Comment 6 2015-05-20 10:42:19 PDT
(In reply to comment #5) > not(action & 0xFFFF00000000) is a superset of those two tests. That code is correct. not(action & 0x3000000000000) is a superset of those two tests.
Alex Christensen
Comment 7 2015-05-20 10:57:18 PDT
I added a test using backend5 and fixed the else if. http://trac.webkit.org/changeset/184644
Benjamin Poulain
Comment 8 2015-05-20 12:41:00 PDT
(In reply to comment #6) > (In reply to comment #5) > > not(action & 0xFFFF00000000) is a superset of those two tests. > That code is correct. not(action & 0x3000000000000) is a superset of those > two tests. ok
Alex Christensen
Comment 9 2015-05-26 14:27:47 PDT
Note You need to log in before you can comment on or make changes to this bug.