Title: [292095] trunk/Source/WebCore
Revision
292095
Author
brandonstew...@apple.com
Date
2022-03-29 23:12:44 -0700 (Tue, 29 Mar 2022)

Log Message

Ensure m_layerRulesBeforeImportRules is properly copied during StyleSheetContents instantiation
https://bugs.webkit.org/show_bug.cgi?id=238537

Reviewed by Antti Koivisto.

During the instantiation of the StyleSheetContents the m_layerRulesBeforeImportRules was not being
properly copied.

* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::StyleSheetContents):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (292094 => 292095)


--- trunk/Source/WebCore/ChangeLog	2022-03-30 01:57:04 UTC (rev 292094)
+++ trunk/Source/WebCore/ChangeLog	2022-03-30 06:12:44 UTC (rev 292095)
@@ -1,3 +1,16 @@
+2022-03-29  Brandon Stewart  <brandonstew...@apple.com>
+
+        Ensure m_layerRulesBeforeImportRules is properly copied during StyleSheetContents instantiation
+        https://bugs.webkit.org/show_bug.cgi?id=238537
+
+        Reviewed by Antti Koivisto.
+
+        During the instantiation of the StyleSheetContents the m_layerRulesBeforeImportRules was not being
+        properly copied.
+
+        * css/StyleSheetContents.cpp:
+        (WebCore::StyleSheetContents::StyleSheetContents):
+
 2022-03-29  Diego Pino Garcia  <dp...@igalia.com>
 
         [GCC] Ubuntu LTS build broken after r291956

Modified: trunk/Source/WebCore/css/StyleSheetContents.cpp (292094 => 292095)


--- trunk/Source/WebCore/css/StyleSheetContents.cpp	2022-03-30 01:57:04 UTC (rev 292094)
+++ trunk/Source/WebCore/css/StyleSheetContents.cpp	2022-03-30 06:12:44 UTC (rev 292095)
@@ -81,6 +81,7 @@
     , m_ownerRule(nullptr)
     , m_originalURL(o.m_originalURL)
     , m_encodingFromCharsetRule(o.m_encodingFromCharsetRule)
+    , m_layerRulesBeforeImportRules(o.m_layerRulesBeforeImportRules.size())
     , m_importRules(o.m_importRules.size())
     , m_namespaceRules(o.m_namespaceRules.size())
     , m_childRules(o.m_childRules.size())
@@ -97,7 +98,10 @@
     // FIXME: Copy import rules.
     ASSERT(o.m_importRules.isEmpty());
 
-    for (unsigned i = 0; i < m_childRules.size(); ++i)
+    for (size_t i = 0; i < m_layerRulesBeforeImportRules.size(); ++i)
+        m_layerRulesBeforeImportRules[i] = o.m_layerRulesBeforeImportRules[i]->copy();
+
+    for (size_t i = 0; i < m_childRules.size(); ++i)
         m_childRules[i] = o.m_childRules[i]->copy();
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to