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

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: 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
Index: Source/core/inspector/InspectorStyleSheet.h
diff --git a/Source/core/inspector/InspectorStyleSheet.h b/Source/core/inspector/InspectorStyleSheet.h
index adc3d857238723a4b596fdd373daf65612673ebc..11ddbe5ec2aa2e514d39497f38ec649f71412b87 100644
--- a/Source/core/inspector/InspectorStyleSheet.h
+++ b/Source/core/inspector/InspectorStyleSheet.h
@@ -151,14 +151,14 @@ private:
RefPtrWillBeRawPtr<CSSRuleSourceData> ruleAfterSourceRange(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 mapSourceDataToCSSOM();
bool resourceStyleSheetText(String* result);
bool inlineStyleSheetText(String* result);
PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::Selector>> selectorsFromSource(CSSRuleSourceData*, const String&);
@@ -167,8 +167,8 @@ private:
bool hasSourceURL();
bool startsAtZero();
- void replaceText(const SourceRange&, const String& text, SourceRange* newRange, String* oldText);
- void innerSetText(const String& newText, bool markAsLocallyModified);
+ bool replaceText(const SourceRange&, const String& text, SourceRange* newRange, String* oldText);
+ bool innerSetText(const String& newText, bool markAsLocallyModified);
Element* ownerStyleElement();
RawPtrWillBeMember<InspectorCSSAgent> m_cssAgent;
@@ -177,8 +177,12 @@ private:
TypeBuilder::CSS::StyleSheetOrigin::Enum m_origin;
String m_documentURL;
OwnPtrWillBeMember<RuleSourceDataList> m_sourceData;
+ RefPtrWillBeMember<CSSStyleSheet> m_sourceDataSheet;
String m_text;
CSSRuleVector m_flatRules;
+ typedef HashMap<unsigned, unsigned, WTF::IntHash<unsigned>, WTF::UnsignedWithZeroKeyHashTraits<unsigned>> IndexMap;
+ IndexMap m_ruleToSourceData;
+ IndexMap m_sourceDataToRule;
String m_sourceURL;
};

Powered by Google App Engine
This is Rietveld 408576698