<!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>[183195] trunk/Source/WebCore</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/183195">183195</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2015-04-23 10:52:21 -0700 (Thu, 23 Apr 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Content extension with oft-repeated rules can cause slowdown.
rdar://problem/20618511 and https://bugs.webkit.org/show_bug.cgi?id=144010

Reviewed by Alex Christensen.

No new tests (Behavior covered by existing tests).

* WebCore.xcodeproj/project.pbxproj:

* contentextensions/ContentExtension.cpp:
(WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):

Add the String identifier for the extension and the rule action ID to Actions:
* contentextensions/ContentExtensionRule.cpp:
(WebCore::ContentExtensions::Action::deserialize):
* contentextensions/ContentExtensionRule.h:
(WebCore::ContentExtensions::Action::Action):
(WebCore::ContentExtensions::Action::operator==):
(WebCore::ContentExtensions::Action::setExtensionIdentifier):
(WebCore::ContentExtensions::Action::extensionIdentifier):
(WebCore::ContentExtensions::Action::actionID):
(WebCore::ContentExtensions::Action::type): Deleted.

Object to manage a CSSStyleSheet and selectors identified by ID:
* contentextensions/ContentExtensionStyleSheet.cpp:
(WebCore::ContentExtensions::ContentExtensionStyleSheet::ContentExtensionStyleSheet):
(WebCore::ContentExtensions::ContentExtensionStyleSheet::addDisplayNoneSelector):
* contentextensions/ContentExtensionStyleSheet.h:
(WebCore::ContentExtensions::ContentExtensionStyleSheet::create):
(WebCore::ContentExtensions::ContentExtensionStyleSheet::styleSheet):

Instead of globbing selectors together into a String and making a new stylesheet,
add new unique selectors to an already existing sheet:
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
(WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
(WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):

* dom/DocumentStyleSheetCollection.cpp:
(WebCore::DocumentStyleSheetCollection::addDisplayNoneSelector):
(WebCore::DocumentStyleSheetCollection::addContentExtensionUserSheet): Deleted.
* dom/DocumentStyleSheetCollection.h:

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitData):
(WebCore::DocumentLoader::addPendingContentExtensionDisplayNoneSelector):
(WebCore::DocumentLoader::addPendingContentExtensionSheet): Deleted.
* loader/DocumentLoader.h:</pre>

<h3>Modified Paths</h3>
<ul>
<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="#trunkSourceWebCorecontentextensionsContentExtensioncpp">trunk/Source/WebCore/contentextensions/ContentExtension.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="#trunkSourceWebCoredomDocumentStyleSheetCollectioncpp">trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumentStyleSheetCollectionh">trunk/Source/WebCore/dom/DocumentStyleSheetCollection.h</a></li>
<li><a href="#trunkSourceWebCoreloaderDocumentLoadercpp">trunk/Source/WebCore/loader/DocumentLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderDocumentLoaderh">trunk/Source/WebCore/loader/DocumentLoader.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionStyleSheetcpp">trunk/Source/WebCore/contentextensions/ContentExtensionStyleSheet.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionStyleSheeth">trunk/Source/WebCore/contentextensions/ContentExtensionStyleSheet.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (183194 => 183195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-04-23 17:48:37 UTC (rev 183194)
+++ trunk/Source/WebCore/ChangeLog        2015-04-23 17:52:21 UTC (rev 183195)
</span><span class="lines">@@ -1,3 +1,54 @@
</span><ins>+2015-04-23  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Content extension with oft-repeated rules can cause slowdown.
+        rdar://problem/20618511 and https://bugs.webkit.org/show_bug.cgi?id=144010
+
+        Reviewed by Alex Christensen.
+
+        No new tests (Behavior covered by existing tests).
+
+        * WebCore.xcodeproj/project.pbxproj:
+
+        * contentextensions/ContentExtension.cpp:
+        (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
+
+        Add the String identifier for the extension and the rule action ID to Actions:
+        * contentextensions/ContentExtensionRule.cpp:
+        (WebCore::ContentExtensions::Action::deserialize):
+        * contentextensions/ContentExtensionRule.h:
+        (WebCore::ContentExtensions::Action::Action):
+        (WebCore::ContentExtensions::Action::operator==):
+        (WebCore::ContentExtensions::Action::setExtensionIdentifier):
+        (WebCore::ContentExtensions::Action::extensionIdentifier):
+        (WebCore::ContentExtensions::Action::actionID):
+        (WebCore::ContentExtensions::Action::type): Deleted.
+
+        Object to manage a CSSStyleSheet and selectors identified by ID:
+        * contentextensions/ContentExtensionStyleSheet.cpp:
+        (WebCore::ContentExtensions::ContentExtensionStyleSheet::ContentExtensionStyleSheet):
+        (WebCore::ContentExtensions::ContentExtensionStyleSheet::addDisplayNoneSelector):
+        * contentextensions/ContentExtensionStyleSheet.h:
+        (WebCore::ContentExtensions::ContentExtensionStyleSheet::create):
+        (WebCore::ContentExtensions::ContentExtensionStyleSheet::styleSheet):
+
+        Instead of globbing selectors together into a String and making a new stylesheet,
+        add new unique selectors to an already existing sheet:
+        * contentextensions/ContentExtensionsBackend.cpp:
+        (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
+        (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
+        (WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
+
+        * dom/DocumentStyleSheetCollection.cpp:
+        (WebCore::DocumentStyleSheetCollection::addDisplayNoneSelector):
+        (WebCore::DocumentStyleSheetCollection::addContentExtensionUserSheet): Deleted.
+        * dom/DocumentStyleSheetCollection.h:
+
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::commitData):
+        (WebCore::DocumentLoader::addPendingContentExtensionDisplayNoneSelector):
+        (WebCore::DocumentLoader::addPendingContentExtensionSheet): Deleted.
+        * loader/DocumentLoader.h:
+
</ins><span class="cx"> 2015-04-23  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Memory cache live resources repeatedly purged during painting
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (183194 => 183195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-04-23 17:48:37 UTC (rev 183194)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-04-23 17:52:21 UTC (rev 183195)
</span><span class="lines">@@ -2077,6 +2077,8 @@
</span><span class="cx">                 51FA2D78152132B300C1BA0B /* DOMWindowExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 517FBA18151AA71B00B57959 /* DOMWindowExtension.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 51FB5504113E3E9100821176 /* JSCloseEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FB5502113E3E9100821176 /* JSCloseEvent.h */; };
</span><span class="cx">                 51FB5505113E3E9100821176 /* JSCloseEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51FB5503113E3E9100821176 /* JSCloseEvent.cpp */; };
</span><ins>+                51FB67DB1AE6B82B00D06C5A /* ContentExtensionStyleSheet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51FB67D91AE6B5E400D06C5A /* ContentExtensionStyleSheet.cpp */; };
+                51FB67DC1AE6B82F00D06C5A /* ContentExtensionStyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FB67DA1AE6B5E400D06C5A /* ContentExtensionStyleSheet.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 521D46F611AEC98100514613 /* KillRingMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 521D46F511AEC98100514613 /* KillRingMac.mm */; };
</span><span class="cx">                 521D46F811AEC9B100514613 /* KillRing.h in Headers */ = {isa = PBXBuildFile; fileRef = 521D46F711AEC9B100514613 /* KillRing.h */; };
</span><span class="cx">                 52B6C9C215E3F4DF00690B05 /* DOMNamedFlowCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52B6C9BD15E3F4DF00690B05 /* DOMNamedFlowCollection.cpp */; };
</span><span class="lines">@@ -9293,6 +9295,8 @@
</span><span class="cx">                 51F6A3D60663BF04004D2919 /* HTMLCanvasElement.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HTMLCanvasElement.h; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</span><span class="cx">                 51FB5502113E3E9100821176 /* JSCloseEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCloseEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51FB5503113E3E9100821176 /* JSCloseEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCloseEvent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                51FB67D91AE6B5E400D06C5A /* ContentExtensionStyleSheet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentExtensionStyleSheet.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                51FB67DA1AE6B5E400D06C5A /* ContentExtensionStyleSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentExtensionStyleSheet.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 521D46F511AEC98100514613 /* KillRingMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KillRingMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 521D46F711AEC9B100514613 /* KillRing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KillRing.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 52B6C9BD15E3F4DF00690B05 /* DOMNamedFlowCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMNamedFlowCollection.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -15569,6 +15573,8 @@
</span><span class="cx">                                 26F0C8961A2E724B002794F8 /* ContentExtensionParser.h */,
</span><span class="cx">                                 26F0C8991A2EC110002794F8 /* ContentExtensionRule.cpp */,
</span><span class="cx">                                 26F0C89A1A2EC110002794F8 /* ContentExtensionRule.h */,
</span><ins>+                                51FB67D91AE6B5E400D06C5A /* ContentExtensionStyleSheet.cpp */,
+                                51FB67DA1AE6B5E400D06C5A /* ContentExtensionStyleSheet.h */,
</ins><span class="cx">                                 26F0C89D1A2EC3BE002794F8 /* ContentExtensionsBackend.cpp */,
</span><span class="cx">                                 26F0C89E1A2EC3BE002794F8 /* ContentExtensionsBackend.h */,
</span><span class="cx">                                 262391351A648CEE007251A3 /* ContentExtensionsDebugging.h */,
</span><span class="lines">@@ -26904,6 +26910,7 @@
</span><span class="cx">                                 26F0C8A01A2EC3BE002794F8 /* ContentExtensionsBackend.h in Headers */,
</span><span class="cx">                                 49E911C40EF86D47009D0CAF /* TransformationMatrix.h in Headers */,
</span><span class="cx">                                 FB484F4D171F821E00040755 /* TransformFunctions.h in Headers */,
</span><ins>+                                51FB67DC1AE6B82F00D06C5A /* ContentExtensionStyleSheet.h in Headers */,
</ins><span class="cx">                                 49E911CE0EF86D47009D0CAF /* TransformOperation.h in Headers */,
</span><span class="cx">                                 49E911D00EF86D47009D0CAF /* TransformOperations.h in Headers */,
</span><span class="cx">                                 5DB1BC6A10715A6400EFAA49 /* TransformSource.h in Headers */,
</span><span class="lines">@@ -27595,6 +27602,7 @@
</span><span class="cx">                                 FDC54F041399B0DA008D9117 /* BiquadFilterNode.cpp in Sources */,
</span><span class="cx">                                 FD31602612B0267600C1A359 /* BiquadProcessor.cpp in Sources */,
</span><span class="cx">                                 A89943290B42338800D7C802 /* BitmapImage.cpp in Sources */,
</span><ins>+                                51FB67DB1AE6B82B00D06C5A /* ContentExtensionStyleSheet.cpp in Sources */,
</ins><span class="cx">                                 377A3A9015EFCE9B0059F5C7 /* BitmapImageCG.cpp in Sources */,
</span><span class="cx">                                 976D6C78122B8A3D001FD1F7 /* Blob.cpp in Sources */,
</span><span class="cx">                                 2EDEF1F3121B0EFC00726DB2 /* BlobData.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtension.cpp (183194 => 183195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtension.cpp        2015-04-23 17:48:37 UTC (rev 183194)
+++ trunk/Source/WebCore/contentextensions/ContentExtension.cpp        2015-04-23 17:52:21 UTC (rev 183195)
</span><span class="lines">@@ -62,7 +62,9 @@
</span><span class="cx">     StringBuilder css;
</span><span class="cx">     for (auto&amp; selector : selectors) {
</span><span class="cx">         css.append(selector);
</span><ins>+        css.append(&quot;{&quot;);
</ins><span class="cx">         css.append(ContentExtensionsBackend::displayNoneCSSRule());
</span><ins>+        css.append(&quot;}&quot;);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_globalDisplayNoneStyleSheet = StyleSheetContents::create();
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionRulecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionRule.cpp (183194 => 183195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionRule.cpp        2015-04-23 17:48:37 UTC (rev 183194)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionRule.cpp        2015-04-23 17:52:21 UTC (rev 183195)
</span><span class="lines">@@ -43,11 +43,11 @@
</span><span class="cx"> {
</span><span class="cx">     switch (static_cast&lt;ActionType&gt;(actions[location])) {
</span><span class="cx">     case ActionType::BlockCookies:
</span><del>-        return ActionType::BlockCookies;
</del><ins>+        return Action(ActionType::BlockCookies, location);
</ins><span class="cx">     case ActionType::BlockLoad:
</span><del>-        return ActionType::BlockLoad;
</del><ins>+        return Action(ActionType::BlockLoad, location);
</ins><span class="cx">     case ActionType::IgnorePreviousRules:
</span><del>-        return ActionType::IgnorePreviousRules;
</del><ins>+        return Action(ActionType::IgnorePreviousRules, location);
</ins><span class="cx">     case ActionType::CSSDisplayNoneSelector: {
</span><span class="cx">         unsigned stringStartIndex = location + sizeof(ActionType) + sizeof(unsigned) + sizeof(bool);
</span><span class="cx">         RELEASE_ASSERT(actionsLength &gt;= stringStartIndex);
</span><span class="lines">@@ -56,10 +56,10 @@
</span><span class="cx">         
</span><span class="cx">         if (wideCharacters) {
</span><span class="cx">             RELEASE_ASSERT(actionsLength &gt;= stringStartIndex + selectorLength * sizeof(UChar));
</span><del>-            return Action(ActionType::CSSDisplayNoneSelector, String(reinterpret_cast&lt;const UChar*&gt;(&amp;actions[stringStartIndex]), selectorLength));
</del><ins>+            return Action(ActionType::CSSDisplayNoneSelector, String(reinterpret_cast&lt;const UChar*&gt;(&amp;actions[stringStartIndex]), selectorLength), location);
</ins><span class="cx">         }
</span><span class="cx">         RELEASE_ASSERT(actionsLength &gt;= stringStartIndex + selectorLength * sizeof(LChar));
</span><del>-        return Action(ActionType::CSSDisplayNoneSelector, String(reinterpret_cast&lt;const LChar*&gt;(&amp;actions[stringStartIndex]), selectorLength));
</del><ins>+        return Action(ActionType::CSSDisplayNoneSelector, String(reinterpret_cast&lt;const LChar*&gt;(&amp;actions[stringStartIndex]), selectorLength), location);
</ins><span class="cx">     }
</span><span class="cx">     case ActionType::CSSDisplayNoneStyleSheet:
</span><span class="cx">     case ActionType::InvalidAction:
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionRuleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionRule.h (183194 => 183195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionRule.h        2015-04-23 17:48:37 UTC (rev 183194)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionRule.h        2015-04-23 17:52:21 UTC (rev 183195)
</span><span class="lines">@@ -56,18 +56,21 @@
</span><span class="cx"> struct Action {
</span><span class="cx">     Action()
</span><span class="cx">         : m_type(ActionType::InvalidAction)
</span><ins>+        , m_actionID(std::numeric_limits&lt;uint32_t&gt;::max())
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Action(ActionType type, const String&amp; stringArgument)
</del><ins>+    Action(ActionType type, const String&amp; stringArgument, uint32_t actionID = std::numeric_limits&lt;uint32_t&gt;::max())
</ins><span class="cx">         : m_type(type)
</span><ins>+        , m_actionID(actionID)
</ins><span class="cx">         , m_stringArgument(stringArgument)
</span><span class="cx">     {
</span><span class="cx">         ASSERT(type == ActionType::CSSDisplayNoneSelector || type == ActionType::CSSDisplayNoneStyleSheet);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Action(ActionType type)
</del><ins>+    Action(ActionType type, uint32_t actionID = std::numeric_limits&lt;uint32_t&gt;::max())
</ins><span class="cx">         : m_type(type)
</span><ins>+        , m_actionID(actionID)
</ins><span class="cx">     {
</span><span class="cx">         ASSERT(type != ActionType::CSSDisplayNoneSelector &amp;&amp; type != ActionType::CSSDisplayNoneStyleSheet);
</span><span class="cx">     }
</span><span class="lines">@@ -75,16 +78,23 @@
</span><span class="cx">     bool operator==(const Action&amp; other) const
</span><span class="cx">     {
</span><span class="cx">         return m_type == other.m_type
</span><ins>+            &amp;&amp; m_extensionIdentifier == other.m_extensionIdentifier
+            &amp;&amp; m_actionID == other.m_actionID
</ins><span class="cx">             &amp;&amp; m_stringArgument == other.m_stringArgument;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    static Action deserialize(const SerializedActionByte* actions, const unsigned actionsLength, unsigned location);
</del><ins>+    static Action deserialize(const SerializedActionByte* actions, const unsigned actionsLength, uint32_t location);
</ins><span class="cx"> 
</span><ins>+    void setExtensionIdentifier(const String&amp; extensionIdentifier) { m_extensionIdentifier = extensionIdentifier; }
+    const String&amp; extensionIdentifier() const { return m_extensionIdentifier; }
</ins><span class="cx">     ActionType type() const { return m_type; }
</span><ins>+    uint32_t actionID() const { return m_actionID; }
</ins><span class="cx">     const String&amp; stringArgument() const { return m_stringArgument; }
</span><del>-        
</del><ins>+
</ins><span class="cx"> private:
</span><ins>+    String m_extensionIdentifier;
</ins><span class="cx">     ActionType m_type;
</span><ins>+    uint32_t m_actionID;
</ins><span class="cx">     String m_stringArgument;
</span><span class="cx"> };
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionStyleSheetcppfromrev183194trunkSourceWebCorecontentextensionsContentExtensioncpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/contentextensions/ContentExtensionStyleSheet.cpp (from rev 183194, trunk/Source/WebCore/contentextensions/ContentExtension.cpp) (0 => 183195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionStyleSheet.cpp                                (rev 0)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionStyleSheet.cpp        2015-04-23 17:52:21 UTC (rev 183195)
</span><span class="lines">@@ -0,0 +1,59 @@
</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.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;ContentExtensionStyleSheet.h&quot;
+
+#if ENABLE(CONTENT_EXTENSIONS)
+
+#include &quot;CSSStyleSheet.h&quot;
+#include &quot;ContentExtensionsBackend.h&quot;
+#include &quot;Document.h&quot;
+#include &quot;StyleSheetContents.h&quot;
+
+namespace WebCore {
+namespace ContentExtensions {
+
+ContentExtensionStyleSheet::ContentExtensionStyleSheet(Document&amp; document)
+    : m_styleSheet(CSSStyleSheet::create(StyleSheetContents::create(), &amp;document))
+{
+    m_styleSheet-&gt;contents().setIsUserStyleSheet(true);
+}
+
+void ContentExtensionStyleSheet::addDisplayNoneSelector(const String&amp; selector, uint32_t selectorID)
+{
+    ASSERT(selectorID != std::numeric_limits&lt;uint32_t&gt;::max());
+
+    if (!m_addedSelectorIDs.add(selectorID).isNewEntry)
+        return;
+
+    ExceptionCode ec;
+    m_styleSheet-&gt;addRule(selector, ContentExtensionsBackend::displayNoneCSSRule(), ec);
+}
+
+} // namespace ContentExtensions
+} // namespace WebCore
+
+#endif // ENABLE(CONTENT_EXTENSIONS)
</ins></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionStyleSheethfromrev183194trunkSourceWebCorecontentextensionsContentExtensioncpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/contentextensions/ContentExtensionStyleSheet.h (from rev 183194, trunk/Source/WebCore/contentextensions/ContentExtension.cpp) (0 => 183195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionStyleSheet.h                                (rev 0)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionStyleSheet.h        2015-04-23 17:52:21 UTC (rev 183195)
</span><span class="lines">@@ -0,0 +1,64 @@
</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 ContentExtensionStyleSheet_h
+#define ContentExtensionStyleSheet_h
+
+#if ENABLE(CONTENT_EXTENSIONS)
+
+#include &quot;CSSStyleSheet.h&quot;
+#include &lt;wtf/HashSet.h&gt;
+#include &lt;wtf/Ref.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+
+class Document;
+
+namespace ContentExtensions {
+
+class ContentExtensionStyleSheet : public RefCounted&lt;ContentExtensionStyleSheet&gt; {
+public:
+    static Ref&lt;ContentExtensionStyleSheet&gt; create(Document&amp; document)
+    {
+        return adoptRef(*new ContentExtensionStyleSheet(document));
+    }
+
+    void addDisplayNoneSelector(const String&amp; selector, uint32_t selectorID);
+
+    CSSStyleSheet&amp; styleSheet() { return m_styleSheet.get(); }
+
+private:
+    ContentExtensionStyleSheet(Document&amp;);
+
+    Ref&lt;CSSStyleSheet&gt; m_styleSheet;
+    HashSet&lt;uint32_t, DefaultHash&lt;uint32_t&gt;::Hash, WTF::UnsignedWithZeroKeyHashTraits&lt;uint32_t&gt;&gt; m_addedSelectorIDs;
+};
+
+} // namespace ContentExtensions
+} // namespace WebCore
+
+#endif // ENABLE(CONTENT_EXTENSIONS)
+#endif // ContentExtensionStyleSheet_h
</ins></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionsBackendcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp (183194 => 183195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp        2015-04-23 17:48:37 UTC (rev 183194)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp        2015-04-23 17:52:21 UTC (rev 183195)
</span><span class="lines">@@ -105,6 +105,7 @@
</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><span class="cx">                 Action action = Action::deserialize(actions, actionsLength, actionLocations[i - 1]);
</span><ins>+                action.setExtensionIdentifier(contentExtension-&gt;identifier());
</ins><span class="cx">                 if (action.type() == ActionType::IgnorePreviousRules) {
</span><span class="cx">                     sawIgnorePreviousRules = true;
</span><span class="cx">                     break;
</span><span class="lines">@@ -116,12 +117,14 @@
</span><span class="cx">             DFABytecodeInterpreter::Actions universalActions = interpreter.actionsFromDFARoot();
</span><span class="cx">             for (auto actionLocation : universalActions) {
</span><span class="cx">                 Action action = Action::deserialize(actions, actionsLength, static_cast&lt;unsigned&gt;(actionLocation));
</span><del>-                
</del><ins>+                action.setExtensionIdentifier(contentExtension-&gt;identifier());
+
</ins><span class="cx">                 // CSS selectors were already compiled into a stylesheet using globalDisplayNoneSelectors.
</span><span class="cx">                 if (action.type() != ActionType::CSSDisplayNoneSelector)
</span><span class="cx">                     finalActions.append(action);
</span><span class="cx">             }
</span><span class="cx">             finalActions.append(Action(ActionType::CSSDisplayNoneStyleSheet, contentExtension-&gt;identifier()));
</span><ins>+            finalActions.last().setExtensionIdentifier(contentExtension-&gt;identifier());
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> #if CONTENT_EXTENSIONS_PERFORMANCE_REPORTING
</span><span class="lines">@@ -163,8 +166,10 @@
</span><span class="cx">             request.setAllowCookies(false);
</span><span class="cx">             break;
</span><span class="cx">         case ContentExtensions::ActionType::CSSDisplayNoneSelector:
</span><del>-            css.append(action.stringArgument());
-            css.append(displayNoneCSSRule());
</del><ins>+            if (resourceType == ResourceType::Document)
+                initiatingDocumentLoader.addPendingContentExtensionDisplayNoneSelector(action.extensionIdentifier(), action.stringArgument(), action.actionID());
+            else if (currentDocument)
+                currentDocument-&gt;styleSheetCollection().addDisplayNoneSelector(action.extensionIdentifier(), action.stringArgument(), action.actionID());
</ins><span class="cx">             break;
</span><span class="cx">         case ContentExtensions::ActionType::CSSDisplayNoneStyleSheet: {
</span><span class="cx">             StyleSheetContents* styleSheetContents = globalDisplayNoneStyleSheet(action.stringArgument());
</span><span class="lines">@@ -182,25 +187,13 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (css.length()) {
-        Ref&lt;StyleSheetContents&gt; styleSheet = StyleSheetContents::create();
-        styleSheet-&gt;setIsUserStyleSheet(true);
-
-        if (styleSheet-&gt;parseString(css.toString())) {
-            if (resourceType == ResourceType::Document)
-                initiatingDocumentLoader.addPendingContentExtensionSheet(styleSheet);
-            else if (currentDocument)
-                currentDocument-&gt;styleSheetCollection().addContentExtensionUserSheet(WTF::move(styleSheet));
-        }
-    }
-
</del><span class="cx">     if (willBlockLoad)
</span><span class="cx">         request = ResourceRequest();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const String&amp; ContentExtensionsBackend::displayNoneCSSRule()
</span><span class="cx"> {
</span><del>-    static NeverDestroyed&lt;const String&gt; rule(ASCIILiteral(&quot;{display:none !important;}\n&quot;));
</del><ins>+    static NeverDestroyed&lt;const String&gt; rule(ASCIILiteral(&quot;display:none !important;&quot;));
</ins><span class="cx">     return rule;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentStyleSheetCollectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp (183194 => 183195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp        2015-04-23 17:48:37 UTC (rev 183194)
+++ trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp        2015-04-23 17:52:21 UTC (rev 183195)
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+using namespace ContentExtensions;
</ins><span class="cx"> using namespace HTMLNames;
</span><span class="cx"> 
</span><span class="cx"> DocumentStyleSheetCollection::DocumentStyleSheetCollection(Document&amp; document)
</span><span class="lines">@@ -192,10 +193,16 @@
</span><span class="cx">     m_document.styleResolverChanged(RecalcStyleImmediately);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DocumentStyleSheetCollection::addContentExtensionUserSheet(Ref&lt;StyleSheetContents&gt;&amp;&amp; userSheet)
</del><ins>+#if ENABLE(CONTENT_EXTENSIONS)
+void DocumentStyleSheetCollection::addDisplayNoneSelector(const String&amp; identifier, const String&amp; selector, uint32_t selectorID)
</ins><span class="cx"> {
</span><del>-    ASSERT(userSheet.get().isUserStyleSheet());
-    m_userStyleSheets.append(CSSStyleSheet::create(WTF::move(userSheet), &amp;m_document));
</del><ins>+    auto result = m_contentExtensionSelectorSheets.add(identifier, nullptr);
+    if (result.isNewEntry) {
+        result.iterator-&gt;value = ContentExtensionStyleSheet::create(m_document);
+        m_userStyleSheets.append(&amp;result.iterator-&gt;value-&gt;styleSheet());
+    }
+
+    result.iterator-&gt;value-&gt;addDisplayNoneSelector(selector, selectorID);
</ins><span class="cx">     m_styleResolverChangedTimer.startOneShot(0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -211,6 +218,7 @@
</span><span class="cx">     m_userStyleSheets.append(adoptRef(cssSheet.leakRef()));
</span><span class="cx">     m_styleResolverChangedTimer.startOneShot(0);
</span><span class="cx"> }
</span><ins>+#endif // ENABLE(CONTENT_EXTENSIONS)
</ins><span class="cx"> 
</span><span class="cx"> void DocumentStyleSheetCollection::styleResolverChangedTimerFired()
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentStyleSheetCollectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DocumentStyleSheetCollection.h (183194 => 183195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DocumentStyleSheetCollection.h        2015-04-23 17:48:37 UTC (rev 183194)
+++ trunk/Source/WebCore/dom/DocumentStyleSheetCollection.h        2015-04-23 17:52:21 UTC (rev 183195)
</span><span class="lines">@@ -37,6 +37,10 @@
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><ins>+#if ENABLE(CONTENT_EXTENSIONS)
+#include &quot;ContentExtensionStyleSheet.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class CSSStyleSheet;
</span><span class="lines">@@ -71,8 +75,11 @@
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT void addAuthorSheet(Ref&lt;StyleSheetContents&gt;&amp;&amp; authorSheet);
</span><span class="cx">     WEBCORE_EXPORT void addUserSheet(Ref&lt;StyleSheetContents&gt;&amp;&amp; userSheet);
</span><del>-    void addContentExtensionUserSheet(Ref&lt;StyleSheetContents&gt;&amp;&amp; userSheet);
</del><ins>+
+#if ENABLE(CONTENT_EXTENSIONS)
+    void addDisplayNoneSelector(const String&amp; identifier, const String&amp; selector, uint32_t selectorID);
</ins><span class="cx">     void maybeAddContentExtensionSheet(const String&amp; identifier, StyleSheetContents&amp;);
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     enum UpdateFlag { NoUpdate = 0, OptimizedUpdate, FullUpdate };
</span><span class="cx"> 
</span><span class="lines">@@ -152,7 +159,11 @@
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt; m_userStyleSheets;
</span><span class="cx">     Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt; m_authorStyleSheets;
</span><ins>+
+#if ENABLE(CONTENT_EXTENSIONS)
</ins><span class="cx">     HashMap&lt;String, RefPtr&lt;CSSStyleSheet&gt;&gt; m_contentExtensionSheets;
</span><ins>+    HashMap&lt;String, RefPtr&lt;ContentExtensions::ContentExtensionStyleSheet&gt;&gt; m_contentExtensionSelectorSheets;
+#endif
</ins><span class="cx"> 
</span><span class="cx">     bool m_hadActiveLoadingStylesheet;
</span><span class="cx">     UpdateFlag m_pendingUpdateType;
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (183194 => 183195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.cpp        2015-04-23 17:48:37 UTC (rev 183194)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp        2015-04-23 17:52:21 UTC (rev 183195)
</span><span class="lines">@@ -832,11 +832,11 @@
</span><span class="cx"> 
</span><span class="cx">     for (auto&amp; pendingStyleSheet : m_pendingNamedContentExtensionStyleSheets)
</span><span class="cx">         styleSheetCollection.maybeAddContentExtensionSheet(pendingStyleSheet.key, *pendingStyleSheet.value);
</span><del>-    for (auto&amp; pendingStyleSheet : m_pendingUnnamedContentExtensionStyleSheets)
-        styleSheetCollection.addUserSheet(*pendingStyleSheet);
</del><ins>+    for (auto&amp; pendingSelector : m_pendingContentExtensionDisplayNoneSelectors)
+        styleSheetCollection.addDisplayNoneSelector(pendingSelector.key, pendingSelector.value.first, pendingSelector.value.second);
</ins><span class="cx"> 
</span><span class="cx">     m_pendingNamedContentExtensionStyleSheets.clear();
</span><del>-    m_pendingUnnamedContentExtensionStyleSheets.clear();
</del><ins>+    m_pendingContentExtensionDisplayNoneSelectors.clear();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     ASSERT(m_frame-&gt;document()-&gt;parsing());
</span><span class="lines">@@ -1558,10 +1558,10 @@
</span><span class="cx">     m_pendingNamedContentExtensionStyleSheets.set(identifier, &amp;sheet);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DocumentLoader::addPendingContentExtensionSheet(StyleSheetContents&amp; sheet)
</del><ins>+void DocumentLoader::addPendingContentExtensionDisplayNoneSelector(const String&amp; identifier, const String&amp; selector, uint32_t selectorID)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!m_gotFirstByte);
</span><del>-    m_pendingUnnamedContentExtensionStyleSheets.add(&amp;sheet);
</del><ins>+    m_pendingContentExtensionDisplayNoneSelectors.set(identifier, std::make_pair(selector, selectorID));
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentLoader.h (183194 => 183195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.h        2015-04-23 17:48:37 UTC (rev 183194)
+++ trunk/Source/WebCore/loader/DocumentLoader.h        2015-04-23 17:52:21 UTC (rev 183195)
</span><span class="lines">@@ -271,7 +271,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="cx">         void addPendingContentExtensionSheet(const String&amp; identifier, StyleSheetContents&amp;);
</span><del>-        void addPendingContentExtensionSheet(StyleSheetContents&amp;);
</del><ins>+        void addPendingContentExtensionDisplayNoneSelector(const String&amp; identifier, const String&amp; selector, uint32_t selectorID);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     protected:
</span><span class="lines">@@ -440,7 +440,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="cx">         HashMap&lt;String, RefPtr&lt;StyleSheetContents&gt;&gt; m_pendingNamedContentExtensionStyleSheets;
</span><del>-        HashSet&lt;RefPtr&lt;StyleSheetContents&gt;&gt; m_pendingUnnamedContentExtensionStyleSheets;
</del><ins>+        HashMap&lt;String, std::pair&lt;String, uint32_t&gt;&gt; m_pendingContentExtensionDisplayNoneSelectors;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     };
</span></span></pre>
</div>
</div>

</body>
</html>