Title: [275609] trunk/Source/WebCore
Revision
275609
Author
[email protected]
Date
2021-04-07 09:56:14 -0700 (Wed, 07 Apr 2021)

Log Message

Wasted vector capacity in StyleSheetContents
https://bugs.webkit.org/show_bug.cgi?id=224250

Reviewed by Darin Adler.

Call shrinkToFit() on the StyleSheetContents created in CSSParserImpl::parseStyleSheet()
in order to shrink m_importRules and m_childRules, which can waste about 100KB on
youtube.com.

* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::parseStyleSheet):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (275608 => 275609)


--- trunk/Source/WebCore/ChangeLog	2021-04-07 16:26:36 UTC (rev 275608)
+++ trunk/Source/WebCore/ChangeLog	2021-04-07 16:56:14 UTC (rev 275609)
@@ -1,3 +1,17 @@
+2021-04-07  Simon Fraser  <[email protected]>
+
+        Wasted vector capacity in StyleSheetContents
+        https://bugs.webkit.org/show_bug.cgi?id=224250
+
+        Reviewed by Darin Adler.
+
+        Call shrinkToFit() on the StyleSheetContents created in CSSParserImpl::parseStyleSheet()
+        in order to shrink m_importRules and m_childRules, which can waste about 100KB on
+        youtube.com.
+
+        * css/parser/CSSParserImpl.cpp:
+        (WebCore::CSSParserImpl::parseStyleSheet):
+
 2021-04-07  Zalan Bujtas  <[email protected]>
 
         REGRESSION (r270849): Button content fails to render on apple.com "Blood Oxygen"/"ECG"

Modified: trunk/Source/WebCore/css/parser/CSSParserImpl.cpp (275608 => 275609)


--- trunk/Source/WebCore/css/parser/CSSParserImpl.cpp	2021-04-07 16:26:36 UTC (rev 275608)
+++ trunk/Source/WebCore/css/parser/CSSParserImpl.cpp	2021-04-07 16:56:14 UTC (rev 275609)
@@ -251,6 +251,7 @@
         styleSheet->parserAppendRule(rule.releaseNonNull());
     });
     styleSheet->setHasSyntacticallyValidCSSHeader(firstRuleValid);
+    styleSheet->shrinkToFit();
     parser.adoptTokenizerEscapedStrings();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to