<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[285350] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/285350">285350</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2021-11-05 12:33:46 -0700 (Fri, 05 Nov 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Restructure WKContentRuleList Action storage during compilation and interpretation
https://bugs.webkit.org/show_bug.cgi?id=232692

Patch by Alex Christensen <achristensen@webkit.org> on 2021-11-05
Reviewed by Brady Eidson.

Source/WebCore:

This uses a std::variant of each type's metadata instead of an enum type and a String.
This is necessary cleanup before implementing actions with more complex metadata.

I also separated out DeserializedAction, which is deserialized from the compiled WKContentRuleList
from Action, which is parsed from the JSON and doesn't have an identifier.

This is covered by numerous tests, which also needed syntax updating for the new structure types.
There is no change in behavior and the serialization and deserialization is all the same.

* contentextensions/ContentExtension.cpp:
(WebCore::ContentExtensions::ContentExtension::findFirstIgnorePreviousRules const):
(WebCore::ContentExtensions::ContentExtension::compileGlobalDisplayNoneStyleSheet):
* contentextensions/ContentExtensionActions.h:
(WebCore::ContentExtensions::ActionWithoutMetadata::isolatedCopy):
(WebCore::ContentExtensions::ActionWithoutMetadata::operator== const):
(WebCore::ContentExtensions::ActionWithoutMetadata::serialize const):
(WebCore::ContentExtensions::ActionWithoutMetadata::deserialize):
(WebCore::ContentExtensions::ActionWithoutMetadata::serializedLength):
(WebCore::ContentExtensions::ActionWithStringMetadata::isolatedCopy):
(WebCore::ContentExtensions::ActionWithStringMetadata::operator== const):
(WebCore::ContentExtensions::ActionWithStringMetadata::serialize const):
(WebCore::ContentExtensions::ActionWithStringMetadata::deserialize):
(WebCore::ContentExtensions::ActionWithStringMetadata::serializedLength):
(WebCore::ContentExtensions::hasStringArgument): Deleted.
* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::resolvePendingDisplayNoneActions):
(WebCore::ContentExtensions::serializeActions):
(WebCore::ContentExtensions::serializeString): Deleted.
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::loadAction):
* contentextensions/ContentExtensionRule.cpp:
(WebCore::ContentExtensions::deserializeString):
(WebCore::ContentExtensions::serializeString):
(WebCore::ContentExtensions::stringSerializedLength):
(WebCore::ContentExtensions::VariantDeserializerHelper::serializedLength):
(WebCore::ContentExtensions::Action::deserialize):
(WebCore::ContentExtensions::Action::serializedLength):
(WebCore::ContentExtensions::Action::isolatedCopy const):
(WebCore::ContentExtensions::Action::deserializeType): Deleted.
* contentextensions/ContentExtensionRule.h:
(WebCore::ContentExtensions::Action::Action):
(WebCore::ContentExtensions::Action::operator== const):
(WebCore::ContentExtensions::Action::operator!= const):
(WebCore::ContentExtensions::Action::data const):
(WebCore::ContentExtensions::DeserializedAction::DeserializedAction):
(WebCore::ContentExtensions::DeserializedAction::actionID const):
(WebCore::ContentExtensions::Action::type const): Deleted.
(WebCore::ContentExtensions::Action::actionID const): Deleted.
(WebCore::ContentExtensions::Action::stringArgument const): Deleted.
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad const):
(WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForLoad):
(WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForPingLoad):

Source/WTF:

* wtf/CrossThreadCopier.h:
* wtf/StdLibExtras.h:

Tools:

* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::testRequest):
(TestWebKitAPI::TEST_F):
(TestWebKitAPI::actionsEqual):
(WebCore::ContentExtensions::operator<<): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfCrossThreadCopierh">trunk/Source/WTF/wtf/CrossThreadCopier.h</a></li>
<li><a href="#trunkSourceWTFwtfStdLibExtrash">trunk/Source/WTF/wtf/StdLibExtras.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreHeaderscmake">trunk/Source/WebCore/Headers.cmake</a></li>
<li><a href="#trunkSourceWebCoreSourcestxt">trunk/Source/WebCore/Sources.txt</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensioncpp">trunk/Source/WebCore/contentextensions/ContentExtension.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionActionsh">trunk/Source/WebCore/contentextensions/ContentExtensionActions.h</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionCompilercpp">trunk/Source/WebCore/contentextensions/ContentExtensionCompiler.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionParsercpp">trunk/Source/WebCore/contentextensions/ContentExtensionParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionRulecpp">trunk/Source/WebCore/contentextensions/ContentExtensionRule.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionRuleh">trunk/Source/WebCore/contentextensions/ContentExtensionRule.h</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionsBackendcpp">trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionsBackendh">trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.h</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourceRequestcpp">trunk/Source/WebCore/loader/cache/CachedResourceRequest.cpp</a></li>
<li><a href="#trunkSourceWebCorepageUserContentProviderh">trunk/Source/WebCore/page/UserContentProvider.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkLoadCheckerh">trunk/Source/WebKit/NetworkProcess/NetworkLoadChecker.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWTFCrossThreadCopiercpp">trunk/Tools/TestWebKitAPI/Tests/WTF/CrossThreadCopier.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebCoreContentExtensionscpp">trunk/Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionStringSerializationcpp">trunk/Source/WebCore/contentextensions/ContentExtensionStringSerialization.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionStringSerializationh">trunk/Source/WebCore/contentextensions/ContentExtensionStringSerialization.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (285349 => 285350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog       2021-11-05 19:08:39 UTC (rev 285349)
+++ trunk/Source/WTF/ChangeLog  2021-11-05 19:33:46 UTC (rev 285350)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2021-11-05  Alex Christensen  <achristensen@webkit.org>
+
+        Restructure WKContentRuleList Action storage during compilation and interpretation
+        https://bugs.webkit.org/show_bug.cgi?id=232692
+
+        Reviewed by Brady Eidson.
+
+        * wtf/CrossThreadCopier.h:
+        * wtf/StdLibExtras.h:
+
</ins><span class="cx"> 2021-11-04  Diego Pino Garcia  <dpino@igalia.com>
</span><span class="cx"> 
</span><span class="cx">         Require MediaSession enabled to enable MediaSession PlayList API
</span></span></pre></div>
<a id="trunkSourceWTFwtfCrossThreadCopierh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/CrossThreadCopier.h (285349 => 285350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/CrossThreadCopier.h 2021-11-05 19:08:39 UTC (rev 285349)
+++ trunk/Source/WTF/wtf/CrossThreadCopier.h    2021-11-05 19:33:46 UTC (rev 285350)
</span><span class="lines">@@ -163,7 +163,7 @@
</span><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-// Default specialization for Optional of CrossThreadCopyable class.
</del><ins>+// Default specialization for std::optional of CrossThreadCopyable class.
</ins><span class="cx"> template<typename T> struct CrossThreadCopierBase<false, false, std::optional<T>> {
</span><span class="cx">     template<typename U> static std::optional<T> copy(U&& source)
</span><span class="cx">     {
</span><span class="lines">@@ -173,6 +173,16 @@
</span><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+// Default specialization for std::variant of CrossThreadCopyable classes.
+template<typename... Types> struct CrossThreadCopierBase<false, false, std::variant<Types...>> {
+    template<typename U> static std::variant<Types...> copy(U&& source)
+    {
+        return std::visit([] (auto& type) -> std::variant<Types...> {
+            return CrossThreadCopier<std::remove_const_t<std::remove_reference_t<decltype(type)>>>::copy(type);
+        }, std::forward<U>(source));
+    }
+};
+
</ins><span class="cx"> template<typename T> auto crossThreadCopy(T&& source)
</span><span class="cx"> {
</span><span class="cx">     return CrossThreadCopier<std::remove_cv_t<std::remove_reference_t<T>>>::copy(std::forward<T>(source));
</span></span></pre></div>
<a id="trunkSourceWTFwtfStdLibExtrash"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/StdLibExtras.h (285349 => 285350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/StdLibExtras.h      2021-11-05 19:08:39 UTC (rev 285349)
+++ trunk/Source/WTF/wtf/StdLibExtras.h 2021-11-05 19:33:46 UTC (rev 285350)
</span><span class="lines">@@ -392,6 +392,30 @@
</span><span class="cx">     return std::visit(makeVisitor(std::forward<F>(f)...), std::forward<V>(v));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+namespace Detail {
+
+template<std::size_t, class, class> struct AlternativeIndexHelper;
+
+template<std::size_t index, class T, class U>
+struct AlternativeIndexHelper<index, T, std::variant<U>> {
+    static constexpr std::size_t count = std::is_same_v<T, U>;
+    static constexpr std::size_t value = index;
+};
+
+template<std::size_t index, class T, class U, class... Types> struct AlternativeIndexHelper<index, T, std::variant<U, Types...>> {
+    static constexpr std::size_t count = std::is_same_v<T, U> + AlternativeIndexHelper<index + 1, T, std::variant<Types...>>::count;
+    static constexpr std::size_t value = std::is_same_v<T, U> ? index : AlternativeIndexHelper<index + 1, T, std::variant<Types...>>::value;
+};
+
+} // namespace Detail
+
+template<class T, class U> struct alternativeIndex {
+    static_assert(Detail::AlternativeIndexHelper<0, T, U>::count == 1, "There needs to be exactly one of the given type in the variant");
+    static constexpr std::size_t value = Detail::AlternativeIndexHelper<0, T, U>::value;
+};
+
+template <class T, class U> inline constexpr std::size_t alternativeIndexV = alternativeIndex<T, U>::value;
+
</ins><span class="cx"> namespace Detail
</span><span class="cx"> {
</span><span class="cx">     template <typename, template <typename...> class>
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (285349 => 285350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-11-05 19:08:39 UTC (rev 285349)
+++ trunk/Source/WebCore/ChangeLog      2021-11-05 19:33:46 UTC (rev 285350)
</span><span class="lines">@@ -1,3 +1,64 @@
</span><ins>+2021-11-05  Alex Christensen  <achristensen@webkit.org>
+
+        Restructure WKContentRuleList Action storage during compilation and interpretation
+        https://bugs.webkit.org/show_bug.cgi?id=232692
+
+        Reviewed by Brady Eidson.
+
+        This uses a std::variant of each type's metadata instead of an enum type and a String.
+        This is necessary cleanup before implementing actions with more complex metadata.
+
+        I also separated out DeserializedAction, which is deserialized from the compiled WKContentRuleList
+        from Action, which is parsed from the JSON and doesn't have an identifier.
+
+        This is covered by numerous tests, which also needed syntax updating for the new structure types.
+        There is no change in behavior and the serialization and deserialization is all the same.
+
+        * contentextensions/ContentExtension.cpp:
+        (WebCore::ContentExtensions::ContentExtension::findFirstIgnorePreviousRules const):
+        (WebCore::ContentExtensions::ContentExtension::compileGlobalDisplayNoneStyleSheet):
+        * contentextensions/ContentExtensionActions.h:
+        (WebCore::ContentExtensions::ActionWithoutMetadata::isolatedCopy):
+        (WebCore::ContentExtensions::ActionWithoutMetadata::operator== const):
+        (WebCore::ContentExtensions::ActionWithoutMetadata::serialize const):
+        (WebCore::ContentExtensions::ActionWithoutMetadata::deserialize):
+        (WebCore::ContentExtensions::ActionWithoutMetadata::serializedLength):
+        (WebCore::ContentExtensions::ActionWithStringMetadata::isolatedCopy):
+        (WebCore::ContentExtensions::ActionWithStringMetadata::operator== const):
+        (WebCore::ContentExtensions::ActionWithStringMetadata::serialize const):
+        (WebCore::ContentExtensions::ActionWithStringMetadata::deserialize):
+        (WebCore::ContentExtensions::ActionWithStringMetadata::serializedLength):
+        (WebCore::ContentExtensions::hasStringArgument): Deleted.
+        * contentextensions/ContentExtensionCompiler.cpp:
+        (WebCore::ContentExtensions::resolvePendingDisplayNoneActions):
+        (WebCore::ContentExtensions::serializeActions):
+        (WebCore::ContentExtensions::serializeString): Deleted.
+        * contentextensions/ContentExtensionParser.cpp:
+        (WebCore::ContentExtensions::loadAction):
+        * contentextensions/ContentExtensionRule.cpp:
+        (WebCore::ContentExtensions::deserializeString):
+        (WebCore::ContentExtensions::serializeString):
+        (WebCore::ContentExtensions::stringSerializedLength):
+        (WebCore::ContentExtensions::VariantDeserializerHelper::serializedLength):
+        (WebCore::ContentExtensions::Action::deserialize):
+        (WebCore::ContentExtensions::Action::serializedLength):
+        (WebCore::ContentExtensions::Action::isolatedCopy const):
+        (WebCore::ContentExtensions::Action::deserializeType): Deleted.
+        * contentextensions/ContentExtensionRule.h:
+        (WebCore::ContentExtensions::Action::Action):
+        (WebCore::ContentExtensions::Action::operator== const):
+        (WebCore::ContentExtensions::Action::operator!= const):
+        (WebCore::ContentExtensions::Action::data const):
+        (WebCore::ContentExtensions::DeserializedAction::DeserializedAction):
+        (WebCore::ContentExtensions::DeserializedAction::actionID const):
+        (WebCore::ContentExtensions::Action::type const): Deleted.
+        (WebCore::ContentExtensions::Action::actionID const): Deleted.
+        (WebCore::ContentExtensions::Action::stringArgument const): Deleted.
+        * contentextensions/ContentExtensionsBackend.cpp:
+        (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad const):
+        (WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForLoad):
+        (WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForPingLoad):
+
</ins><span class="cx"> 2021-11-05  Nikolaos Mouchtaris  <nmouchtaris@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Make scroll elasticity an enum class
</span></span></pre></div>
<a id="trunkSourceWebCoreHeaderscmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Headers.cmake (285349 => 285350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Headers.cmake       2021-11-05 19:08:39 UTC (rev 285349)
+++ trunk/Source/WebCore/Headers.cmake  2021-11-05 19:33:46 UTC (rev 285350)
</span><span class="lines">@@ -342,6 +342,7 @@
</span><span class="cx">     contentextensions/ContentExtensionError.h
</span><span class="cx">     contentextensions/ContentExtensionParser.h
</span><span class="cx">     contentextensions/ContentExtensionRule.h
</span><ins>+    contentextensions/ContentExtensionStringSerialization.h
</ins><span class="cx">     contentextensions/ContentExtensionsBackend.h
</span><span class="cx">     contentextensions/ContentExtensionsDebugging.h
</span><span class="cx">     contentextensions/ContentRuleListResults.h
</span></span></pre></div>
<a id="trunkSourceWebCoreSourcestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Sources.txt (285349 => 285350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Sources.txt 2021-11-05 19:08:39 UTC (rev 285349)
+++ trunk/Source/WebCore/Sources.txt    2021-11-05 19:33:46 UTC (rev 285350)
</span><span class="lines">@@ -611,6 +611,7 @@
</span><span class="cx"> contentextensions/ContentExtensionError.cpp
</span><span class="cx"> contentextensions/ContentExtensionParser.cpp
</span><span class="cx"> contentextensions/ContentExtensionRule.cpp
</span><ins>+contentextensions/ContentExtensionStringSerialization.cpp
</ins><span class="cx"> contentextensions/ContentExtensionStyleSheet.cpp
</span><span class="cx"> contentextensions/ContentExtensionsBackend.cpp
</span><span class="cx"> contentextensions/DFA.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (285349 => 285350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj   2021-11-05 19:08:39 UTC (rev 285349)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj      2021-11-05 19:33:46 UTC (rev 285350)
</span><span class="lines">@@ -2022,6 +2022,7 @@
</span><span class="cx">          5B92C42D2716E28A00A37CC0 /* ScrollingTreeStickyNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 5B92C42B2716E23300A37CC0 /* ScrollingTreeStickyNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          5C1B1D3F26F3978000882DA2 /* ResourceLoaderIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C1B1D3D26F3977F00882DA2 /* ResourceLoaderIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          5C2B1AEC22397EBC00B91CF7 /* ResourceResponseCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = A1F78D0B1C25422C00245446 /* ResourceResponseCocoa.mm */; };
</span><ins>+               5C2C019C27343DDE00F89D37 /* ContentExtensionStringSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C2C01992734398E00F89D37 /* ContentExtensionStringSerialization.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">           5C4304B1191AC908000E2BC0 /* EXTShaderTextureLOD.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C4304AE191AC908000E2BC0 /* EXTShaderTextureLOD.h */; };
</span><span class="cx">          5C4304B6191AEF46000E2BC0 /* JSEXTShaderTextureLOD.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C4304B4191AEF46000E2BC0 /* JSEXTShaderTextureLOD.h */; };
</span><span class="cx">          5C4A0FD725C3435000D9EE97 /* RangeResponseGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C4A0FD525C342C800D9EE97 /* RangeResponseGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -9860,6 +9861,8 @@
</span><span class="cx">          5C1B1D3D26F3977F00882DA2 /* ResourceLoaderIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoaderIdentifier.h; sourceTree = "<group>"; };
</span><span class="cx">          5C1B1D6526F8E51300882DA2 /* CSSStyleValueFactory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSSStyleValueFactory.h; sourceTree = "<group>"; };
</span><span class="cx">          5C1B1D6726F8E51400882DA2 /* CSSStyleValueFactory.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CSSStyleValueFactory.cpp; sourceTree = "<group>"; };
</span><ins>+               5C2C01992734398E00F89D37 /* ContentExtensionStringSerialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentExtensionStringSerialization.h; sourceTree = "<group>"; };
+               5C2C019B2734398E00F89D37 /* ContentExtensionStringSerialization.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentExtensionStringSerialization.cpp; sourceTree = "<group>"; };
</ins><span class="cx">           5C2EBE012577198900D55B05 /* SerializedNFA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SerializedNFA.h; sourceTree = "<group>"; };
</span><span class="cx">          5C2EBE0325771A4C00D55B05 /* SerializedNFA.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SerializedNFA.cpp; sourceTree = "<group>"; };
</span><span class="cx">          5C39305D1AA0F6A90029C816 /* DFABytecode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DFABytecode.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -18613,11 +18616,11 @@
</span><span class="cx">          1A569CC40D7E2B60007C3983 /* bridge */ = {
</span><span class="cx">                  isa = PBXGroup;
</span><span class="cx">                  children = (
</span><ins>+                               1A569CE20D7E2B82007C3983 /* objc */,
</ins><span class="cx">                           599E758F11055A1F00D904FA /* Bridge.h */,
</span><span class="cx">                          1A71D5790F33819000F9CE4E /* IdentifierRep.cpp */,
</span><span class="cx">                          1A71D57A0F33819000F9CE4E /* IdentifierRep.h */,
</span><span class="cx">                          59B5977111086556007159E8 /* jsc */,
</span><del>-                               1A569CE20D7E2B82007C3983 /* objc */,
</del><span class="cx">                           1A569CEF0D7E2B82007C3983 /* runtime_array.cpp */,
</span><span class="cx">                          1A569CF00D7E2B82007C3983 /* runtime_array.h */,
</span><span class="cx">                          1A569CF10D7E2B82007C3983 /* runtime_method.cpp */,
</span><span class="lines">@@ -19289,6 +19292,8 @@
</span><span class="cx">                          26F0C89D1A2EC3BE002794F8 /* ContentExtensionsBackend.cpp */,
</span><span class="cx">                          26F0C89E1A2EC3BE002794F8 /* ContentExtensionsBackend.h */,
</span><span class="cx">                          262391351A648CEE007251A3 /* ContentExtensionsDebugging.h */,
</span><ins>+                               5C2C019B2734398E00F89D37 /* ContentExtensionStringSerialization.cpp */,
+                               5C2C01992734398E00F89D37 /* ContentExtensionStringSerialization.h */,
</ins><span class="cx">                           51FB67D91AE6B5E400D06C5A /* ContentExtensionStyleSheet.cpp */,
</span><span class="cx">                          51FB67DA1AE6B5E400D06C5A /* ContentExtensionStyleSheet.h */,
</span><span class="cx">                          5C9C2DB32241A67300996B0B /* ContentRuleListResults.h */,
</span><span class="lines">@@ -32102,6 +32107,7 @@
</span><span class="cx">                          26F0C89C1A2EC110002794F8 /* ContentExtensionRule.h in Headers */,
</span><span class="cx">                          26F0C8A01A2EC3BE002794F8 /* ContentExtensionsBackend.h in Headers */,
</span><span class="cx">                          262391361A648CEE007251A3 /* ContentExtensionsDebugging.h in Headers */,
</span><ins>+                               5C2C019C27343DDE00F89D37 /* ContentExtensionStringSerialization.h in Headers */,
</ins><span class="cx">                           51FB67DC1AE6B82F00D06C5A /* ContentExtensionStyleSheet.h in Headers */,
</span><span class="cx">                          A149786F1ABAF33800CEF7E4 /* ContentFilter.h in Headers */,
</span><span class="cx">                          5CDCDDC623D80A1C00BA34A1 /* ContentFilterClient.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtension.cpp (285349 => 285350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtension.cpp      2021-11-05 19:08:39 UTC (rev 285349)
+++ trunk/Source/WebCore/contentextensions/ContentExtension.cpp 2021-11-05 19:33:46 UTC (rev 285350)
</span><span class="lines">@@ -68,9 +68,10 @@
</span><span class="cx">     uint32_t actionsLength = m_compiledExtension->actionsLength();
</span><span class="cx">     uint32_t currentActionIndex = 0;
</span><span class="cx">     while (currentActionIndex < actionsLength) {
</span><del>-        if (Action::deserializeType(actions, actionsLength, currentActionIndex) == ActionType::IgnorePreviousRules)
</del><ins>+        RELEASE_ASSERT(currentActionIndex < actionsLength);
+        if (actions[currentActionIndex] == WTF::alternativeIndexV<IgnorePreviousRulesAction, ActionData>)
</ins><span class="cx">             return currentActionIndex;
</span><del>-        currentActionIndex += Action::serializedLength(actions, actionsLength, currentActionIndex);
</del><ins>+        currentActionIndex += DeserializedAction::serializedLength(actions, actionsLength, currentActionIndex);
</ins><span class="cx">     }
</span><span class="cx">     return std::numeric_limits<uint32_t>::max();
</span><span class="cx"> }
</span><span class="lines">@@ -87,9 +88,9 @@
</span><span class="cx">     auto* actions = m_compiledExtension->actions();
</span><span class="cx">     uint32_t actionsLength = m_compiledExtension->actionsLength();
</span><span class="cx"> 
</span><del>-    auto inGlobalDisplayNoneStyleSheet = [&](const uint32_t location)
-    {
-        return location < firstIgnorePreviousRules && Action::deserializeType(actions, actionsLength, location) == ActionType::CSSDisplayNoneSelector;
</del><ins>+    auto inGlobalDisplayNoneStyleSheet = [&](const uint32_t location) {
+        RELEASE_ASSERT(location < actionsLength);
+        return location < firstIgnorePreviousRules && actions[location] == WTF::alternativeIndexV<CSSDisplayNoneSelectorAction, ActionData>;
</ins><span class="cx">     };
</span><span class="cx">     
</span><span class="cx">     StringBuilder css;
</span><span class="lines">@@ -97,9 +98,10 @@
</span><span class="cx">         if (inGlobalDisplayNoneStyleSheet(universalActionLocation)) {
</span><span class="cx">             if (!css.isEmpty())
</span><span class="cx">                 css.append(',');
</span><del>-            Action action = Action::deserialize(actions, actionsLength, universalActionLocation);
-            ASSERT(action.type() == ActionType::CSSDisplayNoneSelector);
-            css.append(action.stringArgument());
</del><ins>+            auto action = DeserializedAction::deserialize(actions, actionsLength, universalActionLocation);
+            ASSERT(std::holds_alternative<CSSDisplayNoneSelectorAction>(action.data()));
+            if (auto* actionData = std::get_if<CSSDisplayNoneSelectorAction>(&action.data()))
+                css.append(actionData->string);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     if (css.isEmpty())
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionActionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionActions.h (285349 => 285350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionActions.h 2021-11-05 19:08:39 UTC (rev 285349)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionActions.h    2021-11-05 19:33:46 UTC (rev 285350)
</span><span class="lines">@@ -27,57 +27,47 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="cx"> 
</span><del>-#include <wtf/Vector.h>
-#include <wtf/text/WTFString.h>
</del><ins>+#include "ContentExtensionStringSerialization.h"
</ins><span class="cx"> 
</span><del>-namespace WebCore {
</del><ins>+namespace WebCore::ContentExtensions {
</ins><span class="cx"> 
</span><del>-class Page;
-class ResourceRequest;
-
-struct ContentRuleListResults;
-
-namespace ContentExtensions {
-
</del><span class="cx"> struct Action;
</span><span class="cx"> 
</span><span class="cx"> using SerializedActionByte = uint8_t;
</span><span class="cx"> 
</span><del>-enum class ActionType : uint8_t {
-    BlockLoad,
-    BlockCookies,
-    CSSDisplayNoneSelector,
-    Notify,
-    IgnorePreviousRules,
-    MakeHTTPS,
</del><ins>+template<typename T> struct ActionWithoutMetadata {
+    T isolatedCopy() const { return { }; }
+    bool operator==(const T&) const { return true; }
+    void serialize(Vector<uint8_t>&) const { }
+    static T deserialize(Span<const uint8_t>) { return { }; }
+    static size_t serializedLength(Span<const uint8_t>) { return 0; }
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-static inline bool hasStringArgument(ActionType actionType)
-{
-    switch (actionType) {
-    case ActionType::CSSDisplayNoneSelector:
-    case ActionType::Notify:
-        return true;
-    case ActionType::BlockLoad:
-    case ActionType::BlockCookies:
-    case ActionType::IgnorePreviousRules:
-    case ActionType::MakeHTTPS:
-        return false;
-    }
-    ASSERT_NOT_REACHED();
-    return false;
-}
-
-struct ActionsFromContentRuleList {
-    String contentRuleListIdentifier;
-    bool sawIgnorePreviousRules { false };
-    Vector<Action> actions;
</del><ins>+template<typename T> struct ActionWithStringMetadata {
+    const String string;
+    T isolatedCopy() const { return { { string.isolatedCopy() } }; }
+    bool operator==(const T& other) const { return other.string == this->string; }
+    void serialize(Vector<uint8_t>& vector) const { serializeString(vector, string); }
+    static T deserialize(Span<const uint8_t> span) { return { { deserializeString(span) } }; }
+    static size_t serializedLength(Span<const uint8_t> span) { return stringSerializedLength(span); }
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-WEBCORE_EXPORT void applyResultsToRequest(ContentRuleListResults&&, Page*, ResourceRequest&);
</del><ins>+struct BlockLoadAction : public ActionWithoutMetadata<BlockLoadAction> { };
+struct BlockCookiesAction : public ActionWithoutMetadata<BlockCookiesAction> { };
+struct CSSDisplayNoneSelectorAction : public ActionWithStringMetadata<CSSDisplayNoneSelectorAction> { };
+struct NotifyAction : public ActionWithStringMetadata<NotifyAction> { };
+struct IgnorePreviousRulesAction : public ActionWithoutMetadata<IgnorePreviousRulesAction> { };
+struct MakeHTTPSAction : public ActionWithoutMetadata<MakeHTTPSAction> { };
</ins><span class="cx"> 
</span><del>-} // namespace ContentExtensions
</del><ins>+using ActionData = std::variant<
+    BlockLoadAction,
+    BlockCookiesAction,
+    CSSDisplayNoneSelectorAction,
+    NotifyAction,
+    IgnorePreviousRulesAction,
+    MakeHTTPSAction
+>;
</ins><span class="cx"> 
</span><del>-} // namespace WebCore
</del><ins>+} // namespace WebCore::ContentExtensions
</ins><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(CONTENT_EXTENSIONS)
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionCompilercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionCompiler.cpp (285349 => 285350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionCompiler.cpp      2021-11-05 19:08:39 UTC (rev 285349)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionCompiler.cpp 2021-11-05 19:33:46 UTC (rev 285350)
</span><span class="lines">@@ -47,26 +47,6 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> namespace ContentExtensions {
</span><span class="cx"> 
</span><del>-static void serializeString(Vector<SerializedActionByte>& actions, const String& string)
-{
-    // Append Selector length (4 bytes).
-    uint32_t stringLength = string.length();
-    actions.grow(actions.size() + sizeof(uint32_t));
-    *reinterpret_cast<uint32_t*>(&actions[actions.size() - sizeof(uint32_t)]) = stringLength;
-    bool wideCharacters = !string.is8Bit();
-    actions.append(wideCharacters);
-    // Append Selector.
-    if (wideCharacters) {
-        uint32_t startIndex = actions.size();
-        actions.grow(actions.size() + sizeof(UChar) * stringLength);
-        for (uint32_t i = 0; i < stringLength; ++i)
-            *reinterpret_cast<UChar*>(&actions[startIndex + i * sizeof(UChar)]) = string[i];
-    } else {
-        for (uint32_t i = 0; i < stringLength; ++i)
-            actions.append(string[i]);
-    }
-}
-
</del><span class="cx"> // css-display-none combining is special because we combine the string arguments with commas because we know they are css selectors.
</span><span class="cx"> struct PendingDisplayNoneActions {
</span><span class="cx">     StringBuilder combinedSelectors;
</span><span class="lines">@@ -79,7 +59,7 @@
</span><span class="cx"> {
</span><span class="cx">     for (auto& pendingDisplayNoneActions : map.values()) {
</span><span class="cx">         uint32_t actionLocation = actions.size();
</span><del>-        actions.append(static_cast<SerializedActionByte>(ActionType::CSSDisplayNoneSelector));
</del><ins>+        actions.append(WTF::alternativeIndexV<CSSDisplayNoneSelectorAction, ActionData>);
</ins><span class="cx">         serializeString(actions, pendingDisplayNoneActions.combinedSelectors.toString());
</span><span class="cx">         for (uint32_t clientLocation : pendingDisplayNoneActions.clientLocations)
</span><span class="cx">             actionLocations[clientLocation] = actionLocation;
</span><span class="lines">@@ -105,9 +85,9 @@
</span><span class="cx"> 
</span><span class="cx">     for (unsigned ruleIndex = 0; ruleIndex < ruleList.size(); ++ruleIndex) {
</span><span class="cx">         const ContentExtensionRule& rule = ruleList[ruleIndex];
</span><del>-        ActionType actionType = rule.action().type();
</del><span class="cx"> 
</span><del>-        if (actionType == ActionType::IgnorePreviousRules) {
</del><ins>+        auto& actionData = rule.action().data();
+        if (std::holds_alternative<IgnorePreviousRulesAction>(actionData)) {
</ins><span class="cx">             resolvePendingDisplayNoneActions(actions, actionLocations, cssDisplayNoneActionsMap);
</span><span class="cx"> 
</span><span class="cx">             blockLoadActionsMap.clear();
</span><span class="lines">@@ -123,11 +103,10 @@
</span><span class="cx">         if (!rule.trigger().conditions.isEmpty()) {
</span><span class="cx">             actionLocations.append(actions.size());
</span><span class="cx"> 
</span><del>-            actions.append(static_cast<SerializedActionByte>(actionType));
-            if (hasStringArgument(actionType))
-                serializeString(actions, rule.action().stringArgument());
-            else
-                ASSERT(rule.action().stringArgument().isNull());
</del><ins>+            actions.append(actionData.index());
+            std::visit(WTF::makeVisitor([&](const auto& member) {
+                member.serialize(actions);
+            }), actionData);
</ins><span class="cx">             continue;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -138,53 +117,44 @@
</span><span class="cx">             const auto existingAction = map.find(flags);
</span><span class="cx">             if (existingAction == map.end()) {
</span><span class="cx">                 actionLocation = actions.size();
</span><del>-                actions.append(static_cast<SerializedActionByte>(actionType));
</del><ins>+                actions.append(actionData.index());
</ins><span class="cx">                 map.set(flags, actionLocation);
</span><span class="cx">             } else
</span><span class="cx">                 actionLocation = existingAction->value;
</span><span class="cx">         };
</span><span class="cx">         
</span><del>-        auto findOrMakeStringActionLocation = [&] (StringActionMap& map) {
-            const String& argument = rule.action().stringArgument();
-            auto existingAction = map.find(std::make_pair(argument, flags));
</del><ins>+        auto findOrMakeStringActionLocation = [&] (StringActionMap& map, const NotifyAction& actionData) {
+            const String& notification = actionData.string;
+            auto existingAction = map.find(std::make_pair(notification, flags));
</ins><span class="cx">             if (existingAction == map.end()) {
</span><span class="cx">                 actionLocation = actions.size();
</span><del>-                actions.append(static_cast<SerializedActionByte>(actionType));
-                serializeString(actions, argument);
-                map.set(std::make_pair(argument, flags), actionLocation);
</del><ins>+                actions.append(WTF::alternativeIndexV<NotifyAction, ActionData>);
+                serializeString(actions, notification);
+                map.set(std::make_pair(notification, flags), actionLocation);
</ins><span class="cx">             } else
</span><span class="cx">                 actionLocation = existingAction->value;
</span><span class="cx">         };
</span><del>-
-        switch (actionType) {
-        case ActionType::CSSDisplayNoneSelector: {
</del><ins>+        
+        std::visit(WTF::makeVisitor([&] (const CSSDisplayNoneSelectorAction& actionData) {
</ins><span class="cx">             const auto addResult = cssDisplayNoneActionsMap.add(rule.trigger(), PendingDisplayNoneActions());
</span><span class="cx">             auto& pendingStringActions = addResult.iterator->value;
</span><span class="cx">             if (!pendingStringActions.combinedSelectors.isEmpty())
</span><span class="cx">                 pendingStringActions.combinedSelectors.append(',');
</span><del>-            pendingStringActions.combinedSelectors.append(rule.action().stringArgument());
</del><ins>+            pendingStringActions.combinedSelectors.append(actionData.string);
</ins><span class="cx">             pendingStringActions.clientLocations.append(actionLocations.size());
</span><span class="cx"> 
</span><span class="cx">             actionLocation = std::numeric_limits<unsigned>::max();
</span><del>-            break;
-        }
-        case ActionType::IgnorePreviousRules:
</del><ins>+        }, [&] (const IgnorePreviousRulesAction&) {
</ins><span class="cx">             findOrMakeActionLocation(ignorePreviousRuleActionsMap);
</span><del>-            break;
-        case ActionType::BlockLoad:
</del><ins>+        }, [&] (const BlockLoadAction&) {
</ins><span class="cx">             findOrMakeActionLocation(blockLoadActionsMap);
</span><del>-            break;
-        case ActionType::BlockCookies:
</del><ins>+        }, [&] (const BlockCookiesAction&) {
</ins><span class="cx">             findOrMakeActionLocation(blockCookiesActionsMap);
</span><del>-            break;
-        case ActionType::MakeHTTPS:
</del><ins>+        }, [&] (const MakeHTTPSAction&) {
</ins><span class="cx">             findOrMakeActionLocation(makeHTTPSActionsMap);
</span><del>-            break;
-        case ActionType::Notify:
-            findOrMakeStringActionLocation(notifyActionsMap);
-            break;
-        }
-
</del><ins>+        }, [&] (const NotifyAction& actionData) {
+            findOrMakeStringActionLocation(notifyActionsMap, actionData);
+        }), actionData);
</ins><span class="cx">         actionLocations.append(actionLocation);
</span><span class="cx">     }
</span><span class="cx">     resolvePendingDisplayNoneActions(actions, actionLocations, cssDisplayNoneActionsMap);
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionParser.cpp (285349 => 285350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionParser.cpp        2021-11-05 19:08:39 UTC (rev 285349)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionParser.cpp   2021-11-05 19:33:46 UTC (rev 285350)
</span><span class="lines">@@ -187,11 +187,11 @@
</span><span class="cx">     String actionType = actionObject->getString("type");
</span><span class="cx"> 
</span><span class="cx">     if (actionType == "block")
</span><del>-        return { Action(ActionType::BlockLoad) };
</del><ins>+        return { Action(BlockLoadAction()) };
</ins><span class="cx">     if (actionType == "ignore-previous-rules")
</span><del>-        return { Action(ActionType::IgnorePreviousRules) };
</del><ins>+        return { Action(IgnorePreviousRulesAction()) };
</ins><span class="cx">     if (actionType == "block-cookies")
</span><del>-        return { Action(ActionType::BlockCookies) };
</del><ins>+        return { Action(BlockCookiesAction()) };
</ins><span class="cx">     if (actionType == "css-display-none") {
</span><span class="cx">         String selectorString = actionObject->getString("selector");
</span><span class="cx">         if (!selectorString)
</span><span class="lines">@@ -200,15 +200,15 @@
</span><span class="cx">             // Skip rules with invalid selectors to be backwards-compatible.
</span><span class="cx">             return { std::nullopt };
</span><span class="cx">         }
</span><del>-        return { Action(ActionType::CSSDisplayNoneSelector, WTFMove(selectorString)) };
</del><ins>+        return { Action { CSSDisplayNoneSelectorAction { { WTFMove(selectorString) } } } };
</ins><span class="cx">     }
</span><span class="cx">     if (actionType == "make-https")
</span><del>-        return { Action(ActionType::MakeHTTPS) };
</del><ins>+        return { Action(MakeHTTPSAction()) };
</ins><span class="cx">     if (actionType == "notify") {
</span><span class="cx">         String notification = actionObject->getString("notification");
</span><span class="cx">         if (!notification)
</span><span class="cx">             return makeUnexpected(ContentExtensionError::JSONInvalidNotification);
</span><del>-        return { Action(ActionType::Notify, WTFMove(notification)) };
</del><ins>+        return { Action { NotifyAction { { WTFMove(notification) } } } };
</ins><span class="cx">     }
</span><span class="cx">     return makeUnexpected(ContentExtensionError::JSONInvalidActionType);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionRulecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionRule.cpp (285349 => 285350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionRule.cpp  2021-11-05 19:08:39 UTC (rev 285349)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionRule.cpp     2021-11-05 19:33:46 UTC (rev 285350)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "ContentExtensionRule.h"
</span><span class="cx"> 
</span><ins>+#include <wtf/CrossThreadCopier.h>
+
</ins><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -39,78 +41,60 @@
</span><span class="cx">     ASSERT(!m_trigger.urlFilter.isEmpty());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static String deserializeString(const SerializedActionByte* actions, const uint32_t actionsLength, uint32_t beginIndex)
-{
-    uint32_t prefixLength = sizeof(uint32_t) + sizeof(bool);
-    uint32_t stringStartIndex = beginIndex + prefixLength;
-    RELEASE_ASSERT(actionsLength >= stringStartIndex);
-    uint32_t stringLength = *reinterpret_cast<const uint32_t*>(&actions[beginIndex]);
-    bool wideCharacters = actions[beginIndex + sizeof(uint32_t)];
</del><ins>+template<size_t index, typename... Types>
+struct VariantDeserializerHelper {
+    using VariantType = typename std::variant_alternative<index, std::variant<Types...>>::type;
+    static std::variant<Types...> deserialize(Span<const uint8_t> span, size_t i)
+    {
+        if (i == index)
+            return VariantType::deserialize(span);
+        return VariantDeserializerHelper<index - 1, Types...>::deserialize(span, i);
+    }
+    static size_t serializedLength(Span<const uint8_t> span, size_t i)
+    {
+        if (i == index)
+            return VariantType::serializedLength(span);
+        return VariantDeserializerHelper<index - 1, Types...>::serializedLength(span, i);
+    }
+};
</ins><span class="cx"> 
</span><del>-    if (wideCharacters) {
-        RELEASE_ASSERT(actionsLength >= stringStartIndex + stringLength * sizeof(UChar));
-        return String(reinterpret_cast<const UChar*>(&actions[stringStartIndex]), stringLength);
</del><ins>+template<typename... Types>
+struct VariantDeserializerHelper<0, Types...> {
+    using VariantType = typename std::variant_alternative<0, std::variant<Types...>>::type;
+    static std::variant<Types...> deserialize(Span<const uint8_t> span, size_t i)
+    {
+        ASSERT_UNUSED(i, !i);
+        return VariantType::deserialize(span);
</ins><span class="cx">     }
</span><del>-    RELEASE_ASSERT(actionsLength >= stringStartIndex + stringLength * sizeof(LChar));
-    return String(reinterpret_cast<const LChar*>(&actions[stringStartIndex]), stringLength);
-}
</del><ins>+    static size_t serializedLength(Span<const uint8_t> span, size_t i)
+    {
+        ASSERT_UNUSED(i, !i);
+        return VariantType::serializedLength(span);
+    }
+};
</ins><span class="cx"> 
</span><del>-Action Action::deserialize(const SerializedActionByte* actions, const uint32_t actionsLength, uint32_t location)
-{
-    RELEASE_ASSERT(location < actionsLength);
-    auto actionType = static_cast<ActionType>(actions[location]);
-    switch (actionType) {
-    case ActionType::BlockCookies:
-    case ActionType::BlockLoad:
-    case ActionType::IgnorePreviousRules:
-    case ActionType::MakeHTTPS:
-        return Action(actionType, location);
-    case ActionType::CSSDisplayNoneSelector:
-    case ActionType::Notify:
-        return Action(actionType, deserializeString(actions, actionsLength, location + sizeof(ActionType)), location);
</del><ins>+template<typename T> struct VariantDeserializer;
+template<typename... Types> struct VariantDeserializer<std::variant<Types...>> {
+    static std::variant<Types...> deserialize(Span<const uint8_t> span, size_t i)
+    {
+        return VariantDeserializerHelper<sizeof...(Types) - 1, Types...>::deserialize(span, i);
</ins><span class="cx">     }
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
-}
-    
-ActionType Action::deserializeType(const SerializedActionByte* actions, const uint32_t actionsLength, uint32_t location)
</del><ins>+    static size_t serializedLength(Span<const uint8_t> span, size_t i)
+    {
+        return VariantDeserializerHelper<sizeof...(Types) - 1, Types...>::serializedLength(span, i);
+    }
+};
+
+DeserializedAction DeserializedAction::deserialize(const SerializedActionByte* actions, const uint32_t actionsLength, uint32_t location)
</ins><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT(location < actionsLength);
</span><del>-    ActionType type = static_cast<ActionType>(actions[location]);
-    switch (type) {
-    case ActionType::BlockCookies:
-    case ActionType::BlockLoad:
-    case ActionType::Notify:
-    case ActionType::IgnorePreviousRules:
-    case ActionType::CSSDisplayNoneSelector:
-    case ActionType::MakeHTTPS:
-        return type;
-    }
-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    return { location, VariantDeserializer<ActionData>::deserialize({ actions + location + 1, actionsLength - location - 1 }, actions[location]) };
</ins><span class="cx"> }
</span><del>-    
-uint32_t Action::serializedLength(const SerializedActionByte* actions, const uint32_t actionsLength, uint32_t location)
</del><ins>+
+size_t DeserializedAction::serializedLength(const SerializedActionByte* actions, const uint32_t actionsLength, uint32_t location)
</ins><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT(location < actionsLength);
</span><del>-    switch (static_cast<ActionType>(actions[location])) {
-    case ActionType::BlockCookies:
-    case ActionType::BlockLoad:
-    case ActionType::IgnorePreviousRules:
-    case ActionType::MakeHTTPS:
-        return sizeof(ActionType);
-    case ActionType::Notify:
-    case ActionType::CSSDisplayNoneSelector: {
-        uint32_t prefixLength = sizeof(ActionType) + sizeof(uint32_t) + sizeof(bool);
-        uint32_t stringStartIndex = location + prefixLength;
-        RELEASE_ASSERT(actionsLength >= stringStartIndex);
-        uint32_t stringLength = *reinterpret_cast<const unsigned*>(&actions[location + sizeof(ActionType)]);
-        bool wideCharacters = actions[location + sizeof(ActionType) + sizeof(uint32_t)];
-        
-        if (wideCharacters)
-            return prefixLength + stringLength * sizeof(UChar);
-        return prefixLength + stringLength * sizeof(LChar);
-    }
-    }
-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    return 1 + VariantDeserializer<ActionData>::serializedLength({ actions + location + 1, actionsLength - location - 1 }, actions[location]);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Trigger Trigger::isolatedCopy() const
</span><span class="lines">@@ -127,18 +111,7 @@
</span><span class="cx"> 
</span><span class="cx"> Action Action::isolatedCopy() const
</span><span class="cx"> {
</span><del>-    if (hasStringArgument(m_type)) {
-        return {
-            m_type,
-            m_stringArgument.isolatedCopy(),
-            m_actionID
-        };
-    } else {
-        return {
-            m_type,
-            m_actionID
-        };
-    }
</del><ins>+    return { crossThreadCopy(m_data) };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace ContentExtensions
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionRuleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionRule.h (285349 => 285350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionRule.h    2021-11-05 19:08:39 UTC (rev 285349)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionRule.h       2021-11-05 19:33:46 UTC (rev 285350)
</span><span class="lines">@@ -53,8 +53,7 @@
</span><span class="cx">         UnlessDomain,
</span><span class="cx">         IfTopURL,
</span><span class="cx">         UnlessTopURL,
</span><del>-    };
-    ConditionType conditionType { ConditionType::None };
</del><ins>+    } conditionType { ConditionType::None };
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT Trigger isolatedCopy() const;
</span><span class="cx">     
</span><span class="lines">@@ -99,8 +98,8 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> struct TriggerHashTraits : public WTF::CustomHashTraits<Trigger> {
</span><del>-    static const bool emptyValueIsZero = false;
-    static const bool hasIsEmptyValueFunction = true;
</del><ins>+    static constexpr bool emptyValueIsZero = false;
+    static constexpr bool hasIsEmptyValueFunction = true;
</ins><span class="cx"> 
</span><span class="cx">     static void constructDeletedValue(Trigger& trigger)
</span><span class="cx">     {
</span><span class="lines">@@ -124,45 +123,34 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> struct Action {
</span><del>-    Action(ActionType type, const String& stringArgument, uint32_t actionID = std::numeric_limits<uint32_t>::max())
-        : m_type(type)
-        , m_actionID(actionID)
-        , m_stringArgument(stringArgument)
-    {
-        ASSERT(hasStringArgument(type));
-    }
</del><ins>+    Action(ActionData&& data)
+        : m_data(WTFMove(data)) { }
</ins><span class="cx"> 
</span><del>-    Action(ActionType type, uint32_t actionID = std::numeric_limits<uint32_t>::max())
-        : m_type(type)
-        , m_actionID(actionID)
-    {
-        ASSERT(!hasStringArgument(type));
-    }
-    Action(Action&&) = default;
</del><ins>+    bool operator==(const Action& other) const { return m_data == other.m_data; }
+    bool operator!=(const Action& other) const { return !(*this == other); }
</ins><span class="cx"> 
</span><del>-    bool operator==(const Action& other) const
-    {
-        return m_type == other.m_type
-            && m_actionID == other.m_actionID
-            && m_stringArgument == other.m_stringArgument;
-    }
</del><ins>+    const ActionData& data() const { return m_data; }
</ins><span class="cx"> 
</span><del>-    static Action deserialize(const SerializedActionByte* actions, const uint32_t actionsLength, uint32_t location);
-    static ActionType deserializeType(const SerializedActionByte* actions, const uint32_t actionsLength, uint32_t location);
-    static uint32_t serializedLength(const SerializedActionByte* actions, const uint32_t actionsLength, uint32_t location);
</del><ins>+    WEBCORE_EXPORT Action isolatedCopy() const;
</ins><span class="cx"> 
</span><del>-    ActionType type() const { return m_type; }
</del><ins>+private:
+    const ActionData m_data;
+};
+
+struct DeserializedAction : public Action {
+    static DeserializedAction deserialize(const SerializedActionByte* actions, const uint32_t actionsLength, uint32_t location);
+    static size_t serializedLength(const SerializedActionByte* actions, const uint32_t actionsLength, uint32_t location);
+
</ins><span class="cx">     uint32_t actionID() const { return m_actionID; }
</span><del>-    const String& stringArgument() const { return m_stringArgument; }
</del><span class="cx"> 
</span><del>-    WEBCORE_EXPORT Action isolatedCopy() const;
-    
</del><span class="cx"> private:
</span><del>-    ActionType m_type;
-    uint32_t m_actionID;
-    String m_stringArgument;
</del><ins>+    DeserializedAction(uint32_t actionID, ActionData&& data)
+        : Action(WTFMove(data))
+        , m_actionID(actionID) { }
+
+    const uint32_t m_actionID;
</ins><span class="cx"> };
</span><del>-    
</del><ins>+
</ins><span class="cx"> class ContentExtensionRule {
</span><span class="cx"> public:
</span><span class="cx">     WEBCORE_EXPORT ContentExtensionRule(Trigger&&, Action&&);
</span><span class="lines">@@ -180,8 +168,8 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    Trigger m_trigger;
-    Action m_action;
</del><ins>+    const Trigger m_trigger;
+    const Action m_action;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace ContentExtensions
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionStringSerializationcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/contentextensions/ContentExtensionStringSerialization.cpp (0 => 285350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionStringSerialization.cpp                           (rev 0)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionStringSerialization.cpp      2021-11-05 19:33:46 UTC (rev 285350)
</span><span class="lines">@@ -0,0 +1,84 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ContentExtensionStringSerialization.h"
+
+#if ENABLE(CONTENT_EXTENSIONS)
+
+namespace WebCore::ContentExtensions {
+
+String deserializeString(Span<const uint8_t> span)
+{
+    const auto* actions = span.data();
+    const auto actionsLength = span.size();
+    auto prefixLength = sizeof(uint32_t) + sizeof(bool);
+    auto stringStartIndex = prefixLength;
+    RELEASE_ASSERT(actionsLength >= stringStartIndex);
+    uint32_t stringLength = *reinterpret_cast<const uint32_t*>(actions);
+    bool wideCharacters = actions[sizeof(uint32_t)];
+
+    if (wideCharacters) {
+        RELEASE_ASSERT(actionsLength >= stringStartIndex + stringLength * sizeof(UChar));
+        return String(reinterpret_cast<const UChar*>(&actions[stringStartIndex]), stringLength);
+    }
+    RELEASE_ASSERT(actionsLength >= stringStartIndex + stringLength * sizeof(LChar));
+    return String(reinterpret_cast<const LChar*>(&actions[stringStartIndex]), stringLength);
+}
+
+void serializeString(Vector<uint8_t>& actions, const String& string)
+{
+    // Append Selector length (4 bytes).
+    uint32_t stringLength = string.length();
+    actions.grow(actions.size() + sizeof(uint32_t));
+    *reinterpret_cast<uint32_t*>(&actions[actions.size() - sizeof(uint32_t)]) = stringLength;
+    bool wideCharacters = !string.is8Bit();
+    actions.append(wideCharacters);
+    // Append Selector.
+    if (wideCharacters) {
+        uint32_t startIndex = actions.size();
+        actions.grow(actions.size() + sizeof(UChar) * stringLength);
+        for (uint32_t i = 0; i < stringLength; ++i)
+            *reinterpret_cast<UChar*>(&actions[startIndex + i * sizeof(UChar)]) = string[i];
+    } else {
+        for (uint32_t i = 0; i < stringLength; ++i)
+            actions.append(string[i]);
+    }
+}
+
+size_t stringSerializedLength(Span<const uint8_t> span)
+{
+    constexpr auto prefixLength = sizeof(uint32_t) + sizeof(bool);
+    RELEASE_ASSERT(span.size() >= prefixLength);
+    auto stringLength = *reinterpret_cast<const uint32_t*>(span.data());
+    bool wideCharacters = span[sizeof(uint32_t)];
+    if (wideCharacters)
+        return prefixLength + stringLength * sizeof(UChar);
+    return prefixLength + stringLength * sizeof(LChar);
+}
+
+} // namespace WebCore::ContentExtensions
+
+#endif // ENABLE(CONTENT_EXTENSIONS)
</ins></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionStringSerializationhfromrev285349trunkSourceWebCorecontentextensionsContentExtensionActionsh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/contentextensions/ContentExtensionStringSerialization.h (from rev 285349, trunk/Source/WebCore/contentextensions/ContentExtensionActions.h) (0 => 285350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionStringSerialization.h                             (rev 0)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionStringSerialization.h        2021-11-05 19:33:46 UTC (rev 285350)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(CONTENT_EXTENSIONS)
+
+#include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore::ContentExtensions {
+
+void serializeString(Vector<uint8_t>&, const String&);
+String deserializeString(Span<const uint8_t>);
+size_t stringSerializedLength(Span<const uint8_t>);
+
+} // namespace WebCore::ContentExtensions
+
+#endif // ENABLE(CONTENT_EXTENSIONS)
</ins></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionsBackendcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp (285349 => 285350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp      2021-11-05 19:08:39 UTC (rev 285349)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp 2021-11-05 19:33:46 UTC (rev 285350)
</span><span class="lines">@@ -148,8 +148,8 @@
</span><span class="cx"> 
</span><span class="cx">             // Add actions in reverse order to properly deal with IgnorePreviousRules.
</span><span class="cx">             for (unsigned i = actionLocations.size(); i; i--) {
</span><del>-                Action action = Action::deserialize(actions, actionsLength, actionLocations[i - 1]);
-                if (action.type() == ActionType::IgnorePreviousRules) {
</del><ins>+                auto action = DeserializedAction::deserialize(actions, actionsLength, actionLocations[i - 1]);
+                if (std::holds_alternative<IgnorePreviousRulesAction>(action.data())) {
</ins><span class="cx">                     actionsStruct.sawIgnorePreviousRules = true;
</span><span class="cx">                     break;
</span><span class="cx">                 }
</span><span class="lines">@@ -206,36 +206,29 @@
</span><span class="cx">         const String& contentRuleListIdentifier = actionsFromContentRuleList.contentRuleListIdentifier;
</span><span class="cx">         ContentRuleListResults::Result result;
</span><span class="cx">         for (const auto& action : actionsFromContentRuleList.actions) {
</span><del>-            switch (action.type()) {
-            case ContentExtensions::ActionType::BlockLoad:
</del><ins>+            std::visit(WTF::makeVisitor([&](const BlockLoadAction&) {
</ins><span class="cx">                 results.summary.blockedLoad = true;
</span><span class="cx">                 result.blockedLoad = true;
</span><del>-                break;
-            case ContentExtensions::ActionType::BlockCookies:
</del><ins>+            }, [&](const BlockCookiesAction&) {
</ins><span class="cx">                 results.summary.blockedCookies = true;
</span><span class="cx">                 result.blockedCookies = true;
</span><del>-                break;
-            case ContentExtensions::ActionType::CSSDisplayNoneSelector:
</del><ins>+            }, [&](const CSSDisplayNoneSelectorAction& actionData) {
</ins><span class="cx">                 if (resourceType == ResourceType::Document)
</span><del>-                    initiatingDocumentLoader.addPendingContentExtensionDisplayNoneSelector(contentRuleListIdentifier, action.stringArgument(), action.actionID());
</del><ins>+                    initiatingDocumentLoader.addPendingContentExtensionDisplayNoneSelector(contentRuleListIdentifier, actionData.string, action.actionID());
</ins><span class="cx">                 else if (currentDocument)
</span><del>-                    currentDocument->extensionStyleSheets().addDisplayNoneSelector(contentRuleListIdentifier, action.stringArgument(), action.actionID());
-                break;
-            case ContentExtensions::ActionType::Notify:
</del><ins>+                    currentDocument->extensionStyleSheets().addDisplayNoneSelector(contentRuleListIdentifier, actionData.string, action.actionID());
+            }, [&](const NotifyAction& actionData) {
</ins><span class="cx">                 results.summary.hasNotifications = true;
</span><del>-                result.notifications.append(action.stringArgument());
-                break;
-            case ContentExtensions::ActionType::MakeHTTPS: {
</del><ins>+                result.notifications.append(actionData.string);
+            }, [&](const MakeHTTPSAction&) {
</ins><span class="cx">                 if ((url.protocolIs("http") || url.protocolIs("ws"))
</span><span class="cx">                     && (!url.port() || WTF::isDefaultPortForProtocol(url.port().value(), url.protocol()))) {
</span><span class="cx">                     results.summary.madeHTTPS = true;
</span><span class="cx">                     result.madeHTTPS = true;
</span><span class="cx">                 }
</span><del>-                break;
-            }
-            case ContentExtensions::ActionType::IgnorePreviousRules:
</del><ins>+            }, [&](const IgnorePreviousRulesAction&) {
</ins><span class="cx">                 RELEASE_ASSERT_NOT_REACHED();
</span><del>-            }
</del><ins>+            }), action.data());
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (!actionsFromContentRuleList.sawIgnorePreviousRules) {
</span><span class="lines">@@ -282,24 +275,19 @@
</span><span class="cx">     makeSecureIfNecessary(results, url);
</span><span class="cx">     for (const auto& actionsFromContentRuleList : actions) {
</span><span class="cx">         for (const auto& action : actionsFromContentRuleList.actions) {
</span><del>-            switch (action.type()) {
-            case ContentExtensions::ActionType::BlockLoad:
</del><ins>+            std::visit(WTF::makeVisitor([&](const BlockLoadAction&) {
</ins><span class="cx">                 results.summary.blockedLoad = true;
</span><del>-                break;
-            case ContentExtensions::ActionType::BlockCookies:
</del><ins>+            }, [&](const BlockCookiesAction&) {
</ins><span class="cx">                 results.summary.blockedCookies = true;
</span><del>-                break;
-            case ContentExtensions::ActionType::MakeHTTPS:
</del><ins>+            }, [&](const CSSDisplayNoneSelectorAction&) {
+            }, [&](const NotifyAction&) {
+                // We currently have not implemented notifications from the NetworkProcess to the UIProcess.
+            }, [&](const MakeHTTPSAction&) {
</ins><span class="cx">                 if ((url.protocolIs("http") || url.protocolIs("ws")) && (!url.port() || WTF::isDefaultPortForProtocol(url.port().value(), url.protocol())))
</span><span class="cx">                     results.summary.madeHTTPS = true;
</span><del>-                break;
-            case ContentExtensions::ActionType::CSSDisplayNoneSelector:
-            case ContentExtensions::ActionType::Notify:
-                // We currently have not implemented notifications from the NetworkProcess to the UIProcess.
-                break;
-            case ContentExtensions::ActionType::IgnorePreviousRules:
</del><ins>+            }, [&](const IgnorePreviousRulesAction&) {
</ins><span class="cx">                 RELEASE_ASSERT_NOT_REACHED();
</span><del>-            }
</del><ins>+            }), action.data());
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionsBackendh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.h (285349 => 285350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.h        2021-11-05 19:08:39 UTC (rev 285349)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.h   2021-11-05 19:33:46 UTC (rev 285350)
</span><span class="lines">@@ -36,7 +36,9 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class DocumentLoader;
</span><ins>+class Page;
</ins><span class="cx"> class ResourceRequest;
</span><ins>+struct ContentRuleListResults;
</ins><span class="cx"> 
</span><span class="cx"> namespace ContentExtensions {
</span><span class="cx"> 
</span><span class="lines">@@ -60,6 +62,11 @@
</span><span class="cx">     WEBCORE_EXPORT void removeAllContentExtensions();
</span><span class="cx"> 
</span><span class="cx">     // - Internal WebCore Interface.
</span><ins>+    struct ActionsFromContentRuleList {
+        String contentRuleListIdentifier;
+        bool sawIgnorePreviousRules { false };
+        Vector<DeserializedAction> actions;
+    };
</ins><span class="cx">     WEBCORE_EXPORT Vector<ActionsFromContentRuleList> actionsForResourceLoad(const ResourceLoadInfo&) const;
</span><span class="cx">     WEBCORE_EXPORT StyleSheetContents* globalDisplayNoneStyleSheet(const String& identifier) const;
</span><span class="cx"> 
</span><span class="lines">@@ -76,6 +83,8 @@
</span><span class="cx">     HashMap<String, Ref<ContentExtension>> m_contentExtensions;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+WEBCORE_EXPORT void applyResultsToRequest(ContentRuleListResults&&, Page*, ResourceRequest&);
+
</ins><span class="cx"> } // namespace ContentExtensions
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResourceRequest.cpp (285349 => 285350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResourceRequest.cpp      2021-11-05 19:08:39 UTC (rev 285349)
+++ trunk/Source/WebCore/loader/cache/CachedResourceRequest.cpp 2021-11-05 19:33:46 UTC (rev 285350)
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx"> #include "CachedResourceRequest.h"
</span><span class="cx"> 
</span><span class="cx"> #include "CachedResourceLoader.h"
</span><del>-#include "ContentExtensionActions.h"
</del><ins>+#include "ContentExtensionsBackend.h"
</ins><span class="cx"> #include "CrossOriginAccessControl.h"
</span><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "Element.h"
</span></span></pre></div>
<a id="trunkSourceWebCorepageUserContentProviderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/UserContentProvider.h (285349 => 285350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/UserContentProvider.h  2021-11-05 19:08:39 UTC (rev 285349)
+++ trunk/Source/WebCore/page/UserContentProvider.h     2021-11-05 19:33:46 UTC (rev 285350)
</span><span class="lines">@@ -32,8 +32,8 @@
</span><span class="cx"> #include <wtf/WeakPtr.h>
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-#include "ContentExtensionActions.h"
</del><span class="cx"> #include "ContentExtensionsBackend.h"
</span><ins>+#include "ContentRuleListResults.h"
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkLoadCheckerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkLoadChecker.h (285349 => 285350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkLoadChecker.h  2021-11-05 19:08:39 UTC (rev 285349)
+++ trunk/Source/WebKit/NetworkProcess/NetworkLoadChecker.h     2021-11-05 19:33:46 UTC (rev 285350)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> class ContentSecurityPolicy;
</span><ins>+struct ContentRuleListResults;
</ins><span class="cx"> struct ContentSecurityPolicyClient;
</span><span class="cx"> class SecurityOrigin;
</span><span class="cx"> enum class PreflightPolicy : uint8_t;
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (285349 => 285350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2021-11-05 19:08:39 UTC (rev 285349)
+++ trunk/Tools/ChangeLog       2021-11-05 19:33:46 UTC (rev 285350)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2021-11-05  Alex Christensen  <achristensen@webkit.org>
+
+        Restructure WKContentRuleList Action storage during compilation and interpretation
+        https://bugs.webkit.org/show_bug.cgi?id=232692
+
+        Reviewed by Brady Eidson.
+
+        * TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
+        (TestWebKitAPI::testRequest):
+        (TestWebKitAPI::TEST_F):
+        (TestWebKitAPI::actionsEqual):
+        (WebCore::ContentExtensions::operator<<): Deleted.
+
</ins><span class="cx"> 2021-11-05  Tim Horton  <timothy_horton@apple.com>
</span><span class="cx"> 
</span><span class="cx">         generate-xcfilelists doesn't work if build path contains a `+`
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (285349 => 285350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2021-11-05 19:08:39 UTC (rev 285349)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj   2021-11-05 19:33:46 UTC (rev 285350)
</span><span class="lines">@@ -496,6 +496,7 @@
</span><span class="cx">          5C23DF0B2246015800F454B6 /* Challenge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C23DF0A2245C9D700F454B6 /* Challenge.mm */; };
</span><span class="cx">          5C2936931D5BF70D00DEAB1E /* CookieAcceptPolicy.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C2936911D5BF63E00DEAB1E /* CookieAcceptPolicy.mm */; };
</span><span class="cx">          5C2936961D5C00ED00DEAB1E /* CookieMessage.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 5C2936941D5BFD1900DEAB1E /* CookieMessage.html */; };
</span><ins>+               5C2C01A82734883600F89D37 /* CrossThreadCopier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 278DE64B22B8D611004E0E7A /* CrossThreadCopier.cpp */; };
</ins><span class="cx">           5C3A77AA22F20BEA003827FF /* UploadDirectory.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C3A77A922F20B8A003827FF /* UploadDirectory.mm */; };
</span><span class="cx">          5C3B1D2622A74F6700BCF4D0 /* ContextMenus.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C3B1D2522A74EA400BCF4D0 /* ContextMenus.mm */; };
</span><span class="cx">          5C4259462266A68A0039AA7A /* BasicProposedCredentialPlugIn.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C42594422669E9B0039AA7A /* BasicProposedCredentialPlugIn.mm */; };
</span><span class="lines">@@ -1389,7 +1390,6 @@
</span><span class="cx">                  dstPath = TestWebKitAPI.resources;
</span><span class="cx">                  dstSubfolderSpec = 7;
</span><span class="cx">                  files = (
</span><del>-                               49D2E5C22731E3BC00BCCAED /* file-with-iframe.html in Copy Resources */,
</del><span class="cx">                           55A817FF2181021A0004A39A /* 100x100-red.tga in Copy Resources */,
</span><span class="cx">                          1A9E52C913E65EF4006917F5 /* 18-characters.html in Copy Resources */,
</span><span class="cx">                          55A81800218102210004A39A /* 400x400-green.png in Copy Resources */,
</span><span class="lines">@@ -1516,6 +1516,7 @@
</span><span class="cx">                          CDA29B2B20FD358400F15CED /* ExitFullscreenOnEnterPiP.html in Copy Resources */,
</span><span class="cx">                          F41AB9A31EF4696B0083FA08 /* file-uploading.html in Copy Resources */,
</span><span class="cx">                          BC2D006412AA04CE00E732A3 /* file-with-anchor.html in Copy Resources */,
</span><ins>+                               49D2E5C22731E3BC00BCCAED /* file-with-iframe.html in Copy Resources */,
</ins><span class="cx">                           CD59F53419E9110D00CF1835 /* file-with-mse.html in Copy Resources */,
</span><span class="cx">                          524BBC9E19DF72C0002F1AF1 /* file-with-video.html in Copy Resources */,
</span><span class="cx">                          1A02C870125D4CFD00E3F4BD /* find.html in Copy Resources */,
</span><span class="lines">@@ -4104,6 +4105,7 @@
</span><span class="cx">                          7283A9D122FB1D9700B21C7D /* exif-orientation-8-llo.jpg */,
</span><span class="cx">                          CDA29B2A20FD344E00F15CED /* ExitFullscreenOnEnterPiP.html */,
</span><span class="cx">                          F41AB99B1EF4692C0083FA08 /* file-uploading.html */,
</span><ins>+                               49D2E5C12731E37400BCCAED /* file-with-iframe.html */,
</ins><span class="cx">                           A17EAC542083056E0084B41B /* find.pdf */,
</span><span class="cx">                          F43E3BC020DADB8000A4E7ED /* fixed-nav-bar.html */,
</span><span class="cx">                          93575C551D30366E000D604D /* focus-inputs.html */,
</span><span class="lines">@@ -4289,7 +4291,6 @@
</span><span class="cx">                          51714EB31CF8C761004723C4 /* WebProcessKillIDBCleanup-2.html */,
</span><span class="cx">                          5120C83B1E674E350025B250 /* WebsiteDataStoreCustomPaths.html */,
</span><span class="cx">                          2E131C171D83A97E001BA36C /* wide-autoplaying-video-with-audio.html */,
</span><del>-                               49D2E5C12731E37400BCCAED /* file-with-iframe.html */,
</del><span class="cx">                   );
</span><span class="cx">                  name = Resources;
</span><span class="cx">                  sourceTree = "<group>";
</span><span class="lines">@@ -5327,6 +5328,7 @@
</span><span class="cx">                          0F30CB5C1FCE1796004B5323 /* ConcurrentPtrHashSet.cpp in Sources */,
</span><span class="cx">                          7C83DEC31D0A590C00FEBCF3 /* Condition.cpp in Sources */,
</span><span class="cx">                          7C83DEA61D0A590C00FEBCF3 /* Counters.cpp in Sources */,
</span><ins>+                               5C2C01A82734883600F89D37 /* CrossThreadCopier.cpp in Sources */,
</ins><span class="cx">                           7C83DEA91D0A590C00FEBCF3 /* CString.cpp in Sources */,
</span><span class="cx">                          7C83DEAD1D0A590C00FEBCF3 /* Deque.cpp in Sources */,
</span><span class="cx">                          1AF7B21F1D6CD14D008C126C /* EnumTraits.cpp in Sources */,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWTFCrossThreadCopiercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/CrossThreadCopier.cpp (285349 => 285350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WTF/CrossThreadCopier.cpp        2021-11-05 19:08:39 UTC (rev 285349)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/CrossThreadCopier.cpp   2021-11-05 19:33:46 UTC (rev 285350)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx">     String original { "1234" };
</span><span class="cx">     String original2 { original };
</span><span class="cx">     auto copy = crossThreadCopy(WTFMove(original));
</span><del>-    EXPECT_EQ(original.impl()->refCount(), 2);
</del><ins>+    EXPECT_EQ(original.impl()->refCount(), 2u);
</ins><span class="cx">     EXPECT_FALSE(original.impl() == copy.impl());
</span><span class="cx">     EXPECT_TRUE(copy.impl()->hasOneRef());
</span><span class="cx"> }
</span><span class="lines">@@ -80,7 +80,7 @@
</span><span class="cx">     String string { "1234" };
</span><span class="cx">     std::optional<String> original { string };
</span><span class="cx">     auto copy = crossThreadCopy(original);
</span><del>-    EXPECT_EQ(original->impl()->refCount(), 2);
</del><ins>+    EXPECT_EQ(original->impl()->refCount(), 2u);
</ins><span class="cx">     EXPECT_FALSE(original->impl() == copy->impl());
</span><span class="cx">     EXPECT_TRUE(copy->impl()->hasOneRef());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebCoreContentExtensionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp (285349 => 285350)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp    2021-11-05 19:08:39 UTC (rev 285349)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp       2021-11-05 19:33:46 UTC (rev 285350)
</span><span class="lines">@@ -45,28 +45,6 @@
</span><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx"> #include <wtf/text/StringBuilder.h>
</span><span class="cx"> 
</span><del>-namespace WebCore {
-namespace ContentExtensions {
-inline std::ostream& operator<<(std::ostream& os, const ActionType& action)
-{
-    switch (action) {
-    case ActionType::BlockLoad:
-        return os << "ActionType::BlockLoad";
-    case ActionType::BlockCookies:
-        return os << "ActionType::BlockCookies";
-    case ActionType::CSSDisplayNoneSelector:
-        return os << "ActionType::CSSDisplayNone";
-    case ActionType::Notify:
-        return os << "ActionType::Notify";
-    case ActionType::IgnorePreviousRules:
-        return os << "ActionType::IgnorePreviousRules";
-    case ActionType::MakeHTTPS:
-        return os << "ActionType::MakeHTTPS";
-    }
-}
-}
-}
-
</del><span class="cx"> namespace TestWebKitAPI {
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> using namespace WebCore::ContentExtensions;
</span><span class="lines">@@ -192,7 +170,7 @@
</span><span class="cx">     return { WTFMove(actions), WTFMove(identifiersApplyingStylesheets) };
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void static testRequest(const ContentExtensions::ContentExtensionsBackend& contentExtensionsBackend, const ResourceLoadInfo& resourceLoadInfo, Vector<ContentExtensions::ActionType> expectedActions, size_t stylesheets = 1)
</del><ins>+void static testRequest(const ContentExtensions::ContentExtensionsBackend& contentExtensionsBackend, const ResourceLoadInfo& resourceLoadInfo, Vector<size_t> expectedActions, size_t stylesheets = 1)
</ins><span class="cx"> {
</span><span class="cx">     auto actions = allActionsForResourceLoad(contentExtensionsBackend, resourceLoadInfo);
</span><span class="cx">     unsigned expectedSize = actions.first.size();
</span><span class="lines">@@ -201,7 +179,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     for (unsigned i = 0; i < expectedActions.size(); ++i)
</span><del>-        EXPECT_EQ(expectedActions[i], actions.first[i].type());
</del><ins>+        EXPECT_EQ(expectedActions[i], actions.first[i].data().index());
</ins><span class="cx">     EXPECT_EQ(actions.second.size(), stylesheets);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -234,11 +212,13 @@
</span><span class="cx">     return nfas;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template <class T> constexpr std::size_t variantIndex = WTF::alternativeIndexV<T, ContentExtensions::ActionData>;
+
</ins><span class="cx"> TEST_F(ContentExtensionTest, Basic)
</span><span class="cx"> {
</span><span class="cx">     auto backend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"webkit.org\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("http://webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TEST_F(ContentExtensionTest, SingleCharacter)
</span><span class="lines">@@ -245,11 +225,11 @@
</span><span class="cx"> {
</span><span class="cx">     auto matchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^z\"}}]");
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("http://webkit.org/"), { });
</span><del>-    testRequest(matchBackend, mainDocumentRequest("zttp://webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("zttp://webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"y\"}}]");
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("http://webkit.org/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("http://webkit.org/ywebkit"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("http://webkit.org/ywebkit"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TEST_F(ContentExtensionTest, SingleCharacterDisjunction)
</span><span class="lines">@@ -258,16 +238,16 @@
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^c\"}}]");
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("http://webkit.org/"), { });
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("bttp://webkit.org/"), { });
</span><del>-    testRequest(matchBackend, mainDocumentRequest("cttp://webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("cttp://webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("dttp://webkit.org/"), { });
</span><del>-    testRequest(matchBackend, mainDocumentRequest("zttp://webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("zttp://webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"x\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"y\"}}]");
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("http://webkit.org/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("http://webkit.org/dwebkit"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("http://webkit.org/xwebkit"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("http://webkit.org/ywebkit"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("http://webkit.org/xwebkit"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("http://webkit.org/ywebkit"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("http://webkit.org/zwebkit"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -276,9 +256,9 @@
</span><span class="cx">     auto backend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"w[0-9]c\", \"url-filter-is-case-sensitive\":true}},"
</span><span class="cx">         "{\"action\":{\"type\":\"block-cookies\"},\"trigger\":{\"url-filter\":\"[A-H][a-z]cko\", \"url-filter-is-case-sensitive\":true}}]");
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("http://w3c.org"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("w2c://whatwg.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/w0c"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://w3c.org"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("w2c://whatwg.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/w0c"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/wac"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/wAc"), { });
</span><span class="cx"> 
</span><span class="lines">@@ -288,7 +268,7 @@
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://gCcko.org/"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://gccko.org/"), { });
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("http://webkit.org/Gecko"), { ContentExtensions::ActionType::BlockCookies });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://webkit.org/Gecko"), { variantIndex<ContentExtensions::BlockCookiesAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/gecko"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/GEcko"), { });
</span><span class="cx"> }
</span><span class="lines">@@ -300,9 +280,9 @@
</span><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://w3c.org"), { });
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("http://w3c.org/foobafoobar"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://w3c.org/foobafoobar"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("http://w3c.org/foobarfoobar"), { });
</span><del>-    testRequest(backend, mainDocumentRequest("http://w3c.org/FOOBAFOOBAR"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://w3c.org/FOOBAFOOBAR"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("http://w3c.org/FOOBARFOOBAR"), { });
</span><span class="cx"> 
</span><span class="cx">     // The character before the "a" prefix cannot be another "a".
</span><span class="lines">@@ -316,8 +296,8 @@
</span><span class="cx"> {
</span><span class="cx">     auto backend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^(http://whatwg\\\\.org/)?webkit\134\134.org\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("http://whatwg.org/webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://whatwg.org/webkit.org"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://whatwg.org/webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://whatwg.org/webkit.org"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://whatwg.org/"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://whatwg.org"), { });
</span><span class="lines">@@ -327,13 +307,13 @@
</span><span class="cx"> {
</span><span class="cx">     auto backend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^http://webkit\\\\.org/(foo(bar)*)+\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("http://webkit.org/foo"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/foobar"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/foobarbar"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/foofoobar"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/foobarfoobar"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/foob"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/foor"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://webkit.org/foo"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/foobar"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/foobarbar"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/foofoobar"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/foobarfoobar"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/foob"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/foor"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/bar"), { });
</span><span class="lines">@@ -346,10 +326,10 @@
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^http://webkit\\\\.org/((me)()(too))\"}}]");
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/foo"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/bar"), { });
</span><del>-    testRequest(backend, mainDocumentRequest("http://webkit.org/foobar"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://webkit.org/foobar"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/me"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/too"), { });
</span><del>-    testRequest(backend, mainDocumentRequest("http://webkit.org/metoo"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://webkit.org/metoo"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/foome"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/foomebar"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/mefoo"), { });
</span><span class="lines">@@ -362,10 +342,10 @@
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^http://webkit\\\\.org/(()*()?(target)()+)\"}}]");
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/foo"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/bar"), { });
</span><del>-    testRequest(backend, mainDocumentRequest("http://webkit.org/foobar"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://webkit.org/foobar"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/me"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/too"), { });
</span><del>-    testRequest(backend, mainDocumentRequest("http://webkit.org/target"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://webkit.org/target"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/foome"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/foomebar"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/mefoo"), { });
</span><span class="lines">@@ -376,14 +356,14 @@
</span><span class="cx"> {
</span><span class="cx">     auto backend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\".+\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("http://webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/foo"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/foobar"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/foobarbar"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/foofoobar"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/foobarfoobar"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/foob"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/foor"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/foo"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/foobar"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/foobarbar"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/foofoobar"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/foobarfoobar"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/foob"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/foor"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TEST_F(ContentExtensionTest, StartOfLineAssertion)
</span><span class="lines">@@ -390,9 +370,9 @@
</span><span class="cx"> {
</span><span class="cx">     auto backend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^foobar\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("foobar://webkit.org/foobar"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("foobars:///foobar"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("foobarfoobar:///foobarfoobarfoobar"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("foobar://webkit.org/foobar"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("foobars:///foobar"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("foobarfoobar:///foobarfoobarfoobar"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/foobarfoo"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/foobarf"), { });
</span><span class="lines">@@ -404,9 +384,9 @@
</span><span class="cx"> {
</span><span class="cx">     auto backend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"foobar$\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("http://webkit.org/foobar"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("file:///foobar"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("file:///foobarfoobarfoobar"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://webkit.org/foobar"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("file:///foobar"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("file:///foobarfoobarfoobar"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/foobarfoo"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/foobarf"), { });
</span><span class="lines">@@ -416,11 +396,11 @@
</span><span class="cx"> {
</span><span class="cx">     auto backend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"[^y]$\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("http://webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/a"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/foobar"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/Ya"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/yFoobar"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/a"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/foobar"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/Ya"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/yFoobar"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/y"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/Y"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/foobary"), { });
</span><span class="lines">@@ -431,10 +411,10 @@
</span><span class="cx"> {
</span><span class="cx">     auto backend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"https://webkit\\\\.org/.\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("https://webkit.org/foobar"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("https://webkit.org/foobar"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("https://webkit.org/"), { });
</span><del>-    testRequest(backend, mainDocumentRequest("https://webkit.org/A"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://webkit.org/z"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("https://webkit.org/A"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://webkit.org/z"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TEST_F(ContentExtensionTest, PrefixInfixSuffixExactMatch)
</span><span class="lines">@@ -444,19 +424,19 @@
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"suffix$\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^http://exact\\\\.org/$\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("infix://webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://infix.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://webkit.org/infix"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("infix://webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://infix.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://webkit.org/infix"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("prefix://webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("prefix://webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("https://prefix.org/"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("https://webkit.org/prefix"), { });
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("https://webkit.org/suffix"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("https://webkit.org/suffix"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("https://suffix.org/"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("suffix://webkit.org/"), { });
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("http://exact.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://exact.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("http://exact.org/oops"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -465,15 +445,15 @@
</span><span class="cx">     auto backend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\".*.*(.)*(.*)(.+)*(.?)*infix\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"pre(.?)+(.+)?post\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("infix://webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://infix.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://webkit.org/infix"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("infix://webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://infix.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://webkit.org/infix"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("pre://webkit.org/post"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://prepost.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://pre.org/posttail"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://pre.pre/posttail"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://pre.org/posttailpost"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("pre://webkit.org/post"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://prepost.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://pre.org/posttail"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://pre.pre/posttail"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://pre.org/posttailpost"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("https://post.org/pre"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("https://pre.org/pre"), { });
</span><span class="lines">@@ -488,12 +468,12 @@
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"prefixsuffix\"}}]");
</span><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/"), { });
</span><del>-    testRequest(backend, mainDocumentRequest("http://prefix.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/prefix"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/aaaprefixaaa"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://prefixsuffix.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/prefixsuffix"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/bbbprefixsuffixbbb"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://prefix.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/prefix"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/aaaprefixaaa"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://prefixsuffix.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/prefixsuffix"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/bbbprefixsuffixbbb"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://suffix.org/"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/suffix"), { });
</span><span class="lines">@@ -506,12 +486,12 @@
</span><span class="cx">         "{\"action\":{\"type\":\"block-cookies\"},\"trigger\":{\"url-filter\":\"prefixsuffix\"}}]");
</span><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/"), { });
</span><del>-    testRequest(backend, mainDocumentRequest("http://prefix.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/prefix"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/aaaprefixaaa"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://prefixsuffix.org/"), { ContentExtensions::ActionType::BlockCookies, ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/prefixsuffix"), { ContentExtensions::ActionType::BlockCookies, ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/bbbprefixsuffixbbb"), { ContentExtensions::ActionType::BlockCookies, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://prefix.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/prefix"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/aaaprefixaaa"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://prefixsuffix.org/"), { variantIndex<ContentExtensions::BlockCookiesAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/prefixsuffix"), { variantIndex<ContentExtensions::BlockCookiesAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/bbbprefixsuffixbbb"), { variantIndex<ContentExtensions::BlockCookiesAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://suffix.org/"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/suffix"), { });
</span><span class="lines">@@ -523,8 +503,8 @@
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"bar\\\\.org\"}}]");
</span><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/"), { });
</span><del>-    testRequest(backend, mainDocumentRequest("http://foo.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://bar.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://foo.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://bar.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://foor.org/"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://fooar.org/"), { });
</span><span class="lines">@@ -543,18 +523,18 @@
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://baoo.org/"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://bao.org/"), { });
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("http://foo.orgbar.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://oo.orgbar.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://o.orgbar.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://.orgbar.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://rgbar.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://gbar.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://foo.orgar.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://foo.orgr.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://foo.org.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://foo.orgorg/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://foo.orgrg/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://foo.orgg/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://foo.orgbar.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://oo.orgbar.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://o.orgbar.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://.orgbar.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://rgbar.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://gbar.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://foo.orgar.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://foo.orgr.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://foo.org.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://foo.orgorg/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://foo.orgrg/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://foo.orgg/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void compareContents(const ContentExtensions::DFABytecodeInterpreter::Actions& a, const Vector<uint64_t>& b)
</span><span class="lines">@@ -621,7 +601,7 @@
</span><span class="cx">     auto ifDomainBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"test\\\\.html\", \"if-domain\":[\"webkit.org\"]}}]");
</span><span class="cx">     testRequest(ifDomainBackend, mainDocumentRequest("http://webkit.org/test.htm"), { });
</span><span class="cx">     testRequest(ifDomainBackend, mainDocumentRequest("http://bugs.webkit.org/test.htm"), { });
</span><del>-    testRequest(ifDomainBackend, mainDocumentRequest("http://webkit.org/test.html"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(ifDomainBackend, mainDocumentRequest("http://webkit.org/test.html"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(ifDomainBackend, mainDocumentRequest("http://bugs.webkit.org/test.html"), { });
</span><span class="cx">     testRequest(ifDomainBackend, mainDocumentRequest("http://sub2.sub1.webkit.org/test.html"), { });
</span><span class="cx">     testRequest(ifDomainBackend, mainDocumentRequest("http://not_webkit.org/test.htm"), { });
</span><span class="lines">@@ -633,19 +613,19 @@
</span><span class="cx">     testRequest(unlessDomainBackend, mainDocumentRequest("http://webkit.org/test.htm"), { });
</span><span class="cx">     testRequest(unlessDomainBackend, mainDocumentRequest("http://bugs.webkit.org/test.htm"), { });
</span><span class="cx">     testRequest(unlessDomainBackend, mainDocumentRequest("http://webkit.org/test.html"), { });
</span><del>-    testRequest(unlessDomainBackend, mainDocumentRequest("http://bugs.webkit.org/test.html"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(unlessDomainBackend, mainDocumentRequest("http://sub2.sub1.webkit.org/test.html"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(unlessDomainBackend, mainDocumentRequest("http://bugs.webkit.org/test.html"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(unlessDomainBackend, mainDocumentRequest("http://sub2.sub1.webkit.org/test.html"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(unlessDomainBackend, mainDocumentRequest("http://not_webkit.org/test.htm"), { });
</span><span class="cx">     testRequest(unlessDomainBackend, mainDocumentRequest("http://webkit.organization/test.htm"), { });
</span><del>-    testRequest(unlessDomainBackend, mainDocumentRequest("http://not_webkit.org/test.html"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(unlessDomainBackend, mainDocumentRequest("http://webkit.organization/test.html"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(unlessDomainBackend, mainDocumentRequest("http://not_webkit.org/test.html"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(unlessDomainBackend, mainDocumentRequest("http://webkit.organization/test.html"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     
</span><span class="cx">     auto ifDomainStarBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"test\\\\.html\", \"if-domain\":[\"*webkit.org\"]}}]");
</span><span class="cx">     testRequest(ifDomainStarBackend, mainDocumentRequest("http://webkit.org/test.htm"), { });
</span><span class="cx">     testRequest(ifDomainStarBackend, mainDocumentRequest("http://bugs.webkit.org/test.htm"), { });
</span><del>-    testRequest(ifDomainStarBackend, mainDocumentRequest("http://webkit.org/test.html"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(ifDomainStarBackend, mainDocumentRequest("http://bugs.webkit.org/test.html"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(ifDomainStarBackend, mainDocumentRequest("http://sub2.sub1.webkit.org/test.html"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(ifDomainStarBackend, mainDocumentRequest("http://webkit.org/test.html"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(ifDomainStarBackend, mainDocumentRequest("http://bugs.webkit.org/test.html"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(ifDomainStarBackend, mainDocumentRequest("http://sub2.sub1.webkit.org/test.html"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(ifDomainStarBackend, mainDocumentRequest("http://not_webkit.org/test.htm"), { });
</span><span class="cx">     testRequest(ifDomainStarBackend, mainDocumentRequest("http://webkit.organization/test.htm"), { });
</span><span class="cx">     testRequest(ifDomainStarBackend, mainDocumentRequest("http://not_webkit.org/test.html"), { });
</span><span class="lines">@@ -659,30 +639,30 @@
</span><span class="cx">     testRequest(unlessDomainStarBackend, mainDocumentRequest("http://sub2.sub1.webkit.org/test.html"), { });
</span><span class="cx">     testRequest(unlessDomainStarBackend, mainDocumentRequest("http://not_webkit.org/test.htm"), { });
</span><span class="cx">     testRequest(unlessDomainStarBackend, mainDocumentRequest("http://webkit.organization/test.htm"), { });
</span><del>-    testRequest(unlessDomainStarBackend, mainDocumentRequest("http://not_webkit.org/test.html"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(unlessDomainStarBackend, mainDocumentRequest("http://webkit.organization/test.html"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(unlessDomainStarBackend, mainDocumentRequest("http://not_webkit.org/test.html"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(unlessDomainStarBackend, mainDocumentRequest("http://webkit.organization/test.html"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><span class="cx">     auto ifSubDomainBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"test\\\\.html\", \"if-domain\":[\"sub1.webkit.org\"]}}]");
</span><span class="cx">     testRequest(ifSubDomainBackend, mainDocumentRequest("http://webkit.org/test.html"), { });
</span><span class="cx">     testRequest(ifSubDomainBackend, mainDocumentRequest("http://bugs.webkit.org/test.html"), { });
</span><del>-    testRequest(ifSubDomainBackend, mainDocumentRequest("http://sub1.webkit.org/test.html"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(ifSubDomainBackend, mainDocumentRequest("http://sub1.webkit.org/test.html"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(ifSubDomainBackend, mainDocumentRequest("http://sub2.sub1.webkit.org/test.html"), { });
</span><span class="cx"> 
</span><span class="cx">     auto ifSubDomainStarBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"test\\\\.html\", \"if-domain\":[\"*sub1.webkit.org\"]}}]");
</span><span class="cx">     testRequest(ifSubDomainStarBackend, mainDocumentRequest("http://webkit.org/test.html"), { });
</span><span class="cx">     testRequest(ifSubDomainStarBackend, mainDocumentRequest("http://bugs.webkit.org/test.html"), { });
</span><del>-    testRequest(ifSubDomainStarBackend, mainDocumentRequest("http://sub1.webkit.org/test.html"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(ifSubDomainStarBackend, mainDocumentRequest("http://sub2.sub1.webkit.org/test.html"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(ifSubDomainStarBackend, mainDocumentRequest("http://sub1.webkit.org/test.html"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(ifSubDomainStarBackend, mainDocumentRequest("http://sub2.sub1.webkit.org/test.html"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><span class="cx">     auto unlessSubDomainBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"test\\\\.html\", \"unless-domain\":[\"sub1.webkit.org\"]}}]");
</span><del>-    testRequest(unlessSubDomainBackend, mainDocumentRequest("http://webkit.org/test.html"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(unlessSubDomainBackend, mainDocumentRequest("http://bugs.webkit.org/test.html"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(unlessSubDomainBackend, mainDocumentRequest("http://webkit.org/test.html"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(unlessSubDomainBackend, mainDocumentRequest("http://bugs.webkit.org/test.html"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(unlessSubDomainBackend, mainDocumentRequest("http://sub1.webkit.org/test.html"), { });
</span><del>-    testRequest(unlessSubDomainBackend, mainDocumentRequest("http://sub2.sub1.webkit.org/test.html"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(unlessSubDomainBackend, mainDocumentRequest("http://sub2.sub1.webkit.org/test.html"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     
</span><span class="cx">     auto unlessSubDomainStarBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"test\\\\.html\", \"unless-domain\":[\"*sub1.webkit.org\"]}}]");
</span><del>-    testRequest(unlessSubDomainStarBackend, mainDocumentRequest("http://webkit.org/test.html"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(unlessSubDomainStarBackend, mainDocumentRequest("http://bugs.webkit.org/test.html"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(unlessSubDomainStarBackend, mainDocumentRequest("http://webkit.org/test.html"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(unlessSubDomainStarBackend, mainDocumentRequest("http://bugs.webkit.org/test.html"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(unlessSubDomainStarBackend, mainDocumentRequest("http://sub1.webkit.org/test.html"), { });
</span><span class="cx">     testRequest(unlessSubDomainStarBackend, mainDocumentRequest("http://sub2.sub1.webkit.org/test.html"), { });
</span><span class="cx"> 
</span><span class="lines">@@ -690,8 +670,8 @@
</span><span class="cx">         "{\"action\":{\"type\":\"block-cookies\"},\"trigger\":{\"url-filter\":\"test_block_cookies\", \"unless-domain\":[\"webkit.org\"]}}]");
</span><span class="cx">     testRequest(combinedBackend1, mainDocumentRequest("http://webkit.org"), { });
</span><span class="cx">     testRequest(combinedBackend1, mainDocumentRequest("http://not_webkit.org"), { });
</span><del>-    testRequest(combinedBackend1, mainDocumentRequest("http://webkit.org/test_block_load.html"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(combinedBackend1, subResourceRequest("http://whatwg.org/test_block_load.html", "http://webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(combinedBackend1, mainDocumentRequest("http://webkit.org/test_block_load.html"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(combinedBackend1, subResourceRequest("http://whatwg.org/test_block_load.html", "http://webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(combinedBackend1, subResourceRequest("http://whatwg.org/shouldnt_match.html", "http://webkit.org/"), { });
</span><span class="cx">     testRequest(combinedBackend1, subResourceRequest("http://whatwg.org/test_block_load.html", "http://not_webkit.org/"), { });
</span><span class="cx">     testRequest(combinedBackend1, subResourceRequest("http://whatwg.org/shouldnt_match.html", "http://not_webkit.org/"), { });
</span><span class="lines">@@ -698,28 +678,28 @@
</span><span class="cx">     testRequest(combinedBackend1, mainDocumentRequest("http://webkit.org/test_block_cookies.html"), { });
</span><span class="cx">     testRequest(combinedBackend1, subResourceRequest("http://whatwg.org/test_block_cookies.html", "http://webkit.org/"), { });
</span><span class="cx">     testRequest(combinedBackend1, subResourceRequest("http://whatwg.org/shouldnt_match.html", "http://webkit.org/"), { });
</span><del>-    testRequest(combinedBackend1, subResourceRequest("http://whatwg.org/test_block_cookies.html", "http://not_webkit.org/path/to/main/document.html"), { ContentExtensions::ActionType::BlockCookies });
</del><ins>+    testRequest(combinedBackend1, subResourceRequest("http://whatwg.org/test_block_cookies.html", "http://not_webkit.org/path/to/main/document.html"), { variantIndex<ContentExtensions::BlockCookiesAction> });
</ins><span class="cx">     testRequest(combinedBackend1, subResourceRequest("http://whatwg.org/shouldnt_match.html", "http://not_webkit.org/"), { });
</span><span class="cx">     
</span><span class="cx">     auto combinedBackend2 = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"test_block_load\\\\.html\", \"if-domain\":[\"webkit.org\"]}},"
</span><span class="cx">         "{\"action\":{\"type\":\"block-cookies\"},\"trigger\":{\"url-filter\":\"test_block_cookies\\\\.html\", \"unless-domain\":[\"w3c.org\"]}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"test_css\\\\.html\"}}]");
</span><del>-    testRequest(combinedBackend2, mainDocumentRequest("http://webkit.org/test_css.html"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(combinedBackend2, mainDocumentRequest("http://webkit.org/test_css.html"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(combinedBackend2, mainDocumentRequest("http://webkit.org/test_css.htm"), { });
</span><del>-    testRequest(combinedBackend2, mainDocumentRequest("http://webkit.org/test_block_load.html"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(combinedBackend2, mainDocumentRequest("http://webkit.org/test_block_load.html"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(combinedBackend2, mainDocumentRequest("http://not_webkit.org/test_block_load.html"), { });
</span><del>-    testRequest(combinedBackend2, mainDocumentRequest("http://not_webkit.org/test_css.html"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(combinedBackend2, mainDocumentRequest("http://webkit.org/TEST_CSS.hTmL/test_block_load.html"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad});
-    testRequest(combinedBackend2, mainDocumentRequest("http://w3c.org/test_css.html"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(combinedBackend2, mainDocumentRequest("http://not_webkit.org/test_css.html"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(combinedBackend2, mainDocumentRequest("http://webkit.org/TEST_CSS.hTmL/test_block_load.html"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(combinedBackend2, mainDocumentRequest("http://w3c.org/test_css.html"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(combinedBackend2, mainDocumentRequest("http://w3c.org/test_block_load.html"), { });
</span><span class="cx">     testRequest(combinedBackend2, mainDocumentRequest("http://w3c.org/test_block_cookies.html"), { });
</span><del>-    testRequest(combinedBackend2, mainDocumentRequest("http://w3c.org/test_css.html/test_block_cookies.html"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(combinedBackend2, mainDocumentRequest("http://not_w3c.org/test_block_cookies.html"), { ContentExtensions::ActionType::BlockCookies });
-    testRequest(combinedBackend2, mainDocumentRequest("http://not_w3c.org/test_css.html/test_block_cookies.html"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockCookies });
</del><ins>+    testRequest(combinedBackend2, mainDocumentRequest("http://w3c.org/test_css.html/test_block_cookies.html"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(combinedBackend2, mainDocumentRequest("http://not_w3c.org/test_block_cookies.html"), { variantIndex<ContentExtensions::BlockCookiesAction> });
+    testRequest(combinedBackend2, mainDocumentRequest("http://not_w3c.org/test_css.html/test_block_cookies.html"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockCookiesAction> });
</ins><span class="cx"> 
</span><span class="cx">     auto ifDomainWithFlagsBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"test\", \"if-domain\":[\"webkit.org\"],\"resource-type\":[\"image\"]}}]");
</span><span class="cx">     testRequest(ifDomainWithFlagsBackend, mainDocumentRequest("http://webkit.org/test.html"), { });
</span><del>-    testRequest(ifDomainWithFlagsBackend, mainDocumentRequest("http://webkit.org/test.png", ResourceType::Image), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(ifDomainWithFlagsBackend, mainDocumentRequest("http://webkit.org/test.png", ResourceType::Image), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(ifDomainWithFlagsBackend, mainDocumentRequest("http://not_webkit.org/test.html"), { });
</span><span class="cx">     testRequest(ifDomainWithFlagsBackend, mainDocumentRequest("http://not_webkit.org/test.png", ResourceType::Image), { });
</span><span class="cx"> 
</span><span class="lines">@@ -727,7 +707,7 @@
</span><span class="cx">     testRequest(unlessDomainWithFlagsBackend, mainDocumentRequest("http://webkit.org/test.html"), { });
</span><span class="cx">     testRequest(unlessDomainWithFlagsBackend, mainDocumentRequest("http://webkit.org/test.png", ResourceType::Image), { });
</span><span class="cx">     testRequest(unlessDomainWithFlagsBackend, mainDocumentRequest("http://not_webkit.org/test.html"), { });
</span><del>-    testRequest(unlessDomainWithFlagsBackend, mainDocumentRequest("http://not_webkit.org/test.png", ResourceType::Image), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(unlessDomainWithFlagsBackend, mainDocumentRequest("http://not_webkit.org/test.png", ResourceType::Image), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><span class="cx">     // Domains should not be interepted as regular expressions.
</span><span class="cx">     auto domainRegexBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"test\\\\.html\", \"if-domain\":[\"we?bkit.org\"]}}]");
</span><span class="lines">@@ -736,8 +716,8 @@
</span><span class="cx">     
</span><span class="cx">     auto multipleIfDomainsBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"test\\\\.html\", \"if-domain\":[\"webkit.org\", \"w3c.org\"]}}]");
</span><span class="cx">     testRequest(multipleIfDomainsBackend, mainDocumentRequest("http://webkit.org/test.htm"), { });
</span><del>-    testRequest(multipleIfDomainsBackend, mainDocumentRequest("http://webkit.org/test.html"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(multipleIfDomainsBackend, mainDocumentRequest("http://w3c.org/test.html"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(multipleIfDomainsBackend, mainDocumentRequest("http://webkit.org/test.html"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(multipleIfDomainsBackend, mainDocumentRequest("http://w3c.org/test.html"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(multipleIfDomainsBackend, mainDocumentRequest("http://whatwg.org/test.html"), { });
</span><span class="cx"> 
</span><span class="cx">     auto multipleUnlessDomainsBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"test\\\\.html\", \"unless-domain\":[\"webkit.org\", \"w3c.org\"]}}]");
</span><span class="lines">@@ -744,7 +724,7 @@
</span><span class="cx">     testRequest(multipleUnlessDomainsBackend, mainDocumentRequest("http://webkit.org/test.htm"), { });
</span><span class="cx">     testRequest(multipleUnlessDomainsBackend, mainDocumentRequest("http://webkit.org/test.html"), { });
</span><span class="cx">     testRequest(multipleUnlessDomainsBackend, mainDocumentRequest("http://w3c.org/test.html"), { });
</span><del>-    testRequest(multipleUnlessDomainsBackend, mainDocumentRequest("http://whatwg.org/test.html"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(multipleUnlessDomainsBackend, mainDocumentRequest("http://whatwg.org/test.html"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: Add and test domain-specific popup-only blocking (with layout tests).
</span><span class="cx"> }
</span><span class="lines">@@ -758,22 +738,22 @@
</span><span class="cx">         "{\"action\":{\"type\":\"block-cookies\"},\"trigger\":{\"url-filter\":\"except-this\"}}]");
</span><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/test.htm"), { });
</span><del>-    testRequest(backend, mainDocumentRequest("http://webkit.org/test.html"), { ContentExtensions::ActionType::BlockLoad, ContentExtensions::ActionType::BlockCookies });
-    testRequest(backend, mainDocumentRequest("http://notwebkit.org/test.html"), { ContentExtensions::ActionType::BlockCookies });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://webkit.org/test.html"), { variantIndex<ContentExtensions::BlockLoadAction>, variantIndex<ContentExtensions::BlockCookiesAction> });
+    testRequest(backend, mainDocumentRequest("http://notwebkit.org/test.html"), { variantIndex<ContentExtensions::BlockCookiesAction> });
</ins><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://notwebkit.org/trigger-on-scripts.html"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/trigger-on-scripts.html"), { });
</span><del>-    testRequest(backend, mainDocumentRequest("http://notwebkit.org/trigger-on-scripts.html", ResourceType::Script), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/trigger-on-scripts.html", ResourceType::Script), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(backend, mainDocumentRequest("http://notwebkit.org/trigger-on-scripts.html.test.html", ResourceType::Script), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockCookies });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/trigger-on-scripts.html.test.html", ResourceType::Script), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad, ContentExtensions::ActionType::BlockCookies });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://notwebkit.org/trigger-on-scripts.html", ResourceType::Script), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/trigger-on-scripts.html", ResourceType::Script), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(backend, mainDocumentRequest("http://notwebkit.org/trigger-on-scripts.html.test.html", ResourceType::Script), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockCookiesAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/trigger-on-scripts.html.test.html", ResourceType::Script), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction>, variantIndex<ContentExtensions::BlockCookiesAction> });
</ins><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://notwebkit.org/ignore-previous-trigger-on-scripts.html"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/ignore-previous-trigger-on-scripts.html"), { });
</span><del>-    testRequest(backend, mainDocumentRequest("http://notwebkit.org/ignore-previous-trigger-on-scripts.html", ResourceType::Script), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/ignore-previous-trigger-on-scripts.html", ResourceType::Script), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(backend, mainDocumentRequest("http://notwebkit.org/ignore-previous-trigger-on-scripts.html.test.html", ResourceType::Script), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockCookies });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/ignore-previous-trigger-on-scripts.html.test.html", ResourceType::Script), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad, ContentExtensions::ActionType::BlockCookies });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://notwebkit.org/ignore-previous-trigger-on-scripts.html", ResourceType::Script), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/ignore-previous-trigger-on-scripts.html", ResourceType::Script), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(backend, mainDocumentRequest("http://notwebkit.org/ignore-previous-trigger-on-scripts.html.test.html", ResourceType::Script), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockCookiesAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/ignore-previous-trigger-on-scripts.html.test.html", ResourceType::Script), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction>, variantIndex<ContentExtensions::BlockCookiesAction> });
</ins><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://notwebkit.org/ignore-previous-trigger-on-scripts.html", ResourceType::Image), { }, 0);
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/ignore-previous-trigger-on-scripts.html", ResourceType::Image), { }, 0);
</span><span class="lines">@@ -780,24 +760,24 @@
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://notwebkit.org/ignore-previous-trigger-on-scripts.html.test.html", ResourceType::Image), { }, 0);
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/ignore-previous-trigger-on-scripts.html.test.html", ResourceType::Image), { }, 0);
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("http://notwebkit.org/except-this-ignore-previous-trigger-on-scripts.html"), { ContentExtensions::ActionType::BlockCookies });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/except-this-ignore-previous-trigger-on-scripts.html"), { ContentExtensions::ActionType::BlockCookies });
-    testRequest(backend, mainDocumentRequest("http://notwebkit.org/except-this-ignore-previous-trigger-on-scripts.html.test.html"), { ContentExtensions::ActionType::BlockCookies, ContentExtensions::ActionType::BlockCookies });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/except-this-ignore-previous-trigger-on-scripts.html.test.html"), { ContentExtensions::ActionType::BlockCookies, ContentExtensions::ActionType::BlockLoad, ContentExtensions::ActionType::BlockCookies });
-    testRequest(backend, mainDocumentRequest("http://notwebkit.org/except-this-ignore-previous-trigger-on-scripts.html", ResourceType::Image), { ContentExtensions::ActionType::BlockCookies }, 0);
-    testRequest(backend, mainDocumentRequest("http://webkit.org/except-this-ignore-previous-trigger-on-scripts.html", ResourceType::Image), { ContentExtensions::ActionType::BlockCookies }, 0);
-    testRequest(backend, mainDocumentRequest("http://notwebkit.org/except-this-ignore-previous-trigger-on-scripts.html.test.html", ResourceType::Image), { ContentExtensions::ActionType::BlockCookies }, 0);
-    testRequest(backend, mainDocumentRequest("http://webkit.org/except-this-ignore-previous-trigger-on-scripts.html.test.html", ResourceType::Image), { ContentExtensions::ActionType::BlockCookies }, 0);
-    testRequest(backend, mainDocumentRequest("http://notwebkit.org/except-this-ignore-previous-trigger-on-scripts.html", ResourceType::Script), { ContentExtensions::ActionType::BlockCookies, ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/except-this-ignore-previous-trigger-on-scripts.html", ResourceType::Script), { ContentExtensions::ActionType::BlockCookies, ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(backend, mainDocumentRequest("http://notwebkit.org/except-this-ignore-previous-trigger-on-scripts.html.test.html", ResourceType::Script), { ContentExtensions::ActionType::BlockCookies, ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockCookies });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/except-this-ignore-previous-trigger-on-scripts.html.test.html", ResourceType::Script), { ContentExtensions::ActionType::BlockCookies, ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad, ContentExtensions::ActionType::BlockCookies });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://notwebkit.org/except-this-ignore-previous-trigger-on-scripts.html"), { variantIndex<ContentExtensions::BlockCookiesAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/except-this-ignore-previous-trigger-on-scripts.html"), { variantIndex<ContentExtensions::BlockCookiesAction> });
+    testRequest(backend, mainDocumentRequest("http://notwebkit.org/except-this-ignore-previous-trigger-on-scripts.html.test.html"), { variantIndex<ContentExtensions::BlockCookiesAction>, variantIndex<ContentExtensions::BlockCookiesAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/except-this-ignore-previous-trigger-on-scripts.html.test.html"), { variantIndex<ContentExtensions::BlockCookiesAction>, variantIndex<ContentExtensions::BlockLoadAction>, variantIndex<ContentExtensions::BlockCookiesAction> });
+    testRequest(backend, mainDocumentRequest("http://notwebkit.org/except-this-ignore-previous-trigger-on-scripts.html", ResourceType::Image), { variantIndex<ContentExtensions::BlockCookiesAction> }, 0);
+    testRequest(backend, mainDocumentRequest("http://webkit.org/except-this-ignore-previous-trigger-on-scripts.html", ResourceType::Image), { variantIndex<ContentExtensions::BlockCookiesAction> }, 0);
+    testRequest(backend, mainDocumentRequest("http://notwebkit.org/except-this-ignore-previous-trigger-on-scripts.html.test.html", ResourceType::Image), { variantIndex<ContentExtensions::BlockCookiesAction> }, 0);
+    testRequest(backend, mainDocumentRequest("http://webkit.org/except-this-ignore-previous-trigger-on-scripts.html.test.html", ResourceType::Image), { variantIndex<ContentExtensions::BlockCookiesAction> }, 0);
+    testRequest(backend, mainDocumentRequest("http://notwebkit.org/except-this-ignore-previous-trigger-on-scripts.html", ResourceType::Script), { variantIndex<ContentExtensions::BlockCookiesAction>, variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/except-this-ignore-previous-trigger-on-scripts.html", ResourceType::Script), { variantIndex<ContentExtensions::BlockCookiesAction>, variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(backend, mainDocumentRequest("http://notwebkit.org/except-this-ignore-previous-trigger-on-scripts.html.test.html", ResourceType::Script), { variantIndex<ContentExtensions::BlockCookiesAction>, variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockCookiesAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/except-this-ignore-previous-trigger-on-scripts.html.test.html", ResourceType::Script), { variantIndex<ContentExtensions::BlockCookiesAction>, variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction>, variantIndex<ContentExtensions::BlockCookiesAction> });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TEST_F(ContentExtensionTest, TopURL)
</span><span class="cx"> {
</span><del>-    const Vector<ContentExtensions::ActionType> blockLoad = { ContentExtensions::ActionType::BlockLoad };
-    const Vector<ContentExtensions::ActionType> blockCookies = { ContentExtensions::ActionType::BlockCookies };
</del><ins>+    const Vector<size_t> blockLoad = { variantIndex<ContentExtensions::BlockLoadAction> };
+    const Vector<size_t> blockCookies = { variantIndex<ContentExtensions::BlockCookiesAction> };
</ins><span class="cx"> 
</span><span class="cx">     auto ifTopURL = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"test\\\\.html\", \"if-top-url\":[\"^http://web.*kit.org\"]}}]");
</span><span class="cx">     testRequest(ifTopURL, mainDocumentRequest("http://webkit.org/test.html"), blockLoad);
</span><span class="lines">@@ -869,10 +849,10 @@
</span><span class="cx">     backend.addContentExtension("testFilter2", WTFMove(extension2));
</span><span class="cx">     
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org"), { }, 2);
</span><del>-    testRequest(backend, mainDocumentRequest("http://webkit.org/block_load.html"), { ContentExtensions::ActionType::BlockLoad }, 2);
-    testRequest(backend, mainDocumentRequest("http://webkit.org/block_cookies.html"), { ContentExtensions::ActionType::BlockCookies }, 2);
-    testRequest(backend, mainDocumentRequest("http://webkit.org/block_load/block_cookies.html"), { ContentExtensions::ActionType::BlockCookies, ContentExtensions::ActionType::BlockLoad }, 2);
-    testRequest(backend, mainDocumentRequest("http://webkit.org/block_cookies/block_load.html"), { ContentExtensions::ActionType::BlockCookies, ContentExtensions::ActionType::BlockLoad }, 2);
</del><ins>+    testRequest(backend, mainDocumentRequest("http://webkit.org/block_load.html"), { variantIndex<ContentExtensions::BlockLoadAction> }, 2);
+    testRequest(backend, mainDocumentRequest("http://webkit.org/block_cookies.html"), { variantIndex<ContentExtensions::BlockCookiesAction> }, 2);
+    testRequest(backend, mainDocumentRequest("http://webkit.org/block_load/block_cookies.html"), { variantIndex<ContentExtensions::BlockCookiesAction>, variantIndex<ContentExtensions::BlockLoadAction> }, 2);
+    testRequest(backend, mainDocumentRequest("http://webkit.org/block_cookies/block_load.html"), { variantIndex<ContentExtensions::BlockCookiesAction>, variantIndex<ContentExtensions::BlockLoadAction> }, 2);
</ins><span class="cx">     
</span><span class="cx">     auto ignoreExtension1 = InMemoryCompiledContentExtension::create("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"block_load\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"ignore-previous-rules\"},\"trigger\":{\"url-filter\":\"ignore1\"}}]");
</span><span class="lines">@@ -884,8 +864,8 @@
</span><span class="cx"> 
</span><span class="cx">     testRequest(backendWithIgnore, mainDocumentRequest("http://webkit.org"), { }, 2);
</span><span class="cx">     testRequest(backendWithIgnore, mainDocumentRequest("http://webkit.org/block_load/ignore1.html"), { }, 1);
</span><del>-    testRequest(backendWithIgnore, mainDocumentRequest("http://webkit.org/block_cookies/ignore1.html"), { ContentExtensions::ActionType::BlockCookies }, 1);
-    testRequest(backendWithIgnore, mainDocumentRequest("http://webkit.org/block_load/ignore2.html"), { ContentExtensions::ActionType::BlockLoad }, 1);
</del><ins>+    testRequest(backendWithIgnore, mainDocumentRequest("http://webkit.org/block_cookies/ignore1.html"), { variantIndex<ContentExtensions::BlockCookiesAction> }, 1);
+    testRequest(backendWithIgnore, mainDocumentRequest("http://webkit.org/block_load/ignore2.html"), { variantIndex<ContentExtensions::BlockLoadAction> }, 1);
</ins><span class="cx">     testRequest(backendWithIgnore, mainDocumentRequest("http://webkit.org/block_cookies/ignore2.html"), { }, 1);
</span><span class="cx">     testRequest(backendWithIgnore, mainDocumentRequest("http://webkit.org/block_load/block_cookies/ignore1/ignore2.html"), { }, 0);
</span><span class="cx"> }
</span><span class="lines">@@ -905,10 +885,8 @@
</span><span class="cx">     if (actual.first.size() != expected.size())
</span><span class="cx">         return false;
</span><span class="cx">     for (size_t i = 0; i < expected.size(); ++i) {
</span><del>-        if (actual.first[i].type() != expected[i].type())
</del><ins>+        if (actual.first[i] != expected[i])
</ins><span class="cx">             return false;
</span><del>-        if (actual.first[i].stringArgument() != expected[i].stringArgument())
-            return false;
</del><span class="cx">     }
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="lines">@@ -932,35 +910,35 @@
</span><span class="cx"> {
</span><span class="cx">     using namespace ContentExtensions;
</span><span class="cx">     auto backend1 = makeBackend("[{\"action\":{\"type\":\"notify\",\"notification\":\"testnotification\"},\"trigger\":{\"url-filter\":\"matches\"}}]");
</span><del>-    ASSERT_TRUE(actionsEqual(allActionsForResourceLoad(backend1, mainDocumentRequest("test:///matches")), Vector<Action>::from(Action { ContentExtensions::ActionType::Notify, "testnotification" })));
</del><ins>+    ASSERT_TRUE(actionsEqual(allActionsForResourceLoad(backend1, mainDocumentRequest("test:///matches")), Vector<Action>::from(Action { ContentExtensions::NotifyAction { { "testnotification" } } })));
</ins><span class="cx"> 
</span><span class="cx">     auto backend2 = makeBackend(jsonWithStringsToCombine);
</span><del>-    ASSERT_TRUE(actionsEqual(allActionsForResourceLoad(backend2, mainDocumentRequest("http://A")), Vector<Action>::from(Action { ContentExtensions::ActionType::Notify, "AAA" })));
-    ASSERT_TRUE(actionsEqual(allActionsForResourceLoad(backend2, mainDocumentRequest("http://B")), Vector<Action>::from(Action { ContentExtensions::ActionType::Notify, "BBB" })));
-    ASSERT_TRUE(actionsEqual(allActionsForResourceLoad(backend2, mainDocumentRequest("http://C")), Vector<Action>::from(Action { ContentExtensions::ActionType::CSSDisplayNoneSelector, "CCC,selectorCombinedWithC" })));
-    ASSERT_TRUE(actionsEqual(allActionsForResourceLoad(backend2, mainDocumentRequest("http://D")), Vector<Action>::from(Action { ContentExtensions::ActionType::CSSDisplayNoneSelector, "DDD" })));
</del><ins>+    ASSERT_TRUE(actionsEqual(allActionsForResourceLoad(backend2, mainDocumentRequest("http://A")), Vector<Action>::from(Action { ContentExtensions::NotifyAction { { "AAA" } } })));
+    ASSERT_TRUE(actionsEqual(allActionsForResourceLoad(backend2, mainDocumentRequest("http://B")), Vector<Action>::from(Action { ContentExtensions::NotifyAction { { "BBB" } } })));
+    ASSERT_TRUE(actionsEqual(allActionsForResourceLoad(backend2, mainDocumentRequest("http://C")), Vector<Action>::from(Action { ContentExtensions::CSSDisplayNoneSelectorAction { { "CCC,selectorCombinedWithC" } } })));
+    ASSERT_TRUE(actionsEqual(allActionsForResourceLoad(backend2, mainDocumentRequest("http://D")), Vector<Action>::from(Action { ContentExtensions::CSSDisplayNoneSelectorAction { { "DDD" } } })));
</ins><span class="cx">     ASSERT_TRUE(actionsEqual(allActionsForResourceLoad(backend2, mainDocumentRequest("http://E")), { }, true));
</span><del>-    ASSERT_TRUE(actionsEqual(allActionsForResourceLoad(backend2, mainDocumentRequest("http://F")), Vector<Action>::from(Action { ContentExtensions::ActionType::BlockLoad })));
-    ASSERT_TRUE(actionsEqual(allActionsForResourceLoad(backend2, mainDocumentRequest("http://G")), Vector<Action>::from(Action { ContentExtensions::ActionType::Notify, "GGG" })));
-    ASSERT_TRUE(actionsEqual(allActionsForResourceLoad(backend2, mainDocumentRequest("http://GIK")), Vector<Action>::from(Action { ContentExtensions::ActionType::Notify, "GGG" })));
</del><ins>+    ASSERT_TRUE(actionsEqual(allActionsForResourceLoad(backend2, mainDocumentRequest("http://F")), Vector<Action>::from(Action { ContentExtensions::BlockLoadAction() })));
+    ASSERT_TRUE(actionsEqual(allActionsForResourceLoad(backend2, mainDocumentRequest("http://G")), Vector<Action>::from(Action { ContentExtensions::NotifyAction { { "GGG" } } })));
+    ASSERT_TRUE(actionsEqual(allActionsForResourceLoad(backend2, mainDocumentRequest("http://GIK")), Vector<Action>::from(Action { ContentExtensions::NotifyAction { { "GGG" } } })));
</ins><span class="cx">     ASSERT_TRUE(actionsEqual(allActionsForResourceLoad(backend2, mainDocumentRequest("http://AJ")), Vector<Action>::from(
</span><del>-        Action { ContentExtensions::ActionType::Notify, "AAA" },
-        Action { ContentExtensions::ActionType::Notify, "AAA" } // ignore-previous-rules makes the AAA actions need to be unique.
</del><ins>+    Action { ContentExtensions::NotifyAction { { "AAA" } } },
+    Action { ContentExtensions::NotifyAction { { "AAA" } } } // ignore-previous-rules makes the AAA actions need to be unique.
</ins><span class="cx">     )));
</span><span class="cx">     // FIXME: Add a test that matches actions with AAA with ignore-previous-rules between them and makes sure we only get one notification.
</span><span class="cx">     ASSERT_TRUE(actionsEqual(allActionsForResourceLoad(backend2, mainDocumentRequest("http://AE")), { }, true));
</span><span class="cx">     ASSERT_TRUE(actionsEqual(allActionsForResourceLoad(backend2, mainDocumentRequest("http://ABCDE")), { }, true));
</span><span class="cx">     ASSERT_TRUE(actionsEqual(allActionsForResourceLoad(backend2, mainDocumentRequest("http://ABCDEFG")), Vector<Action>::from(
</span><del>-        Action { ContentExtensions::ActionType::Notify, "GGG" },
-        Action { ContentExtensions::ActionType::BlockLoad }
</del><ins>+        Action { ContentExtensions::NotifyAction { { "GGG" } } },
+        Action { ContentExtensions::BlockLoadAction() }
</ins><span class="cx">     ), true));
</span><span class="cx">     ASSERT_TRUE(actionsEqual(allActionsForResourceLoad(backend2, mainDocumentRequest("http://FG")), Vector<Action>::from(
</span><del>-        Action { ContentExtensions::ActionType::Notify, "GGG" },
-        Action { ContentExtensions::ActionType::BlockLoad }
</del><ins>+        Action { ContentExtensions::NotifyAction { { "GGG" } } },
+        Action { ContentExtensions::BlockLoadAction() }
</ins><span class="cx">     )));
</span><span class="cx">     ASSERT_TRUE(actionsEqual(allActionsForResourceLoad(backend2, mainDocumentRequest("http://EFG")), Vector<Action>::from(
</span><del>-        Action { ContentExtensions::ActionType::Notify, "GGG" },
-        Action { ContentExtensions::ActionType::BlockLoad }
</del><ins>+        Action { ContentExtensions::NotifyAction { { "GGG" } } },
+        Action { ContentExtensions::BlockLoadAction() }
</ins><span class="cx">     ), true));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1019,16 +997,16 @@
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^pre9(.+)?post9$\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^pre0(.?)+post0$\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("pre1://webkit.org/post1"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("pre2://webkit.org/post2"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("pre3://webkit.org/post3"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("pre4://webkit.org/post4"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("pre5://webkit.org/post5"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("pre6://webkit.org/post6"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("pre7://webkit.org/post7"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("pre8://webkit.org/post8"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("pre9://webkit.org/post9"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("pre0://webkit.org/post0"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("pre1://webkit.org/post1"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("pre2://webkit.org/post2"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("pre3://webkit.org/post3"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("pre4://webkit.org/post4"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("pre5://webkit.org/post5"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("pre6://webkit.org/post6"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("pre7://webkit.org/post7"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("pre8://webkit.org/post8"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("pre9://webkit.org/post9"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("pre0://webkit.org/post0"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("pre1://webkit.org/post2"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("pre2://webkit.org/post3"), { });
</span><span class="lines">@@ -1060,15 +1038,15 @@
</span><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("https://webkit.org/"), { });
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("foo://webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://foo.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://webkit.foo/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://webkit.org/foo"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("foo://webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://foo.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://webkit.foo/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://webkit.org/foo"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("bar://webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://bar.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://webkit.bar/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://webkit.org/bar"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("bar://webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://bar.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://webkit.bar/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://webkit.org/bar"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TEST_F(ContentExtensionTest, TrailingTermsCarryingNoData)
</span><span class="lines">@@ -1080,31 +1058,31 @@
</span><span class="cx">     testRequest(backend, mainDocumentRequest("https://webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     // Anything is fine after foo.
</span><del>-    testRequest(backend, mainDocumentRequest("https://webkit.org/foo"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://webkit.org/foob"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://webkit.org/fooc"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://webkit.org/fooba"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://webkit.org/foobar"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://webkit.org/foobar-stuff"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("https://webkit.org/foo"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://webkit.org/foob"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://webkit.org/fooc"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://webkit.org/fooba"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://webkit.org/foobar"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://webkit.org/foobar-stuff"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><span class="cx">     // Bazooka has to be at the tail without any character not defined by the filter.
</span><span class="cx">     testRequest(backend, mainDocumentRequest("https://webkit.org/baz"), { });
</span><del>-    testRequest(backend, mainDocumentRequest("https://webkit.org/bazo"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://webkit.org/bazoa"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("https://webkit.org/bazo"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://webkit.org/bazoa"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("https://webkit.org/bazob"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("https://webkit.org/bazoo"), { });
</span><del>-    testRequest(backend, mainDocumentRequest("https://webkit.org/bazook"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("https://webkit.org/bazook"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("https://webkit.org/bazookb"), { });
</span><del>-    testRequest(backend, mainDocumentRequest("https://webkit.org/bazooka"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("https://webkit.org/bazooka"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("https://webkit.org/bazookaa"), { });
</span><span class="cx"> 
</span><span class="cx">     // The pattern must finish with cat, with any number of 's' following it, but no other character.
</span><span class="cx">     testRequest(backend, mainDocumentRequest("https://cat.org/"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("https://cats.org/"), { });
</span><del>-    testRequest(backend, mainDocumentRequest("https://webkit.org/cat"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://webkit.org/cats"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://webkit.org/catss"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://webkit.org/catsss"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("https://webkit.org/cat"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://webkit.org/cats"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://webkit.org/catss"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://webkit.org/catsss"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("https://webkit.org/catso"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1145,13 +1123,13 @@
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"alwaysblock.pdf\"}}]");
</span><span class="cx">     
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org"), { });
</span><del>-    testRequest(backend, {URL(URL(), "http://webkit.org"), URL(URL(), "http://not_webkit.org"), ResourceType::Document}, { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, { URL(URL(), "http://webkit.org"), URL(URL(), "http://not_webkit.org"), ResourceType::Document }, { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">         
</span><del>-    testRequest(backend, mainDocumentRequest("http://whatwg.org"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, {URL(URL(), "http://whatwg.org"), URL(URL(), "http://not_whatwg.org"), ResourceType::Document}, { });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://whatwg.org"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, { URL(URL(), "http://whatwg.org"), URL(URL(), "http://not_whatwg.org"), ResourceType::Document }, { });
</ins><span class="cx">     
</span><del>-    testRequest(backend, mainDocumentRequest("http://foobar.org/alwaysblock.pdf"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, {URL(URL(), "http://foobar.org/alwaysblock.pdf"), URL(URL(), "http://not_foobar.org/alwaysblock.pdf"), ResourceType::Document}, { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://foobar.org/alwaysblock.pdf"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, { URL(URL(), "http://foobar.org/alwaysblock.pdf"), URL(URL(), "http://not_foobar.org/alwaysblock.pdf"), ResourceType::Document }, { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TEST_F(ContentExtensionTest, ResourceType)
</span><span class="lines">@@ -1159,16 +1137,16 @@
</span><span class="cx">     auto backend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"block_all_types.org\",\"resource-type\":[\"document\",\"image\",\"style-sheet\",\"script\",\"font\",\"raw\",\"svg-document\",\"media\",\"popup\"]}},"
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"block_only_images\",\"resource-type\":[\"image\"]}}]");
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("http://block_all_types.org", ResourceType::Document), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://block_all_types.org", ResourceType::Image), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://block_all_types.org", ResourceType::StyleSheet), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://block_all_types.org", ResourceType::Script), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://block_all_types.org", ResourceType::Font), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://block_all_types.org", ResourceType::Other), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://block_all_types.org", ResourceType::SVGDocument), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://block_all_types.org", ResourceType::Media), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://block_all_types.org", ResourceType::Popup), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://block_only_images.org", ResourceType::Image), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://block_all_types.org", ResourceType::Document), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://block_all_types.org", ResourceType::Image), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://block_all_types.org", ResourceType::StyleSheet), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://block_all_types.org", ResourceType::Script), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://block_all_types.org", ResourceType::Font), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://block_all_types.org", ResourceType::Other), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://block_all_types.org", ResourceType::SVGDocument), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://block_all_types.org", ResourceType::Media), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://block_all_types.org", ResourceType::Popup), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://block_only_images.org", ResourceType::Image), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("http://block_only_images.org", ResourceType::Document), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1178,7 +1156,7 @@
</span><span class="cx">     
</span><span class="cx">     testRequest(backend, subResourceRequest("http://webkit.org/BlockOnlyIfThirdPartyAndScript.js", "http://webkit.org", ResourceType::Script), { });
</span><span class="cx">     testRequest(backend, subResourceRequest("http://webkit.org/BlockOnlyIfThirdPartyAndScript.png", "http://not_webkit.org", ResourceType::Image), { });
</span><del>-    testRequest(backend, subResourceRequest("http://webkit.org/BlockOnlyIfThirdPartyAndScript.js", "http://not_webkit.org", ResourceType::Script), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, subResourceRequest("http://webkit.org/BlockOnlyIfThirdPartyAndScript.js", "http://not_webkit.org", ResourceType::Script), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TEST_F(ContentExtensionTest, ResourceOrLoadTypeMatchingEverything)
</span><span class="lines">@@ -1188,8 +1166,8 @@
</span><span class="cx">         "{\"action\":{\"type\":\"ignore-previous-rules\"},\"trigger\":{\"url-filter\":\".*\",\"load-type\":[\"first-party\"]}}]");
</span><span class="cx">     
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org"), { }, 0);
</span><del>-    testRequest(backend, {URL(URL(), "http://webkit.org"), URL(URL(), "http://not_webkit.org"), ResourceType::Document}, { ContentExtensions::ActionType::BlockCookies });
-    testRequest(backend, {URL(URL(), "http://webkit.org"), URL(URL(), "http://not_webkit.org"), ResourceType::Image}, { ContentExtensions::ActionType::BlockCookies, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, { URL(URL(), "http://webkit.org"), URL(URL(), "http://not_webkit.org"), ResourceType::Document }, { variantIndex<ContentExtensions::BlockCookiesAction> });
+    testRequest(backend, { URL(URL(), "http://webkit.org"), URL(URL(), "http://not_webkit.org"), ResourceType::Image }, { variantIndex<ContentExtensions::BlockCookiesAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> TEST_F(ContentExtensionTest, WideNFA)
</span><span class="lines">@@ -1226,11 +1204,11 @@
</span><span class="cx">     
</span><span class="cx">     auto backend = makeBackend(ruleList.toString().utf8().data());
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("http://webkit.org/AAA"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/YAA"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://webkit.org/AAA"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/YAA"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/ZAA"), { }, 0);
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/LAA/AAA"), { }, 0);
</span><del>-    testRequest(backend, mainDocumentRequest("http://webkit.org/LAA/MAA"), { ContentExtensions::ActionType::CSSDisplayNoneSelector }, 0);
</del><ins>+    testRequest(backend, mainDocumentRequest("http://webkit.org/LAA/MAA"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> }, 0);
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/"), { });
</span><span class="cx"> }
</span><span class="cx">     
</span><span class="lines">@@ -1408,50 +1386,50 @@
</span><span class="cx">     
</span><span class="cx">     auto backend2 = makeBackend("[{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\".*\",\"if-domain\":[\"webkit.org\"]}}]");
</span><span class="cx">     EXPECT_EQ(nullptr, backend2.globalDisplayNoneStyleSheet("testFilter"_s));
</span><del>-    testRequest(backend2, mainDocumentRequest("http://webkit.org"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(backend2, mainDocumentRequest("http://webkit.org"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(backend2, mainDocumentRequest("http://w3c.org"), { });
</span><span class="cx">     
</span><span class="cx">     auto backend3 = makeBackend("[{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\".*\",\"unless-domain\":[\"webkit.org\"]}}]");
</span><span class="cx">     EXPECT_EQ(nullptr, backend3.globalDisplayNoneStyleSheet("testFilter"_s));
</span><span class="cx">     testRequest(backend3, mainDocumentRequest("http://webkit.org"), { });
</span><del>-    testRequest(backend3, mainDocumentRequest("http://w3c.org"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(backend3, mainDocumentRequest("http://w3c.org"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     
</span><span class="cx">     auto backend4 = makeBackend("[{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\".*\",\"load-type\":[\"third-party\"]}}]");
</span><span class="cx">     EXPECT_EQ(nullptr, backend4.globalDisplayNoneStyleSheet("testFilter"_s));
</span><span class="cx">     testRequest(backend4, mainDocumentRequest("http://webkit.org"), { });
</span><del>-    testRequest(backend4, subResourceRequest("http://not_webkit.org", "http://webkit.org"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(backend4, subResourceRequest("http://not_webkit.org", "http://webkit.org"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx"> 
</span><span class="cx">     // css-display-none rules after ignore-previous-rules should not be put in the default stylesheet.
</span><span class="cx">     auto backend5 = makeBackend("[{\"action\":{\"type\":\"ignore-previous-rules\"},\"trigger\":{\"url-filter\":\".*\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\".*\"}}]");
</span><span class="cx">     EXPECT_EQ(nullptr, backend5.globalDisplayNoneStyleSheet("testFilter"_s));
</span><del>-    testRequest(backend5, mainDocumentRequest("http://webkit.org"), { ContentExtensions::ActionType::CSSDisplayNoneSelector }, 0);
</del><ins>+    testRequest(backend5, mainDocumentRequest("http://webkit.org"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> }, 0);
</ins><span class="cx">     
</span><span class="cx">     auto backend6 = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\".*\",\"if-domain\":[\"webkit.org\",\"*w3c.org\"],\"resource-type\":[\"document\",\"script\"]}},"
</span><span class="cx">         "{\"action\":{\"type\":\"ignore-previous-rules\"},\"trigger\":{\"url-filter\":\"ignore\",\"if-domain\":[\"*webkit.org\",\"w3c.org\"]}},"
</span><span class="cx">         "{\"action\":{\"type\":\"block-cookies\"},\"trigger\":{\"url-filter\":\".*\",\"unless-domain\":[\"webkit.org\",\"whatwg.org\"],\"resource-type\":[\"script\",\"image\"],\"load-type\":[\"third-party\"]}}]");
</span><span class="cx">     EXPECT_EQ(nullptr, backend6.globalDisplayNoneStyleSheet("testFilter"_s));
</span><del>-    testRequest(backend6, mainDocumentRequest("http://webkit.org"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend6, mainDocumentRequest("http://w3c.org"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend6, mainDocumentRequest("http://webkit.org"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend6, mainDocumentRequest("http://w3c.org"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend6, mainDocumentRequest("http://whatwg.org"), { });
</span><span class="cx">     testRequest(backend6, mainDocumentRequest("http://sub.webkit.org"), { });
</span><del>-    testRequest(backend6, mainDocumentRequest("http://sub.w3c.org"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend6, mainDocumentRequest("http://sub.w3c.org"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend6, mainDocumentRequest("http://sub.whatwg.org"), { });
</span><span class="cx">     testRequest(backend6, mainDocumentRequest("http://webkit.org/ignore"), { }, 0);
</span><span class="cx">     testRequest(backend6, mainDocumentRequest("http://w3c.org/ignore"), { }, 0);
</span><span class="cx">     testRequest(backend6, mainDocumentRequest("http://whatwg.org/ignore"), { });
</span><span class="cx">     testRequest(backend6, mainDocumentRequest("http://sub.webkit.org/ignore"), { }, 0);
</span><del>-    testRequest(backend6, mainDocumentRequest("http://sub.w3c.org/ignore"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend6, mainDocumentRequest("http://sub.w3c.org/ignore"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend6, mainDocumentRequest("http://sub.whatwg.org/ignore"), { });
</span><span class="cx">     testRequest(backend6, subResourceRequest("http://example.com/image.png", "http://webkit.org/", ResourceType::Image), { });
</span><del>-    testRequest(backend6, subResourceRequest("http://example.com/image.png", "http://w3c.org/", ResourceType::Image), { ContentExtensions::ActionType::BlockCookies });
-    testRequest(backend6, subResourceRequest("http://example.com/doc.html", "http://webkit.org/", ResourceType::Document), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend6, subResourceRequest("http://example.com/script.js", "http://webkit.org/", ResourceType::Script), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend6, subResourceRequest("http://example.com/script.js", "http://w3c.org/", ResourceType::Script), { ContentExtensions::ActionType::BlockCookies, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend6, subResourceRequest("http://example.com/image.png", "http://w3c.org/", ResourceType::Image), { variantIndex<ContentExtensions::BlockCookiesAction> });
+    testRequest(backend6, subResourceRequest("http://example.com/doc.html", "http://webkit.org/", ResourceType::Document), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend6, subResourceRequest("http://example.com/script.js", "http://webkit.org/", ResourceType::Script), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend6, subResourceRequest("http://example.com/script.js", "http://w3c.org/", ResourceType::Script), { variantIndex<ContentExtensions::BlockCookiesAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend6, subResourceRequest("http://example.com/script.js", "http://example.com/", ResourceType::Script), { });
</span><span class="cx">     testRequest(backend6, subResourceRequest("http://example.com/ignore/image.png", "http://webkit.org/", ResourceType::Image), { }, 0);
</span><span class="cx">     testRequest(backend6, subResourceRequest("http://example.com/ignore/image.png", "http://example.com/", ResourceType::Image), { });
</span><del>-    testRequest(backend6, subResourceRequest("http://example.com/ignore/image.png", "http://example.org/", ResourceType::Image), { ContentExtensions::ActionType::BlockCookies });
</del><ins>+    testRequest(backend6, subResourceRequest("http://example.com/ignore/image.png", "http://example.org/", ResourceType::Image), { variantIndex<ContentExtensions::BlockCookiesAction> });
</ins><span class="cx">     testRequest(backend6, subResourceRequest("http://example.com/doc.html", "http://example.org/", ResourceType::Document), { });
</span><span class="cx">     testRequest(backend6, subResourceRequest("http://example.com/", "http://example.com/", ResourceType::Font), { });
</span><span class="cx">     testRequest(backend6, subResourceRequest("http://example.com/ignore", "http://webkit.org/", ResourceType::Image), { }, 0);
</span><span class="lines">@@ -1579,13 +1557,13 @@
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"bar$\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^[ab]+bang\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("http://webkit.org/foo"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("foo://webkit.org/bar"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/bar"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("bar://webkit.org/bar"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://webkit.org/foo"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("foo://webkit.org/bar"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/bar"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("bar://webkit.org/bar"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("abang://webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("bbang://webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("abang://webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("bbang://webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("cbang://webkit.org/"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/bang"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("bang://webkit.org/"), { });
</span><span class="lines">@@ -1614,14 +1592,14 @@
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"[a-c]+b+oom\"}}]");
</span><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/"), { });
</span><del>-    testRequest(backend, mainDocumentRequest("foo://webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("webkit://webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("foo://webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("webkit://webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://bar.org/"), { });
</span><del>-    testRequest(backend, mainDocumentRequest("http://abar.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://bbar.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://cbar.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://abcbar.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://abar.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://bbar.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://cbar.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://abcbar.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("http://dbar.org/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1645,16 +1623,16 @@
</span><span class="cx">         "{\"action\":{\"type\":\"ignore-previous-rules\"},\"trigger\":{\"url-filter\":\"A*BA+\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"make-https\"},\"trigger\":{\"url-filter\":\"A*BC\"}}]");
</span><span class="cx">     
</span><del>-    testRequest(backend, mainDocumentRequest("http://webkit.org/D"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/AAD"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://webkit.org/D"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/AAD"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/AB"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/ABA"), { }, 0);
</span><span class="cx">     testRequest(backend, mainDocumentRequest("http://webkit.org/ABAD"), { }, 0);
</span><del>-    testRequest(backend, mainDocumentRequest("http://webkit.org/BC"), { ContentExtensions::ActionType::MakeHTTPS });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/ABC"), { ContentExtensions::ActionType::MakeHTTPS });
-    testRequest(backend, mainDocumentRequest("http://webkit.org/ABABC"), { ContentExtensions::ActionType::MakeHTTPS }, 0);
-    testRequest(backend, mainDocumentRequest("http://webkit.org/ABABCAD"), { ContentExtensions::ActionType::MakeHTTPS }, 0);
-    testRequest(backend, mainDocumentRequest("http://webkit.org/ABCAD"), { ContentExtensions::ActionType::MakeHTTPS, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://webkit.org/BC"), { variantIndex<ContentExtensions::MakeHTTPSAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/ABC"), { variantIndex<ContentExtensions::MakeHTTPSAction> });
+    testRequest(backend, mainDocumentRequest("http://webkit.org/ABABC"), { variantIndex<ContentExtensions::MakeHTTPSAction> }, 0);
+    testRequest(backend, mainDocumentRequest("http://webkit.org/ABABCAD"), { variantIndex<ContentExtensions::MakeHTTPSAction> }, 0);
+    testRequest(backend, mainDocumentRequest("http://webkit.org/ABCAD"), { variantIndex<ContentExtensions::MakeHTTPSAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> TEST_F(ContentExtensionTest, StrictPrefixSeparatedMachines3Partitioning)
</span><span class="lines">@@ -1837,17 +1815,17 @@
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^http://foo.com/\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^http://bar.com/\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("http://foo.com/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("http://bar.com/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://foo.com/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("http://bar.com/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("attp://foo.com/"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("attp://bar.com/"), { });
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("http://webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("bttp://webkit.org/"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("bttps://webkit.org/"), { });
</span><del>-    testRequest(backend, mainDocumentRequest("http://webkit.org/b"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://webkit.org/b"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://webkit.org/b"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://webkit.org/b"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("cttp://webkit.org/B"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("cttps://webkit.org/B"), { });
</span><span class="cx"> }
</span><span class="lines">@@ -1858,12 +1836,12 @@
</span><span class="cx">         "{\"action\":{\"type\":\"block-cookies\"},\"trigger\":{\"url-filter\":\"^https://www.webkit.org/\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"block-cookies\"},\"trigger\":{\"url-filter\":\"^attps://www.webkit.org/\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("http://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://www.webkit.org/"), { ContentExtensions::ActionType::BlockCookies });
-    testRequest(backend, mainDocumentRequest("attps://www.webkit.org/"), { ContentExtensions::ActionType::BlockCookies });
-    testRequest(backend, mainDocumentRequest("http://www.webkit.org/a"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://www.webkit.org/B"), { ContentExtensions::ActionType::BlockCookies });
-    testRequest(backend, mainDocumentRequest("attps://www.webkit.org/c"), { ContentExtensions::ActionType::BlockCookies });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://www.webkit.org/"), { variantIndex<ContentExtensions::BlockCookiesAction> });
+    testRequest(backend, mainDocumentRequest("attps://www.webkit.org/"), { variantIndex<ContentExtensions::BlockCookiesAction> });
+    testRequest(backend, mainDocumentRequest("http://www.webkit.org/a"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://www.webkit.org/B"), { variantIndex<ContentExtensions::BlockCookiesAction> });
+    testRequest(backend, mainDocumentRequest("attps://www.webkit.org/c"), { variantIndex<ContentExtensions::BlockCookiesAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("http://www.whatwg.org/"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("https://www.whatwg.org/"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("attps://www.whatwg.org/"), { });
</span><span class="lines">@@ -1875,8 +1853,8 @@
</span><span class="cx">         "{\"action\":{\"type\":\"block-cookies\"},\"trigger\":{\"url-filter\":\"^https://www.webkit.org/\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\", \"selector\":\"#foo\"},\"trigger\":{\"url-filter\":\"^https://www.webkit.org/\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("http://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("https://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockCookies });
</del><ins>+    testRequest(backend, mainDocumentRequest("http://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("https://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockCookiesAction> });
</ins><span class="cx">     testRequest(backend, mainDocumentRequest("https://www.whatwg.org/"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("attps://www.whatwg.org/"), { });
</span><span class="cx"> }
</span><span class="lines">@@ -1891,11 +1869,11 @@
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^bbc\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^BCC\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("aza://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("bza://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("bac://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("bbc://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("bcc://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("aza://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("bza://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("bac://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("bbc://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("bcc://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("aac://www.webkit.org/"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("abc://www.webkit.org/"), { });
</span><span class="lines">@@ -1913,11 +1891,11 @@
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^a.a\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^b.a\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("aza://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("bza://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("bac://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("bbc://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("bcc://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("aza://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("bza://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("bac://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("bbc://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("bcc://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("aac://www.webkit.org/"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("abc://www.webkit.org/"), { });
</span><span class="lines">@@ -1935,11 +1913,11 @@
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^bba\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^BCA\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("azc://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("bzc://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("baa://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("bba://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("bca://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("azc://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("bzc://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("baa://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("bba://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("bca://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("aaa://www.webkit.org/"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("aba://www.webkit.org/"), { });
</span><span class="lines">@@ -1957,11 +1935,11 @@
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^a.c\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^b.c\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("azc://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("bzc://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("baa://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("bba://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("bca://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("azc://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("bzc://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("baa://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("bba://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("bca://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("aaa://www.webkit.org/"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("aba://www.webkit.org/"), { });
</span><span class="lines">@@ -1978,10 +1956,10 @@
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^a.c\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^b.c\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("aac://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("abc://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("bac://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("abc://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("aac://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("abc://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("bac://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("abc://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("aaa://www.webkit.org/"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("aca://www.webkit.org/"), { });
</span><span class="lines">@@ -1993,10 +1971,10 @@
</span><span class="cx">     auto backend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^a.bc.de\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^a.bd.ef\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("abbccde://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("aabcdde://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("aabddef://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("aabddef://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("abbccde://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("aabcdde://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("aabddef://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("aabddef://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("abcde://www.webkit.org/"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("abdef://www.webkit.org/"), { });
</span><span class="lines">@@ -2007,10 +1985,10 @@
</span><span class="cx">     auto backend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^cb.\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^db.b\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(backend, mainDocumentRequest("cba://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("cbb://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("dbab://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest("dbxb://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(backend, mainDocumentRequest("cba://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("cbb://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("dbab://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(backend, mainDocumentRequest("dbxb://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx"> 
</span><span class="cx">     testRequest(backend, mainDocumentRequest("cca://www.webkit.org/"), { });
</span><span class="cx">     testRequest(backend, mainDocumentRequest("dddd://www.webkit.org/"), { });
</span><span class="lines">@@ -2077,24 +2055,24 @@
</span><span class="cx">     auto matchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^[a-m]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"ignore-previous-rules\"},\"trigger\":{\"url-filter\":\"^[c-e]\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("b://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("b://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { }, 0);
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { }, 0);
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { }, 0);
</span><del>-    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("m://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("m://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("n://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"[a-m]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"ignore-previous-rules\"},\"trigger\":{\"url-filter\":\"[c-e]\"}}]");
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.b.xxx/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.b.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.c.xxx/"), { }, 0);
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { }, 0);
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { }, 0);
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.m.xxx/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.m.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.n.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2103,18 +2081,18 @@
</span><span class="cx">     auto matchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^[a-m]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"ignore-previous-rules\"},\"trigger\":{\"url-filter\":\"^b\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("b://www.webkit.org/"), { }, 0);
</span><del>-    testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("m://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("m://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("n://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"[a-m]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"ignore-previous-rules\"},\"trigger\":{\"url-filter\":\"l\"}}]");
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.k.xxx/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.k.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.l.xxx/"), { }, 0);
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.m.xxx/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.m.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.n.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2123,20 +2101,20 @@
</span><span class="cx">     auto matchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^[b-d]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"^[a-m]\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(matchBackend, mainDocumentRequest("b://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(matchBackend, mainDocumentRequest("m://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(matchBackend, mainDocumentRequest("b://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(matchBackend, mainDocumentRequest("m://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("n://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"[b-d]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"[a-m]\"}}]");
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.b.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.m.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.b.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.m.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.n.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2145,18 +2123,18 @@
</span><span class="cx">     auto matchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^l\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"^[a-m]\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(matchBackend, mainDocumentRequest("k://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(matchBackend, mainDocumentRequest("l://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("m://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(matchBackend, mainDocumentRequest("k://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(matchBackend, mainDocumentRequest("l://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("m://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("n://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"l\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"[a-m]\"}}]");
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.k.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.l.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.m.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.k.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.l.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.m.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.n.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2165,20 +2143,20 @@
</span><span class="cx">     auto matchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^[a-e]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"^[e-h]\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(matchBackend, mainDocumentRequest("h://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(matchBackend, mainDocumentRequest("h://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("i://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"[a-e]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"[e-h]\"}}]");
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.h.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.h.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.i.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2189,9 +2167,9 @@
</span><span class="cx"> 
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { });
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { });
</span><del>-    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(matchBackend, mainDocumentRequest("h://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(matchBackend, mainDocumentRequest("h://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("i://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"e\"}},"
</span><span class="lines">@@ -2198,9 +2176,9 @@
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"[e-h]\"}}]");
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.h.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.h.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.i.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2209,16 +2187,16 @@
</span><span class="cx">     auto matchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^[a-e]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"^e\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"[a-e]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"e\"}}]");
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2227,20 +2205,20 @@
</span><span class="cx">     auto matchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^[e-h]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"^[a-e]\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("h://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("h://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("i://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"[e-h]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"[a-e]\"}}]");
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.h.xxx/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.h.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.i.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2249,16 +2227,16 @@
</span><span class="cx">     auto matchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^e\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"^[a-e]\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"e\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"[a-e]\"}}]");
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2269,9 +2247,9 @@
</span><span class="cx"> 
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { });
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { });
</span><del>-    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("h://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("h://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("i://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"[e-h]\"}},"
</span><span class="lines">@@ -2278,9 +2256,9 @@
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"e\"}}]");
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.h.xxx/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.h.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.i.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2290,19 +2268,19 @@
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"^[d-f]\"}}]");
</span><span class="cx"> 
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { });
</span><del>-    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("g://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("g://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("h://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"[e-g]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"[d-f]\"}}]");
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.c.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.g.xxx/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.g.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.h.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2313,19 +2291,19 @@
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"^[d-g]\"}}]");
</span><span class="cx"> 
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { });
</span><del>-    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("g://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("g://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("h://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"[e-g]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"[d-g]\"}}]");
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.c.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.g.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.g.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.h.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2335,19 +2313,19 @@
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"^[c-e]\"}}]");
</span><span class="cx"> 
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { });
</span><del>-    testRequest(matchBackend, mainDocumentRequest("b://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("b://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("h://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"[b-d]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"[c-e]\"}}]");
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.b.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.c.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.b.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.c.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.h.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2357,19 +2335,19 @@
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"^[c-e]\"}}]");
</span><span class="cx"> 
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { });
</span><del>-    testRequest(matchBackend, mainDocumentRequest("b://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("b://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("h://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"[b-e]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"[c-e]\"}}]");
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.b.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.c.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.b.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.c.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.h.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2380,10 +2358,10 @@
</span><span class="cx"> 
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { });
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("b://www.webkit.org/"), { });
</span><del>-    testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("g://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"[c-f]\"}},"
</span><span class="lines">@@ -2390,10 +2368,10 @@
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"[c-f]\"}}]");
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.b.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.c.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.c.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.g.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2404,7 +2382,7 @@
</span><span class="cx"> 
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { });
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("b://www.webkit.org/"), { });
</span><del>-    testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { });
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="lines">@@ -2412,7 +2390,7 @@
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"c\"}}]");
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.b.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.c.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.c.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { });
</span><span class="cx"> }
</span><span class="lines">@@ -2444,9 +2422,9 @@
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.beyyy.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.bfyyy.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.bgyyy.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.bhyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.biyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.bjyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.bhyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.biyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.bjyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.bkyyy.xxx/"), { });
</span><span class="cx"> 
</span><span class="cx">     // 'c' is the first character of the first rule, and it overlaps the first character of the second rule.
</span><span class="lines">@@ -2457,24 +2435,24 @@
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.cdyyy.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.ceyyy.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.cfyyy.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.cgyyy.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.chyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.ciyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.cjyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.cgyyy.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.chyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.ciyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.cjyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.ckyyy.xxx/"), { });
</span><span class="cx"> 
</span><span class="cx">     // 'd' is in the first range of both rule. This series cover overlaps between the two rules.
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.dgyyy.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddgyyy.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddhyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddhhyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.degyyy.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.dehyyy.xxx/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.dgyyy.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddgyyy.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddhyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddhhyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.degyyy.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.dehyyy.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.dfgyyy.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.dfhyyy.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.djyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddjyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddjjyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.djyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddjyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddjjyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TEST_F(ContentExtensionTest, QuantifiedOneOrMoreRangesCase11And13InGroups)
</span><span class="lines">@@ -2504,9 +2482,9 @@
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.beyyy.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.bfyyy.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.bgyyy.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.bhyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.biyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.bjyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.bhyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.biyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.bjyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.bkyyy.xxx/"), { });
</span><span class="cx"> 
</span><span class="cx">     // 'c' is the first character of the first rule, and it overlaps the first character of the second rule.
</span><span class="lines">@@ -2517,24 +2495,24 @@
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.cdyyy.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.ceyyy.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.cfyyy.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.cgyyy.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.chyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.ciyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.cjyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.cgyyy.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.chyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.ciyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.cjyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.ckyyy.xxx/"), { });
</span><span class="cx"> 
</span><span class="cx">     // 'd' is in the first range of both rule. This series cover overlaps between the two rules.
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.dgyyy.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddgyyy.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddhyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddhhyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.degyyy.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.dehyyy.xxx/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.dgyyy.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddgyyy.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddhyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddhhyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.degyyy.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.dehyyy.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.dfgyyy.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.dfhyyy.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.djyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddjyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddjjyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.djyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddjyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddjjyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TEST_F(ContentExtensionTest, CombinedRangeOverlapCase1)
</span><span class="lines">@@ -2542,24 +2520,24 @@
</span><span class="cx">     auto matchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^(foo)*[a-m]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"ignore-previous-rules\"},\"trigger\":{\"url-filter\":\"^(bar)*[c-e]\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("b://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("b://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { }, 0);
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { }, 0);
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { }, 0);
</span><del>-    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("m://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("m://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("n://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"(foo)*[a-m]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"ignore-previous-rules\"},\"trigger\":{\"url-filter\":\"(bar)*[c-e]\"}}]");
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.b.xxx/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.b.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.c.xxx/"), { }, 0);
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { }, 0);
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { }, 0);
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.m.xxx/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.m.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.n.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2569,18 +2547,18 @@
</span><span class="cx">     auto matchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^(foo)*[a-m]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"ignore-previous-rules\"},\"trigger\":{\"url-filter\":\"^(bar)*b\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("b://www.webkit.org/"), { }, 0);
</span><del>-    testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("m://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("m://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("n://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"(foo)*[a-m]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"ignore-previous-rules\"},\"trigger\":{\"url-filter\":\"(bar)*l\"}}]");
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.k.xxx/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.k.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.l.xxx/"), { }, 0);
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.m.xxx/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.m.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.n.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2589,20 +2567,20 @@
</span><span class="cx">     auto matchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^(foo)*[b-d]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"^(bar)*[a-m]\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(matchBackend, mainDocumentRequest("b://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(matchBackend, mainDocumentRequest("m://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(matchBackend, mainDocumentRequest("b://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(matchBackend, mainDocumentRequest("m://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("n://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"(foo)*[b-d]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"(bar)*[a-m]\"}}]");
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.b.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.m.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.b.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.m.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.n.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2611,18 +2589,18 @@
</span><span class="cx">     auto matchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^(foo)*l\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"^(bar)*[a-m]\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(matchBackend, mainDocumentRequest("k://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(matchBackend, mainDocumentRequest("l://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("m://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(matchBackend, mainDocumentRequest("k://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(matchBackend, mainDocumentRequest("l://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("m://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("n://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"(foo)*l\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"(bar)*[a-m]\"}}]");
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.k.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.l.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.m.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.k.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.l.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.m.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.n.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2631,20 +2609,20 @@
</span><span class="cx">     auto matchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^(foo)*[a-e]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"^(bar)*[e-h]\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(matchBackend, mainDocumentRequest("h://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(matchBackend, mainDocumentRequest("h://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("i://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"(foo)*[a-e]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"(bar)*[e-h]\"}}]");
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.h.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.h.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.i.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2655,9 +2633,9 @@
</span><span class="cx"> 
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { });
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { });
</span><del>-    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(matchBackend, mainDocumentRequest("h://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(matchBackend, mainDocumentRequest("h://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("i://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"(foo)*e\"}},"
</span><span class="lines">@@ -2664,9 +2642,9 @@
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"(bar)*[e-h]\"}}]");
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.h.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.h.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.i.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2675,16 +2653,16 @@
</span><span class="cx">     auto matchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^(foo)*[a-e]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"^(bar)*e\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"(foo)*[a-e]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"(bar)*e\"}}]");
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2693,20 +2671,20 @@
</span><span class="cx">     auto matchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^(foo)*[e-h]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"^(bar)*[a-e]\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("h://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("h://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("i://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"(foo)*[e-h]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"(bar)*[a-e]\"}}]");
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.h.xxx/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.h.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.i.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2715,16 +2693,16 @@
</span><span class="cx">     auto matchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"^(foo)*e\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"^(bar)*[a-e]\"}}]");
</span><span class="cx"> 
</span><del>-    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"(foo)*e\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"(bar)*[a-e]\"}}]");
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2735,9 +2713,9 @@
</span><span class="cx"> 
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { });
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { });
</span><del>-    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("h://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("h://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("i://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"(foo)*[e-h]\"}},"
</span><span class="lines">@@ -2744,9 +2722,9 @@
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"(bar)*e\"}}]");
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.h.xxx/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.h.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.i.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2756,19 +2734,19 @@
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"^(bar)*[d-f]\"}}]");
</span><span class="cx"> 
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { });
</span><del>-    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("g://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("g://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("h://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"(foo)*[e-g]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"(bar)*[d-f]\"}}]");
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.c.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.g.xxx/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.g.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.h.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2779,19 +2757,19 @@
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"^(bar)*[d-g]\"}}]");
</span><span class="cx"> 
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { });
</span><del>-    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("g://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("g://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("h://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"(foo)*[e-g]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"(bar)*[d-g]\"}}]");
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.c.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.g.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.g.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.h.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2801,19 +2779,19 @@
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"^(bar)*[c-e]\"}}]");
</span><span class="cx"> 
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { });
</span><del>-    testRequest(matchBackend, mainDocumentRequest("b://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("b://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("h://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"(foo)*[b-d]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"(bar)*[c-e]\"}}]");
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.b.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.c.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.b.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.c.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.h.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2823,19 +2801,19 @@
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"^(bar)*[c-e]\"}}]");
</span><span class="cx"> 
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { });
</span><del>-    testRequest(matchBackend, mainDocumentRequest("b://www.webkit.org/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("b://www.webkit.org/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("h://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"(foo)*[b-e]\"}},"
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"(bar)*[c-e]\"}}]");
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.b.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.c.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.b.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.c.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.h.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2846,10 +2824,10 @@
</span><span class="cx"> 
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { });
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("b://www.webkit.org/"), { });
</span><del>-    testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(matchBackend, mainDocumentRequest("f://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("g://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="cx">     auto searchBackend = makeBackend("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"(foo)*[c-f]\"}},"
</span><span class="lines">@@ -2856,10 +2834,10 @@
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"(bar)*[c-f]\"}}]");
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.b.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.c.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.c.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.f.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.g.xxx/"), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2870,7 +2848,7 @@
</span><span class="cx"> 
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("a://www.webkit.org/"), { });
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("b://www.webkit.org/"), { });
</span><del>-    testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(matchBackend, mainDocumentRequest("c://www.webkit.org/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(matchBackend, mainDocumentRequest("d://www.webkit.org/"), { });
</span><span class="cx">     testRequest(matchBackend, mainDocumentRequest("e://www.webkit.org/"), { });
</span><span class="cx"> 
</span><span class="lines">@@ -2878,7 +2856,7 @@
</span><span class="cx">         "{\"action\":{\"type\":\"css-display-none\",\"selector\":\".hidden\"},\"trigger\":{\"url-filter\":\"(bar)*c\"}}]");
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.a.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.b.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.c.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.c.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.d.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.e.xxx/"), { });
</span><span class="cx"> }
</span><span class="lines">@@ -2910,9 +2888,9 @@
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.beyyy.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.bfyyy.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.bgyyy.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.bhyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.biyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.bjyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.bhyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.biyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.bjyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.bkyyy.xxx/"), { });
</span><span class="cx"> 
</span><span class="cx">     // 'c' is the first character of the first rule, and it overlaps the first character of the second rule.
</span><span class="lines">@@ -2923,24 +2901,24 @@
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.cdyyy.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.ceyyy.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.cfyyy.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.cgyyy.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.chyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.ciyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.cjyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.cgyyy.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.chyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.ciyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.cjyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.ckyyy.xxx/"), { });
</span><span class="cx"> 
</span><span class="cx">     // 'd' is in the first range of both rule. This series cover overlaps between the two rules.
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.dgyyy.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddgyyy.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddhyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddhhyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.degyyy.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.dehyyy.xxx/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.dgyyy.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddgyyy.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddhyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddhhyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.degyyy.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.dehyyy.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.dfgyyy.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.dfhyyy.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.djyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddjyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddjjyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.djyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddjyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddjjyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TEST_F(ContentExtensionTest, CombinedQuantifiedOneOrMoreRangesCase11And13InGroups)
</span><span class="lines">@@ -2970,9 +2948,9 @@
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.beyyy.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.bfyyy.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.bgyyy.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.bhyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.biyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.bjyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.bhyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.biyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.bjyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.bkyyy.xxx/"), { });
</span><span class="cx"> 
</span><span class="cx">     // 'c' is the first character of the first rule, and it overlaps the first character of the second rule.
</span><span class="lines">@@ -2983,24 +2961,24 @@
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.cdyyy.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.ceyyy.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.cfyyy.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.cgyyy.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.chyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.ciyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.cjyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.cgyyy.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.chyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.ciyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.cjyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.ckyyy.xxx/"), { });
</span><span class="cx"> 
</span><span class="cx">     // 'd' is in the first range of both rule. This series cover overlaps between the two rules.
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.dgyyy.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddgyyy.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddhyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddhhyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector, ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.degyyy.xxx/"), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.dehyyy.xxx/"), { ContentExtensions::ActionType::BlockLoad });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.dgyyy.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddgyyy.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddhyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddhhyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction>, variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.degyyy.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.dehyyy.xxx/"), { variantIndex<ContentExtensions::BlockLoadAction> });
</ins><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.dfgyyy.xxx/"), { });
</span><span class="cx">     testRequest(searchBackend, mainDocumentRequest("zzz://www.dfhyyy.xxx/"), { });
</span><del>-    testRequest(searchBackend, mainDocumentRequest("zzz://www.djyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddjyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
-    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddjjyyy.xxx/"), { ContentExtensions::ActionType::CSSDisplayNoneSelector });
</del><ins>+    testRequest(searchBackend, mainDocumentRequest("zzz://www.djyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddjyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
+    testRequest(searchBackend, mainDocumentRequest("zzz://www.ddjjyyy.xxx/"), { variantIndex<ContentExtensions::CSSDisplayNoneSelectorAction> });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TEST_F(ContentExtensionTest, ValidSelector)
</span></span></pre>
</div>
</div>

</body>
</html>