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

Unified Diff: Source/core/inspector/InspectorStyleSheet.h

Issue 1211813002: DevTools: allow injecting CSS rules without breaking styles sidebar. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review comments addressed. Created 5 years, 6 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/css/parser/CSSParserImpl.cpp ('k') | Source/core/inspector/InspectorStyleSheet.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorStyleSheet.h
diff --git a/Source/core/inspector/InspectorStyleSheet.h b/Source/core/inspector/InspectorStyleSheet.h
index adc3d857238723a4b596fdd373daf65612673ebc..d265924c71fe129f9f581ee7cec7b015c7bc8793 100644
--- a/Source/core/inspector/InspectorStyleSheet.h
+++ b/Source/core/inspector/InspectorStyleSheet.h
@@ -148,17 +148,18 @@ protected:
private:
InspectorStyleSheet(InspectorResourceAgent*, const String& id, PassRefPtrWillBeRawPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOrigin::Enum, const String& documentURL, InspectorCSSAgent*);
- RefPtrWillBeRawPtr<CSSRuleSourceData> ruleAfterSourceRange(const SourceRange&);
+ RefPtrWillBeRawPtr<CSSRuleSourceData> ruleSourceDataAfterSourceRange(const SourceRange&);
RefPtrWillBeRawPtr<CSSRuleSourceData> findRuleByHeaderRange(const SourceRange&);
RefPtrWillBeRawPtr<CSSRuleSourceData> findRuleByBodyRange(const SourceRange&);
- RefPtrWillBeRawPtr<CSSRule> ruleForSourceData(CSSRuleSourceData*);
- RefPtrWillBeRawPtr<CSSRuleSourceData> sourceDataForRule(CSSRule*);
+ RefPtrWillBeRawPtr<CSSRule> ruleForSourceData(RefPtrWillBeRawPtr<CSSRuleSourceData>);
+ RefPtrWillBeRawPtr<CSSRuleSourceData> sourceDataForRule(RefPtrWillBeRawPtr<CSSRule>);
CSSStyleRule* insertCSSOMRuleInStyleSheet(CSSRule* insertBefore, const String& ruleText, ExceptionState&);
CSSStyleRule* insertCSSOMRuleInMediaRule(CSSMediaRule*, CSSRule* insertBefore, const String& ruleText, ExceptionState&);
CSSStyleRule* insertCSSOMRuleBySourceRange(const SourceRange&, const String& ruleText, ExceptionState&);
String sourceMapURL();
String sourceURL();
- void collectFlatRules();
+ void remapSourceDataToCSSOMIfNecessary();
+ void mapSourceDataToCSSOM();
bool resourceStyleSheetText(String* result);
bool inlineStyleSheetText(String* result);
PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::Selector>> selectorsFromSource(CSSRuleSourceData*, const String&);
@@ -178,7 +179,11 @@ private:
String m_documentURL;
OwnPtrWillBeMember<RuleSourceDataList> m_sourceData;
String m_text;
- CSSRuleVector m_flatRules;
+ CSSRuleVector m_cssomFlatRules;
+ CSSRuleVector m_parsedFlatRules;
+ typedef HashMap<unsigned, unsigned, WTF::IntHash<unsigned>, WTF::UnsignedWithZeroKeyHashTraits<unsigned>> IndexMap;
+ IndexMap m_ruleToSourceData;
+ IndexMap m_sourceDataToRule;
String m_sourceURL;
};
« no previous file with comments | « Source/core/css/parser/CSSParserImpl.cpp ('k') | Source/core/inspector/InspectorStyleSheet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698