Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Unified Diff: Source/core/css/CSSStyleSheet.h

Issue 49093005: Fix memory error during selector matching due to getMatchedCSSRules. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address review comments Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/css/CSSStyleSheet.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSStyleSheet.h
diff --git a/Source/core/css/CSSStyleSheet.h b/Source/core/css/CSSStyleSheet.h
index c0eeb6f0d1db2c5fafcc847e01f3dfe3fda6e742..6740a6bb89b22700986ddc4de0497e8b7ab68407 100644
--- a/Source/core/css/CSSStyleSheet.h
+++ b/Source/core/css/CSSStyleSheet.h
@@ -103,7 +103,8 @@ public:
void didMutate(StyleSheetUpdateType = PartialRuleUpdate);
void clearChildRuleCSSOMWrappers();
- void reattachChildRuleCSSOMWrappers();
+
+ void registerExtraChildRuleCSSOMWrapper(PassRefPtr<CSSRule>);
StyleSheetContents* contents() const { return m_contents.get(); }
@@ -117,6 +118,9 @@ private:
virtual bool isCSSStyleSheet() const { return true; }
virtual String type() const { return "text/css"; }
+ void extraCSSOMWrapperIndices(Vector<unsigned>& indices);
+ void reattachChildRuleCSSOMWrappers(const Vector<unsigned>& extraCSSOMWrapperIndices);
+
bool canAccessRules() const;
RefPtr<StyleSheetContents> m_contents;
@@ -132,6 +136,9 @@ private:
mutable RefPtr<MediaList> m_mediaCSSOMWrapper;
mutable Vector<RefPtr<CSSRule> > m_childRuleCSSOMWrappers;
+ // These are CSSOMWrappers that come from getMatchedCSSRules and thus don't map 1-1 to
+ // the StyleRules in the StyleSheetContents.
+ mutable Vector<RefPtr<CSSRule> > m_extraChildRuleCSSOMWrappers;
mutable OwnPtr<CSSRuleList> m_ruleListCSSOMWrapper;
};
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/css/CSSStyleSheet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698