Title: [230326] trunk/Source
Revision
230326
Author
you...@apple.com
Date
2018-04-05 22:23:19 -0700 (Thu, 05 Apr 2018)

Log Message

REGRESSION (r230223): LayoutTest http/tests/contentextensions/css-display-none-overflows-rule-data-1.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=184306

Reviewed by Ryosuke Niwa.

Source/WebCore:

Add an option to not compile CSS rules since they are not useful in NetworkProcess.
Covered by tests no longer crashing in Debug WK2 bots.

* contentextensions/ContentExtension.cpp:
(WebCore::ContentExtensions::ContentExtension::create):
(WebCore::ContentExtensions::ContentExtension::ContentExtension):
* contentextensions/ContentExtension.h:
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::addContentExtension):
* contentextensions/ContentExtensionsBackend.h:

Source/WebKit:

* NetworkProcess/NetworkContentRuleListManager.cpp:
(WebKit::NetworkContentRuleListManager::addContentRuleLists):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (230325 => 230326)


--- trunk/Source/WebCore/ChangeLog	2018-04-06 05:00:08 UTC (rev 230325)
+++ trunk/Source/WebCore/ChangeLog	2018-04-06 05:23:19 UTC (rev 230326)
@@ -1,3 +1,21 @@
+2018-04-05  Youenn Fablet  <you...@apple.com>
+
+        REGRESSION (r230223): LayoutTest http/tests/contentextensions/css-display-none-overflows-rule-data-1.html is crashing
+        https://bugs.webkit.org/show_bug.cgi?id=184306
+
+        Reviewed by Ryosuke Niwa.
+
+        Add an option to not compile CSS rules since they are not useful in NetworkProcess.
+        Covered by tests no longer crashing in Debug WK2 bots.
+
+        * contentextensions/ContentExtension.cpp:
+        (WebCore::ContentExtensions::ContentExtension::create):
+        (WebCore::ContentExtensions::ContentExtension::ContentExtension):
+        * contentextensions/ContentExtension.h:
+        * contentextensions/ContentExtensionsBackend.cpp:
+        (WebCore::ContentExtensions::ContentExtensionsBackend::addContentExtension):
+        * contentextensions/ContentExtensionsBackend.h:
+
 2018-04-05  Brent Fulgham  <bfulg...@apple.com>
 
         WebContent process is calling CGDisplayUsesInvertedPolarity

Modified: trunk/Source/WebCore/contentextensions/ContentExtension.cpp (230325 => 230326)


--- trunk/Source/WebCore/contentextensions/ContentExtension.cpp	2018-04-06 05:00:08 UTC (rev 230325)
+++ trunk/Source/WebCore/contentextensions/ContentExtension.cpp	2018-04-06 05:23:19 UTC (rev 230326)
@@ -36,12 +36,12 @@
 namespace WebCore {
 namespace ContentExtensions {
 
-Ref<ContentExtension> ContentExtension::create(const String& identifier, Ref<CompiledContentExtension>&& compiledExtension)
+Ref<ContentExtension> ContentExtension::create(const String& identifier, Ref<CompiledContentExtension>&& compiledExtension, ShouldCompileCSS shouldCompileCSS)
 {
-    return adoptRef(*new ContentExtension(identifier, WTFMove(compiledExtension)));
+    return adoptRef(*new ContentExtension(identifier, WTFMove(compiledExtension), shouldCompileCSS));
 }
 
-ContentExtension::ContentExtension(const String& identifier, Ref<CompiledContentExtension>&& compiledExtension)
+ContentExtension::ContentExtension(const String& identifier, Ref<CompiledContentExtension>&& compiledExtension, ShouldCompileCSS shouldCompileCSS)
     : m_identifier(identifier)
     , m_compiledExtension(WTFMove(compiledExtension))
 {
@@ -55,8 +55,9 @@
         ASSERT((action & ~IfConditionFlag) == static_cast<uint32_t>(action));
         m_universalActionsWithConditions.append(action);
     }
-    
-    compileGlobalDisplayNoneStyleSheet();
+
+    if (shouldCompileCSS == ShouldCompileCSS::Yes)
+        compileGlobalDisplayNoneStyleSheet();
     m_universalActionsWithoutConditions.shrinkToFit();
     m_universalActionsWithConditions.shrinkToFit();
 }

Modified: trunk/Source/WebCore/contentextensions/ContentExtension.h (230325 => 230326)


--- trunk/Source/WebCore/contentextensions/ContentExtension.h	2018-04-06 05:00:08 UTC (rev 230325)
+++ trunk/Source/WebCore/contentextensions/ContentExtension.h	2018-04-06 05:23:19 UTC (rev 230326)
@@ -41,7 +41,8 @@
 
 class ContentExtension : public RefCounted<ContentExtension> {
 public:
-    static Ref<ContentExtension> create(const String& identifier, Ref<CompiledContentExtension>&&);
+    enum class ShouldCompileCSS { No, Yes };
+    static Ref<ContentExtension> create(const String& identifier, Ref<CompiledContentExtension>&&, ShouldCompileCSS = ShouldCompileCSS::Yes);
 
     const String& identifier() const { return m_identifier; }
     const CompiledContentExtension& compiledExtension() const { return m_compiledExtension.get(); }
@@ -51,7 +52,7 @@
     const Vector<uint32_t>& universalActionsWithConditions(const URL& topURL);
 
 private:
-    ContentExtension(const String& identifier, Ref<CompiledContentExtension>&&);
+    ContentExtension(const String& identifier, Ref<CompiledContentExtension>&&, ShouldCompileCSS);
     uint32_t findFirstIgnorePreviousRules() const;
     
     String m_identifier;

Modified: trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp (230325 => 230326)


--- trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp	2018-04-06 05:00:08 UTC (rev 230325)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp	2018-04-06 05:23:19 UTC (rev 230326)
@@ -50,13 +50,13 @@
 
 namespace ContentExtensions {
     
-void ContentExtensionsBackend::addContentExtension(const String& identifier, Ref<CompiledContentExtension> compiledContentExtension)
+void ContentExtensionsBackend::addContentExtension(const String& identifier, Ref<CompiledContentExtension> compiledContentExtension, ContentExtension::ShouldCompileCSS shouldCompileCSS)
 {
     ASSERT(!identifier.isEmpty());
     if (identifier.isEmpty())
         return;
     
-    auto contentExtension = ContentExtension::create(identifier, WTFMove(compiledContentExtension));
+    auto contentExtension = ContentExtension::create(identifier, WTFMove(compiledContentExtension), shouldCompileCSS);
     m_contentExtensions.set(identifier, WTFMove(contentExtension));
 }
 

Modified: trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.h (230325 => 230326)


--- trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.h	2018-04-06 05:00:08 UTC (rev 230325)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.h	2018-04-06 05:23:19 UTC (rev 230326)
@@ -56,7 +56,7 @@
 
     // Set a list of rules for a given name. If there were existing rules for the name, they are overriden.
     // The identifier cannot be empty.
-    WEBCORE_EXPORT void addContentExtension(const String& identifier, Ref<CompiledContentExtension>);
+    WEBCORE_EXPORT void addContentExtension(const String& identifier, Ref<CompiledContentExtension>, ContentExtension::ShouldCompileCSS = ContentExtension::ShouldCompileCSS::Yes);
     WEBCORE_EXPORT void removeContentExtension(const String& identifier);
     WEBCORE_EXPORT void removeAllContentExtensions();
 

Modified: trunk/Source/WebKit/ChangeLog (230325 => 230326)


--- trunk/Source/WebKit/ChangeLog	2018-04-06 05:00:08 UTC (rev 230325)
+++ trunk/Source/WebKit/ChangeLog	2018-04-06 05:23:19 UTC (rev 230326)
@@ -1,3 +1,13 @@
+2018-04-05  Youenn Fablet  <you...@apple.com>
+
+        REGRESSION (r230223): LayoutTest http/tests/contentextensions/css-display-none-overflows-rule-data-1.html is crashing
+        https://bugs.webkit.org/show_bug.cgi?id=184306
+
+        Reviewed by Ryosuke Niwa.
+
+        * NetworkProcess/NetworkContentRuleListManager.cpp:
+        (WebKit::NetworkContentRuleListManager::addContentRuleLists):
+
 2018-04-05  Brent Fulgham  <bfulg...@apple.com>
 
         WebContent process is calling CGDisplayUsesInvertedPolarity

Modified: trunk/Source/WebKit/NetworkProcess/NetworkContentRuleListManager.cpp (230325 => 230326)


--- trunk/Source/WebKit/NetworkProcess/NetworkContentRuleListManager.cpp	2018-04-06 05:00:08 UTC (rev 230325)
+++ trunk/Source/WebKit/NetworkProcess/NetworkContentRuleListManager.cpp	2018-04-06 05:23:19 UTC (rev 230326)
@@ -72,7 +72,7 @@
     for (const auto& contentRuleList : contentRuleLists) {
         WebCompiledContentRuleListData contentRuleListData = contentRuleList.second;
         auto compiledContentRuleList = WebCompiledContentRuleList::create(WTFMove(contentRuleListData));
-        backend.addContentExtension(contentRuleList.first, WTFMove(compiledContentRuleList));
+        backend.addContentExtension(contentRuleList.first, WTFMove(compiledContentRuleList), ContentExtensions::ContentExtension::ShouldCompileCSS::No);
     }
 
     auto pendingCallbacks = m_pendingCallbacks.take(identifier);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to