Title: [156178] trunk/Source/WebCore
Revision
156178
Author
[email protected]
Date
2013-09-20 10:18:14 -0700 (Fri, 20 Sep 2013)

Log Message

Fix a couple more CSS leaks
https://bugs.webkit.org/show_bug.cgi?id=121683

Reviewed by Alexey Proskuryakov.

* css/CSSDefaultStyleSheets.cpp:
(WebCore::CSSDefaultStyleSheets::viewSourceStyle): Put the result of the
parseUASheet into a global variable so it doesn't show up as a storage leak.

* css/CSSGrammar.y.in: Added a missing adoptRef. This was leaking any rule
we parsed individually.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (156177 => 156178)


--- trunk/Source/WebCore/ChangeLog	2013-09-20 17:16:56 UTC (rev 156177)
+++ trunk/Source/WebCore/ChangeLog	2013-09-20 17:18:14 UTC (rev 156178)
@@ -1,3 +1,17 @@
+2013-09-20  Darin Adler  <[email protected]>
+
+        Fix a couple more CSS leaks
+        https://bugs.webkit.org/show_bug.cgi?id=121683
+
+        Reviewed by Alexey Proskuryakov.
+
+        * css/CSSDefaultStyleSheets.cpp:
+        (WebCore::CSSDefaultStyleSheets::viewSourceStyle): Put the result of the
+        parseUASheet into a global variable so it doesn't show up as a storage leak.
+
+        * css/CSSGrammar.y.in: Added a missing adoptRef. This was leaking any rule
+        we parsed individually.
+
 2013-09-20  Bem Jones-Bey  <[email protected]>
 
         Simplify the ShapeOutsideInfo and ShapeInfo interfaces

Modified: trunk/Source/WebCore/css/CSSDefaultStyleSheets.cpp (156177 => 156178)


--- trunk/Source/WebCore/css/CSSDefaultStyleSheets.cpp	2013-09-20 17:16:56 UTC (rev 156177)
+++ trunk/Source/WebCore/css/CSSDefaultStyleSheets.cpp	2013-09-20 17:18:14 UTC (rev 156178)
@@ -148,8 +148,9 @@
 RuleSet* CSSDefaultStyleSheets::viewSourceStyle()
 {
     if (!defaultViewSourceStyle) {
+        static StyleSheetContents* viewSourceStyleSheet = parseUASheet(sourceUserAgentStyleSheet, sizeof(sourceUserAgentStyleSheet));
         defaultViewSourceStyle = RuleSet::create().leakPtr();
-        defaultViewSourceStyle->addRulesFromSheet(parseUASheet(sourceUserAgentStyleSheet, sizeof(sourceUserAgentStyleSheet)), screenEval());
+        defaultViewSourceStyle->addRulesFromSheet(viewSourceStyleSheet, screenEval());
     }
     return defaultViewSourceStyle;
 }

Modified: trunk/Source/WebCore/css/CSSGrammar.y.in (156177 => 156178)


--- trunk/Source/WebCore/css/CSSGrammar.y.in	2013-09-20 17:16:56 UTC (rev 156177)
+++ trunk/Source/WebCore/css/CSSGrammar.y.in	2013-09-20 17:18:14 UTC (rev 156178)
@@ -328,7 +328,7 @@
 #endif
   ;
 
-webkit_rule: WEBKIT_RULE_SYM '{' maybe_space valid_rule maybe_space '}' { parser->m_rule = $4; } ;
+webkit_rule: WEBKIT_RULE_SYM '{' maybe_space valid_rule maybe_space '}' { parser->m_rule = adoptRef($4); } ;
 
 webkit_keyframe_rule: WEBKIT_KEYFRAME_RULE_SYM '{' maybe_space keyframe_rule maybe_space '}' { parser->m_keyframe = adoptRef($4); } ;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to