<!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>[180978] 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/180978">180978</a></dd>
<dt>Author</dt> <dd>achristensen@apple.com</dd>
<dt>Date</dt> <dd>2015-03-03 17:57:19 -0800 (Tue, 03 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Prepare to use CSS selectors in content extensions.
https://bugs.webkit.org/show_bug.cgi?id=142227

Reviewed by Benjamin Poulain.

Source/WebCore:

Test: http/tests/usercontentfilter/css-display-none.html

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* contentextensions/ContentExtensionActions.h: Added.
* contentextensions/ContentExtensionRule.cpp:
(WebCore::ContentExtensions::Action::deserialize):
* contentextensions/ContentExtensionRule.h:
(WebCore::ContentExtensions::Action::Action):
(WebCore::ContentExtensions::Action::type):
(WebCore::ContentExtensions::Action::cssSelector):
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::serializeActions):
Put action descriptions into a compact format in a Vector 
to be able to be put into one block of shared read-only memory.
(WebCore::ContentExtensions::ContentExtensionsBackend::setRuleList):
Put an index of the beginning of the description into the NFA instead of the index of the rule
because we will be sharing the descriptions of the actions and not the rules.
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL):
(WebCore::ContentExtensions::ContentExtensionsBackend::actionForURL): Deleted.
Return a vector of actions to be able to do multiple actions for one URL.
* contentextensions/ContentExtensionsBackend.h:
* contentextensions/ContentExtensionsManager.cpp:
(WebCore::ContentExtensions::ExtensionsManager::loadTrigger):
(WebCore::ContentExtensions::ExtensionsManager::loadAction):
Added the css-display-none action type, which requires a selector.
(WebCore::ContentExtensions::ExtensionsManager::loadRule):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
* page/UserContentController.cpp:
(WebCore::UserContentController::actionsForURL):
(WebCore::UserContentController::actionForURL): Deleted.
* page/UserContentController.h:

LayoutTests:

* http/tests/usercontentfilter/css-display-none-expected.txt: Added.
* http/tests/usercontentfilter/css-display-none.html: Added.
* http/tests/usercontentfilter/css-display-none.html.json: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</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="#trunkSourceWebCorecontentextensionsContentExtensionsManagercpp">trunk/Source/WebCore/contentextensions/ContentExtensionsManager.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourceLoadercpp">trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCorepageUserContentControllercpp">trunk/Source/WebCore/page/UserContentController.cpp</a></li>
<li><a href="#trunkSourceWebCorepageUserContentControllerh">trunk/Source/WebCore/page/UserContentController.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestsusercontentfiltercssdisplaynoneexpectedtxt">trunk/LayoutTests/http/tests/usercontentfilter/css-display-none-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsusercontentfiltercssdisplaynonehtml">trunk/LayoutTests/http/tests/usercontentfilter/css-display-none.html</a></li>
<li><a href="#trunkLayoutTestshttptestsusercontentfiltercssdisplaynonehtmljson">trunk/LayoutTests/http/tests/usercontentfilter/css-display-none.html.json</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionActionsh">trunk/Source/WebCore/contentextensions/ContentExtensionActions.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (180977 => 180978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-03-04 01:55:31 UTC (rev 180977)
+++ trunk/LayoutTests/ChangeLog        2015-03-04 01:57:19 UTC (rev 180978)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2015-03-03  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        Prepare to use CSS selectors in content extensions.
+        https://bugs.webkit.org/show_bug.cgi?id=142227
+
+        Reviewed by Benjamin Poulain.
+
+        * http/tests/usercontentfilter/css-display-none-expected.txt: Added.
+        * http/tests/usercontentfilter/css-display-none.html: Added.
+        * http/tests/usercontentfilter/css-display-none.html.json: Added.
+
</ins><span class="cx"> 2015-03-03  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Win] Add baseline for new legacy-event-handler test.
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsusercontentfiltercssdisplaynoneexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/usercontentfilter/css-display-none-expected.txt (0 => 180978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/usercontentfilter/css-display-none-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/usercontentfilter/css-display-none-expected.txt        2015-03-04 01:57:19 UTC (rev 180978)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x576
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 492x18
+          text run at (0,0) width 492: &quot;This text should not be visible once the css selector is applied (not done yet).&quot;
+      RenderBlock {P} at (0,34) size 784x18
+        RenderText {#text} at (0,0) size 522x18
+          text run at (0,0) width 522: &quot;This text should also not be visible once the css selector is applied (not done yet).&quot;
+      RenderBlock {P} at (0,68) size 784x18
+        RenderText {#text} at (0,0) size 173x18
+          text run at (0,0) width 173: &quot;This text should be visible.&quot;
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsusercontentfiltercssdisplaynonehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/usercontentfilter/css-display-none.html (0 => 180978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/usercontentfilter/css-display-none.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/usercontentfilter/css-display-none.html        2015-03-04 01:57:19 UTC (rev 180978)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+&lt;body&gt;
+&lt;p class=&quot;hidden&quot;&gt;This text should not be visible once the css selector is applied (not done yet).&lt;/p&gt;
+&lt;p class=&quot;hidden_Ž&quot;&gt;This text should also not be visible once the css selector is applied (not done yet).&lt;/p&gt;
+&lt;p class=&quot;not_hidden&quot;&gt;This text should be visible.&lt;/p&gt;
+&lt;/body&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsusercontentfiltercssdisplaynonehtmljson"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/usercontentfilter/css-display-none.html.json (0 => 180978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/usercontentfilter/css-display-none.html.json                                (rev 0)
+++ trunk/LayoutTests/http/tests/usercontentfilter/css-display-none.html.json        2015-03-04 01:57:19 UTC (rev 180978)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+[
+    {
+        &quot;action&quot;: {
+            &quot;type&quot;: &quot;css-display-none&quot;,
+            &quot;selector&quot;: &quot;.hidden&quot;
+        },
+        &quot;trigger&quot;: {
+            &quot;url-filter&quot;: &quot;.*css-display-none.html&quot;
+        }
+    },
+    {
+        &quot;action&quot;: {
+            &quot;type&quot;: &quot;css-display-none&quot;,
+            &quot;selector&quot;: &quot;.hidden_\u017D&quot;
+        },
+        &quot;trigger&quot;: {
+            &quot;url-filter&quot;: &quot;.*css-display-none.html&quot;
+        }
+    }
+]
</ins></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (180977 => 180978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2015-03-04 01:55:31 UTC (rev 180977)
+++ trunk/Source/WebCore/CMakeLists.txt        2015-03-04 01:57:19 UTC (rev 180978)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx">     &quot;${WEBCORE_DIR}/bridge&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/bridge/c&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/bridge/jsc&quot;
</span><ins>+    &quot;${WEBCORE_DIR}/contentextensions&quot;
</ins><span class="cx">     &quot;${WEBCORE_DIR}/crypto&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/crypto/algorithms&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/crypto/keys&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (180977 => 180978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-03-04 01:55:31 UTC (rev 180977)
+++ trunk/Source/WebCore/ChangeLog        2015-03-04 01:57:19 UTC (rev 180978)
</span><span class="lines">@@ -1,3 +1,44 @@
</span><ins>+2015-03-03  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        Prepare to use CSS selectors in content extensions.
+        https://bugs.webkit.org/show_bug.cgi?id=142227
+
+        Reviewed by Benjamin Poulain.
+
+        Test: http/tests/usercontentfilter/css-display-none.html
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * contentextensions/ContentExtensionActions.h: Added.
+        * contentextensions/ContentExtensionRule.cpp:
+        (WebCore::ContentExtensions::Action::deserialize):
+        * contentextensions/ContentExtensionRule.h:
+        (WebCore::ContentExtensions::Action::Action):
+        (WebCore::ContentExtensions::Action::type):
+        (WebCore::ContentExtensions::Action::cssSelector):
+        * contentextensions/ContentExtensionsBackend.cpp:
+        (WebCore::ContentExtensions::ContentExtensionsBackend::serializeActions):
+        Put action descriptions into a compact format in a Vector 
+        to be able to be put into one block of shared read-only memory.
+        (WebCore::ContentExtensions::ContentExtensionsBackend::setRuleList):
+        Put an index of the beginning of the description into the NFA instead of the index of the rule
+        because we will be sharing the descriptions of the actions and not the rules.
+        (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL):
+        (WebCore::ContentExtensions::ContentExtensionsBackend::actionForURL): Deleted.
+        Return a vector of actions to be able to do multiple actions for one URL.
+        * contentextensions/ContentExtensionsBackend.h:
+        * contentextensions/ContentExtensionsManager.cpp:
+        (WebCore::ContentExtensions::ExtensionsManager::loadTrigger):
+        (WebCore::ContentExtensions::ExtensionsManager::loadAction):
+        Added the css-display-none action type, which requires a selector.
+        (WebCore::ContentExtensions::ExtensionsManager::loadRule):
+        * loader/cache/CachedResourceLoader.cpp:
+        (WebCore::CachedResourceLoader::requestResource):
+        * page/UserContentController.cpp:
+        (WebCore::UserContentController::actionsForURL):
+        (WebCore::UserContentController::actionForURL): Deleted.
+        * page/UserContentController.h:
+
</ins><span class="cx"> 2015-03-03  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Move scroll animating functions from ScrollAnimator to ScrollController
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (180977 => 180978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-03-04 01:55:31 UTC (rev 180977)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-03-04 01:57:19 UTC (rev 180978)
</span><span class="lines">@@ -2147,6 +2147,7 @@
</span><span class="cx">                 5CD9F5661AA0F73C00DA45FF /* DFABytecode.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C39305D1AA0F6A90029C816 /* DFABytecode.h */; };
</span><span class="cx">                 5CD9F5671AA0F74200DA45FF /* DFABytecodeCompiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C39305F1AA0F6A90029C816 /* DFABytecodeCompiler.h */; };
</span><span class="cx">                 5CD9F5681AA0F74600DA45FF /* DFABytecodeInterpreter.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C3930611AA0F6A90029C816 /* DFABytecodeInterpreter.h */; };
</span><ins>+                5CDFA6C81AA4F2DA00EA8746 /* ContentExtensionActions.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CDFA6C71AA4F2DA00EA8746 /* ContentExtensionActions.h */; };
</ins><span class="cx">                 5CFC4350192409E300A0D3B5 /* PointerLockController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5CFC434E192406A900A0D3B5 /* PointerLockController.cpp */; };
</span><span class="cx">                 5D21A80213ECE5DF00BB7064 /* WebVTTParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D21A80013ECE5DF00BB7064 /* WebVTTParser.cpp */; };
</span><span class="cx">                 5D21A80313ECE5DF00BB7064 /* WebVTTParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D21A80113ECE5DF00BB7064 /* WebVTTParser.h */; };
</span><span class="lines">@@ -9302,6 +9303,7 @@
</span><span class="cx">                 5C4304AF191AC908000E2BC0 /* EXTShaderTextureLOD.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = EXTShaderTextureLOD.idl; path = canvas/EXTShaderTextureLOD.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5C4304B3191AEF46000E2BC0 /* JSEXTShaderTextureLOD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEXTShaderTextureLOD.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5C4304B4191AEF46000E2BC0 /* JSEXTShaderTextureLOD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEXTShaderTextureLOD.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                5CDFA6C71AA4F2DA00EA8746 /* ContentExtensionActions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentExtensionActions.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 5CFC434E192406A900A0D3B5 /* PointerLockController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PointerLockController.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5CFC434F192406A900A0D3B5 /* PointerLockController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PointerLockController.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5D21A80013ECE5DF00BB7064 /* WebVTTParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebVTTParser.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -15397,6 +15399,7 @@
</span><span class="cx">                 26F0C8901A2D79CB002794F8 /* contentextensions */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                5CDFA6C71AA4F2DA00EA8746 /* ContentExtensionActions.h */,
</ins><span class="cx">                                 26F0C8991A2EC110002794F8 /* ContentExtensionRule.cpp */,
</span><span class="cx">                                 26F0C89A1A2EC110002794F8 /* ContentExtensionRule.h */,
</span><span class="cx">                                 26F0C89D1A2EC3BE002794F8 /* ContentExtensionsBackend.cpp */,
</span><span class="lines">@@ -23749,6 +23752,7 @@
</span><span class="cx">                                 FD31602912B0267600C1A359 /* ConvolverNode.h in Headers */,
</span><span class="cx">                                 D8B6152F1032495100C8554A /* Cookie.h in Headers */,
</span><span class="cx">                                 E1424C94164B52C800F32D40 /* CookieJar.h in Headers */,
</span><ins>+                                5CDFA6C81AA4F2DA00EA8746 /* ContentExtensionActions.h in Headers */,
</ins><span class="cx">                                 339B5B63131DAA3200F48D02 /* CookiesStrategy.h in Headers */,
</span><span class="cx">                                 33D0212D131DB37B004091A8 /* CookieStorage.h in Headers */,
</span><span class="cx">                                 CE1252431A16C01A00864480 /* CoreUISPI.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionActionsh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/contentextensions/ContentExtensionActions.h (0 => 180978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionActions.h                                (rev 0)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionActions.h        2015-03-04 01:57:19 UTC (rev 180978)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.
+ */
+
+#ifndef ContentExtensionActions_h
+#define ContentExtensionActions_h
+
+#if ENABLE(CONTENT_EXTENSIONS)
+
+namespace WebCore {
+    
+namespace ContentExtensions {
+
+typedef uint8_t SerializedActionByte;
+    
+enum class ActionType : uint8_t {
+    BlockLoad,
+    BlockCookies,
+    CSSDisplayNone,
+    IgnorePreviousRules,
+    InvalidAction,
+};
+
+} // namespace ContentExtensions
+    
+} // namespace WebCore
+
+#endif // ENABLE(CONTENT_EXTENSIONS)
+
+#endif // ContentExtensionActions_h
</ins></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionRulecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionRule.cpp (180977 => 180978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionRule.cpp        2015-03-04 01:55:31 UTC (rev 180977)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionRule.cpp        2015-03-04 01:57:19 UTC (rev 180978)
</span><span class="lines">@@ -39,8 +39,35 @@
</span><span class="cx">     ASSERT(!m_trigger.urlFilter.isEmpty());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Action Action::deserialize(const Vector&lt;SerializedActionByte&gt;&amp; actions, unsigned location)
+{
+    switch (static_cast&lt;ActionType&gt;(actions[location])) {
+    case ActionType::BlockCookies:
+        return ActionType::BlockCookies;
+    case ActionType::BlockLoad:
+        return ActionType::BlockLoad;
+    case ActionType::IgnorePreviousRules:
+        return ActionType::IgnorePreviousRules;
+    case ActionType::InvalidAction:
+        RELEASE_ASSERT_NOT_REACHED();
+    case ActionType::CSSDisplayNone: {
+        unsigned stringStartIndex = location + sizeof(ActionType) + sizeof(unsigned) + sizeof(bool);
+        RELEASE_ASSERT(actions.size() &gt;= stringStartIndex);
+        unsigned selectorLength = *reinterpret_cast&lt;const unsigned*&gt;(&amp;actions[location + sizeof(ActionType)]);
+        bool wideCharacters = actions[location + sizeof(ActionType) + sizeof(unsigned)];
+        
+        if (wideCharacters) {
+            RELEASE_ASSERT(actions.size() &gt;= stringStartIndex + selectorLength * sizeof(UChar));
+            return Action(ActionType::CSSDisplayNone, String(reinterpret_cast&lt;const UChar*&gt;(&amp;actions[stringStartIndex]), selectorLength));
+        }
+        RELEASE_ASSERT(actions.size() &gt;= stringStartIndex + selectorLength * sizeof(LChar));
+        return Action(ActionType::CSSDisplayNone, String(reinterpret_cast&lt;const LChar*&gt;(&amp;actions[stringStartIndex]), selectorLength));
+    }
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(CONTENT_EXTENSIONS)
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionRuleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionRule.h (180977 => 180978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionRule.h        2015-03-04 01:55:31 UTC (rev 180977)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionRule.h        2015-03-04 01:57:19 UTC (rev 180978)
</span><span class="lines">@@ -28,33 +28,51 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="cx"> 
</span><ins>+#include &quot;ContentExtensionActions.h&quot;
</ins><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> namespace ContentExtensions {
</span><span class="cx"> 
</span><del>-enum class ExtensionActionType {
-    BlockLoad,
-    BlockCookies,
-    IgnorePreviousRules
-};
-
</del><span class="cx"> // A ContentExtensionRule is the smallest unit in a ContentExtension.
</span><span class="cx"> //
</span><span class="cx"> // It is composed of a trigger and an action. The trigger defines on what kind of content this extension should apply.
</span><span class="cx"> // The action defines what to perform on that content.
</span><ins>+
+struct Trigger {
+    String urlFilter;
+    bool urlFilterIsCaseSensitive { false };
+};
+    
+struct Action {
+    Action()
+        : m_type(ActionType::InvalidAction)
+    {
+    }
+    Action(ActionType type, const String&amp; cssSelector)
+        : m_type(type)
+        , m_cssSelector(cssSelector)
+    {
+        ASSERT(type == ActionType::CSSDisplayNone);
+    }
+    Action(ActionType type)
+        : m_type(type)
+    {
+        ASSERT(type != ActionType::CSSDisplayNone);
+    }
+    static Action deserialize(const Vector&lt;SerializedActionByte&gt;&amp;, unsigned location);
+
+    ActionType type() const { return m_type; }
+    const String&amp; cssSelector() const { return m_cssSelector; }
+        
+private:
+    ActionType m_type;
+    String m_cssSelector;
+};
+    
</ins><span class="cx"> class ContentExtensionRule {
</span><span class="cx"> public:
</span><del>-    struct Trigger {
-        String urlFilter;
-        bool urlFilterIsCaseSensitive = false;
-    };
-
-    struct Action {
-        ExtensionActionType type;
-    };
-
</del><span class="cx">     ContentExtensionRule(const Trigger&amp;, const Action&amp;);
</span><span class="cx"> 
</span><span class="cx">     const Trigger&amp; trigger() const { return m_trigger; }
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionsBackendcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp (180977 => 180978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp        2015-03-04 01:55:31 UTC (rev 180977)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp        2015-03-04 01:57:19 UTC (rev 180978)
</span><span class="lines">@@ -43,7 +43,54 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> namespace ContentExtensions {
</span><ins>+    
+Vector&lt;unsigned&gt; ContentExtensionsBackend::serializeActions(const Vector&lt;ContentExtensionRule&gt;&amp; ruleList, Vector&lt;SerializedActionByte&gt;&amp; actions)
+{
+    ASSERT(!actions.size());
+    
+    Vector&lt;unsigned&gt; actionLocations;
+        
+    for (unsigned ruleIndex = 0; ruleIndex &lt; ruleList.size(); ++ruleIndex) {
+        const ContentExtensionRule&amp; rule = ruleList[ruleIndex];
+        actionLocations.append(actions.size());
+        
+        switch (rule.action().type()) {
+        case ActionType::InvalidAction:
+            RELEASE_ASSERT_NOT_REACHED();
</ins><span class="cx"> 
</span><ins>+        case ActionType::BlockLoad:
+        case ActionType::BlockCookies:
+        case ActionType::IgnorePreviousRules:
+            actions.append(static_cast&lt;SerializedActionByte&gt;(rule.action().type()));
+            break;
+
+        case ActionType::CSSDisplayNone: {
+            const String&amp; selector = rule.action().cssSelector();
+            // Append action type (1 byte).
+            actions.append(static_cast&lt;SerializedActionByte&gt;(ActionType::CSSDisplayNone));
+            // Append Selector length (4 bytes).
+            unsigned selectorLength = selector.length();
+            actions.resize(actions.size() + sizeof(unsigned));
+            *reinterpret_cast&lt;unsigned*&gt;(&amp;actions[actions.size() - sizeof(unsigned)]) = selectorLength;
+            bool wideCharacters = !selector.is8Bit();
+            actions.append(wideCharacters);
+            // Append Selector.
+            if (wideCharacters) {
+                for (unsigned i = 0; i &lt; selectorLength; i++) {
+                    actions.resize(actions.size() + sizeof(UChar));
+                    *reinterpret_cast&lt;UChar*&gt;(&amp;actions[actions.size() - sizeof(UChar)]) = selector[i];
+                }
+            } else {
+                for (unsigned i = 0; i &lt; selectorLength; i++)
+                    actions.append(selector[i]);
+            }
+            break;
+        }
+        }
+    }
+    return actionLocations;
+}
+
</ins><span class="cx"> void ContentExtensionsBackend::setRuleList(const String&amp; identifier, const Vector&lt;ContentExtensionRule&gt;&amp; ruleList)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!identifier.isEmpty());
</span><span class="lines">@@ -59,14 +106,17 @@
</span><span class="cx">     double nfaBuildTimeStart = monotonicallyIncreasingTime();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    Vector&lt;SerializedActionByte&gt; actions;
+    Vector&lt;unsigned&gt; actionLocations = serializeActions(ruleList, actions);
+
</ins><span class="cx">     NFA nfa;
</span><span class="cx">     URLFilterParser urlFilterParser(nfa);
</span><span class="cx">     for (unsigned ruleIndex = 0; ruleIndex &lt; ruleList.size(); ++ruleIndex) {
</span><span class="cx">         const ContentExtensionRule&amp; contentExtensionRule = ruleList[ruleIndex];
</span><del>-        const ContentExtensionRule::Trigger&amp; trigger = contentExtensionRule.trigger();
</del><ins>+        const Trigger&amp; trigger = contentExtensionRule.trigger();
</ins><span class="cx">         ASSERT(trigger.urlFilter.length());
</span><span class="cx"> 
</span><del>-        String error = urlFilterParser.addPattern(trigger.urlFilter, trigger.urlFilterIsCaseSensitive, ruleIndex);
</del><ins>+        String error = urlFilterParser.addPattern(trigger.urlFilter, trigger.urlFilterIsCaseSensitive, actionLocations[ruleIndex]);
</ins><span class="cx"> 
</span><span class="cx">         if (!error.isNull()) {
</span><span class="cx">             dataLogF(&quot;Error while parsing %s: %s\n&quot;, trigger.urlFilter.utf8().data(), error.utf8().data());
</span><span class="lines">@@ -103,7 +153,7 @@
</span><span class="cx">     Vector&lt;DFABytecode&gt; bytecode;
</span><span class="cx">     DFABytecodeCompiler compiler(dfa, bytecode);
</span><span class="cx">     compiler.compile();
</span><del>-    CompiledContentExtension compiledContentExtension = { bytecode, ruleList };
</del><ins>+    CompiledContentExtension compiledContentExtension = { bytecode, actions };
</ins><span class="cx">     m_ruleLists.set(identifier, compiledContentExtension);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -117,32 +167,37 @@
</span><span class="cx">     m_ruleLists.clear();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ContentFilterAction ContentExtensionsBackend::actionForURL(const URL&amp; url)
</del><ins>+Vector&lt;Action&gt; ContentExtensionsBackend::actionsForURL(const URL&amp; url)
</ins><span class="cx"> {
</span><span class="cx">     const String&amp; urlString = url.string();
</span><span class="cx">     ASSERT_WITH_MESSAGE(urlString.containsOnlyASCII(), &quot;A decoded URL should only contain ASCII characters. The matching algorithm assumes the input is ASCII.&quot;);
</span><span class="cx">     const CString&amp; urlCString = urlString.utf8();
</span><span class="cx"> 
</span><ins>+    Vector&lt;Action&gt; actions;
</ins><span class="cx">     for (auto&amp; ruleListSlot : m_ruleLists) {
</span><span class="cx">         const CompiledContentExtension&amp; compiledContentExtension = ruleListSlot.value;
</span><span class="cx">         DFABytecodeInterpreter interpreter(compiledContentExtension.bytecode);
</span><span class="cx">         DFABytecodeInterpreter::Actions triggeredActions = interpreter.interpret(urlCString);
</span><del>-        // FIXME: We should eventually do something with each action rather than just returning a bool.
</del><ins>+        
</ins><span class="cx">         if (!triggeredActions.isEmpty()) {
</span><del>-            Vector&lt;uint64_t&gt; sortedActions;
-            copyToVector(triggeredActions, sortedActions);
-            std::sort(sortedActions.begin(), sortedActions.end());
-            size_t lastAction = static_cast&lt;size_t&gt;(sortedActions.last());
-            ExtensionActionType type = compiledContentExtension.ruleList[lastAction].action().type;
-
-            if (type == ExtensionActionType::BlockLoad)
-                return ContentFilterAction::Block;
-            if (type == ExtensionActionType::BlockCookies)
-                return ContentFilterAction::BlockCookies;
</del><ins>+            Vector&lt;unsigned&gt; actionLocations;
+            actionLocations.reserveInitialCapacity(triggeredActions.size());
+            for (auto actionLocation : triggeredActions)
+                actionLocations.append(static_cast&lt;unsigned&gt;(actionLocation));
+            std::sort(actionLocations.begin(), actionLocations.end());
+            
+            // Add actions in reverse order to properly deal with IgnorePreviousRules.
+            for (unsigned i = actionLocations.size(); i; i--) {
+                Action action = Action::deserialize(ruleListSlot.value.actions, actionLocations[i - 1]);
+                if (action.type() == ActionType::IgnorePreviousRules)
+                    break;
+                actions.append(action);
+                if (action.type() == ActionType::BlockLoad)
+                    break;
+            }
</ins><span class="cx">         }
</span><span class="cx">     }
</span><del>-
-    return ContentFilterAction::Load;
</del><ins>+    return actions;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace ContentExtensions
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionsBackendh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.h (180977 => 180978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.h        2015-03-04 01:55:31 UTC (rev 180977)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.h        2015-03-04 01:57:19 UTC (rev 180978)
</span><span class="lines">@@ -58,14 +58,16 @@
</span><span class="cx">     void removeAllRuleLists();
</span><span class="cx"> 
</span><span class="cx">     // - Internal WebCore Interface.
</span><del>-    ContentFilterAction actionForURL(const URL&amp;);
</del><ins>+    Vector&lt;Action&gt; actionsForURL(const URL&amp;);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     struct CompiledContentExtension {
</span><span class="cx">         Vector&lt;DFABytecode&gt; bytecode;
</span><del>-        Vector&lt;ContentExtensionRule&gt; ruleList;
</del><ins>+        Vector&lt;SerializedActionByte&gt; actions;
</ins><span class="cx">     };
</span><span class="cx"> 
</span><ins>+    Vector&lt;unsigned&gt; serializeActions(const Vector&lt;ContentExtensionRule&gt;&amp; ruleList, Vector&lt;SerializedActionByte&gt;&amp; actions);
+
</ins><span class="cx">     HashMap&lt;String, CompiledContentExtension&gt; m_ruleLists;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionsManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionsManager.cpp (180977 => 180978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionsManager.cpp        2015-03-04 01:55:31 UTC (rev 180977)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionsManager.cpp        2015-03-04 01:57:19 UTC (rev 180978)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace ExtensionsManager {
</span><span class="cx"> 
</span><del>-static bool loadTrigger(ExecState&amp; exec, JSObject&amp; ruleObject, ContentExtensionRule::Trigger&amp; trigger)
</del><ins>+static bool loadTrigger(ExecState&amp; exec, JSObject&amp; ruleObject, Trigger&amp; trigger)
</ins><span class="cx"> {
</span><span class="cx">     JSValue triggerObject = ruleObject.get(&amp;exec, Identifier(&amp;exec, &quot;trigger&quot;));
</span><span class="cx">     if (!triggerObject || exec.hadException() || !triggerObject.isObject()) {
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool loadAction(ExecState&amp; exec, JSObject&amp; ruleObject, ContentExtensionRule::Action&amp; action)
</del><ins>+static bool loadAction(ExecState&amp; exec, JSObject&amp; ruleObject, Action&amp; action)
</ins><span class="cx"> {
</span><span class="cx">     JSValue actionObject = ruleObject.get(&amp;exec, Identifier(&amp;exec, &quot;action&quot;));
</span><span class="cx">     if (!actionObject || exec.hadException() || !actionObject.isObject()) {
</span><span class="lines">@@ -93,12 +93,19 @@
</span><span class="cx">     String actionType = typeObject.toWTFString(&amp;exec);
</span><span class="cx"> 
</span><span class="cx">     if (actionType == &quot;block&quot;)
</span><del>-        action.type = ExtensionActionType::BlockLoad;
</del><ins>+        action = ActionType::BlockLoad;
</ins><span class="cx">     else if (actionType == &quot;ignore-previous-rules&quot;)
</span><del>-        action.type = ExtensionActionType::IgnorePreviousRules;
</del><ins>+        action = ActionType::IgnorePreviousRules;
</ins><span class="cx">     else if (actionType == &quot;block-cookies&quot;)
</span><del>-        action.type = ExtensionActionType::BlockCookies;
-    else if (actionType != &quot;block&quot; &amp;&amp; actionType != &quot;&quot;) {
</del><ins>+        action = ActionType::BlockCookies;
+    else if (actionType == &quot;css-display-none&quot;) {
+        JSValue selector = actionObject.get(&amp;exec, Identifier(&amp;exec, &quot;selector&quot;));
+        if (!selector || exec.hadException() || !selector.isString()) {
+            WTFLogAlways(&quot;css-display-none action type requires a selector&quot;);
+            return false;
+        }
+        action = Action(ActionType::CSSDisplayNone, selector.toWTFString(&amp;exec));
+    } else {
</ins><span class="cx">         WTFLogAlways(&quot;Unrecognized action: \&quot;%s\&quot;&quot;, actionType.utf8().data());
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="lines">@@ -108,11 +115,11 @@
</span><span class="cx"> 
</span><span class="cx"> static void loadRule(ExecState&amp; exec, JSObject&amp; ruleObject, Vector&lt;ContentExtensionRule&gt;&amp; ruleList)
</span><span class="cx"> {
</span><del>-    ContentExtensionRule::Trigger trigger;
</del><ins>+    Trigger trigger;
</ins><span class="cx">     if (!loadTrigger(exec, ruleObject, trigger))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    ContentExtensionRule::Action action;
</del><ins>+    Action action;
</ins><span class="cx">     if (!loadAction(exec, ruleObject, action))
</span><span class="cx">         return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp (180977 => 180978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2015-03-04 01:55:31 UTC (rev 180977)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2015-03-04 01:57:19 UTC (rev 180978)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> #include &quot;CachedXSLStyleSheet.h&quot;
</span><span class="cx"> #include &quot;Chrome.h&quot;
</span><span class="cx"> #include &quot;ChromeClient.h&quot;
</span><ins>+#include &quot;ContentExtensionRule.h&quot;
</ins><span class="cx"> #include &quot;ContentSecurityPolicy.h&quot;
</span><span class="cx"> #include &quot;DOMWindow.h&quot;
</span><span class="cx"> #include &quot;DiagnosticLoggingClient.h&quot;
</span><span class="lines">@@ -464,16 +465,22 @@
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    ContentFilterAction action = ContentFilterAction::Load;
</del><ins>+    Vector&lt;ContentExtensions::Action&gt; actions;
</ins><span class="cx"> 
</span><del>-    if (frame() &amp;&amp; frame()-&gt;page() &amp;&amp; frame()-&gt;page()-&gt;userContentController()) {
-        action = frame()-&gt;page()-&gt;userContentController()-&gt;actionForURL(url);
-        if (action == ContentFilterAction::Block)
</del><ins>+    if (frame() &amp;&amp; frame()-&gt;page() &amp;&amp; frame()-&gt;page()-&gt;userContentController())
+        actions = frame()-&gt;page()-&gt;userContentController()-&gt;actionsForURL(url);
+
+    for (const auto&amp; action : actions) {
+        if (action.type() == ContentExtensions::ActionType::BlockLoad)
</ins><span class="cx">             return nullptr;
</span><ins>+        if (action.type() == ContentExtensions::ActionType::BlockCookies)
+            request.mutableResourceRequest().setAllowCookies(false);
+        else if (action.type() == ContentExtensions::ActionType::CSSDisplayNone) {
+            // action.cssSelector() is the css to use here.
+            // FIXME: That css selector should be used to apply display:none.
+        } else
+            RELEASE_ASSERT_NOT_REACHED();
</ins><span class="cx">     }
</span><del>-
-    if (action == ContentFilterAction::BlockCookies)
-        request.mutableResourceRequest().setAllowCookies(false);
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     auto&amp; memoryCache = MemoryCache::singleton();
</span></span></pre></div>
<a id="trunkSourceWebCorepageUserContentControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/UserContentController.cpp (180977 => 180978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/UserContentController.cpp        2015-03-04 01:55:31 UTC (rev 180977)
+++ trunk/Source/WebCore/page/UserContentController.cpp        2015-03-04 01:57:19 UTC (rev 180978)
</span><span class="lines">@@ -203,12 +203,12 @@
</span><span class="cx">     m_contentExtensionBackend-&gt;removeAllRuleLists();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ContentFilterAction UserContentController::actionForURL(const URL&amp; url)
</del><ins>+Vector&lt;ContentExtensions::Action&gt; UserContentController::actionsForURL(const URL&amp; url)
</ins><span class="cx"> {
</span><span class="cx">     if (!m_contentExtensionBackend)
</span><del>-        return ContentFilterAction::Load;
</del><ins>+        return Vector&lt;ContentExtensions::Action&gt;();
</ins><span class="cx"> 
</span><del>-    return m_contentExtensionBackend-&gt;actionForURL(url);
</del><ins>+    return m_contentExtensionBackend-&gt;actionsForURL(url);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorepageUserContentControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/UserContentController.h (180977 => 180978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/UserContentController.h        2015-03-04 01:55:31 UTC (rev 180977)
+++ trunk/Source/WebCore/page/UserContentController.h        2015-03-04 01:57:19 UTC (rev 180978)
</span><span class="lines">@@ -47,14 +47,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace ContentExtensions {
</span><span class="cx"> class ContentExtensionsBackend;
</span><ins>+struct Action;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-enum class ContentFilterAction {
-    Load,
-    Block,
-    BlockCookies
-};
-
</del><span class="cx"> class UserContentController : public RefCounted&lt;UserContentController&gt; {
</span><span class="cx"> public:
</span><span class="cx">     WEBCORE_EXPORT static RefPtr&lt;UserContentController&gt; create();
</span><span class="lines">@@ -91,7 +86,7 @@
</span><span class="cx">     WEBCORE_EXPORT void removeAllUserContentFilters();
</span><span class="cx">     
</span><span class="cx">     // FIXME: Consider putting this (and other future content filter predicates) in its own class.
</span><del>-    ContentFilterAction actionForURL(const URL&amp;);
</del><ins>+    Vector&lt;ContentExtensions::Action&gt; actionsForURL(const URL&amp;);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> private:
</span></span></pre>
</div>
</div>

</body>
</html>