Fix api tests after r181876.
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Mar 2015 01:01:55 +0000 (01:01 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Mar 2015 01:01:55 +0000 (01:01 +0000)
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
Always append a CSSDisplayNoneStyleSheet action if no ignore-previous-rules is seen.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
Changed an assertion to a null check.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181883 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/contentextensions/ContentExtensionsBackend.cpp
Source/WebCore/loader/cache/CachedResourceLoader.cpp

index fb49fd5..9e7a250 100644 (file)
@@ -1,3 +1,14 @@
+2015-03-23  Alex Christensen  <achristensen@webkit.org>
+
+        Fix api tests after r181876.
+
+        * contentextensions/ContentExtensionsBackend.cpp:
+        (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
+        Always append a CSSDisplayNoneStyleSheet action if no ignore-previous-rules is seen.
+        * loader/cache/CachedResourceLoader.cpp:
+        (WebCore::CachedResourceLoader::requestResource):
+        Changed an assertion to a null check.
+
 2015-03-23  Dean Jackson  <dino@apple.com>
 
         Timelines are sharing the same canvas background
index 82ed861..1c983d9 100644 (file)
@@ -99,7 +99,7 @@ Vector<Action> ContentExtensionsBackend::actionsForResourceLoad(const ResourceLo
                 finalActions.append(action);
             }
 
-            if (!sawIgnorePreviousRules && contentExtension->globalDisplayNoneStyleSheet())
+            if (!sawIgnorePreviousRules)
                 finalActions.append(Action(ActionType::CSSDisplayNoneStyleSheet, contentExtension->identifier()));
         }
     }
index cd13fbb..f5078cd 100644 (file)
@@ -538,13 +538,12 @@ CachedResourceHandle<CachedResource> CachedResourceLoader::requestResource(Cache
             break;
         case ContentExtensions::ActionType::CSSDisplayNoneStyleSheet: {
             StyleSheetContents* styleSheetContents = userContentController->globalDisplayNoneStyleSheet(action.stringArgument());
-            RELEASE_ASSERT(styleSheetContents);
-
-            if (type == CachedResource::MainResource && request.initiatingDocumentLoader())
-                request.initiatingDocumentLoader()->addPendingContentExtensionSheet(action.stringArgument(), *styleSheetContents);
-            else if (m_document)
-                m_document->styleSheetCollection().maybeAddContentExtensionSheet(action.stringArgument(), *styleSheetContents);
-
+            if (styleSheetContents) {
+                if (type == CachedResource::MainResource && request.initiatingDocumentLoader())
+                    request.initiatingDocumentLoader()->addPendingContentExtensionSheet(action.stringArgument(), *styleSheetContents);
+                else if (m_document)
+                    m_document->styleSheetCollection().maybeAddContentExtensionSheet(action.stringArgument(), *styleSheetContents);
+            }
             break;
         }
         case ContentExtensions::ActionType::IgnorePreviousRules: