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

Side by Side Diff: Source/core/inspector/InspectorStyleSheet.h

Issue 1204473006: DevTools: explicitly map CSSOM rules to source ranges. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: for landing 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/inspector/InspectorStyleSheet.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 RefPtrWillBeRawPtr<CSSStyleRule> setStyleText(const SourceRange&, const Str ing& text, SourceRange* newRange, String* oldSelector, ExceptionState&); 130 RefPtrWillBeRawPtr<CSSStyleRule> setStyleText(const SourceRange&, const Str ing& text, SourceRange* newRange, String* oldSelector, ExceptionState&);
131 RefPtrWillBeRawPtr<CSSMediaRule> setMediaRuleText(const SourceRange&, const String& selector, SourceRange* newRange, String* oldSelector, ExceptionState&); 131 RefPtrWillBeRawPtr<CSSMediaRule> setMediaRuleText(const SourceRange&, const String& selector, SourceRange* newRange, String* oldSelector, ExceptionState&);
132 RefPtrWillBeRawPtr<CSSStyleRule> addRule(const String& ruleText, const Sour ceRange& location, SourceRange* addedRange, ExceptionState&); 132 RefPtrWillBeRawPtr<CSSStyleRule> addRule(const String& ruleText, const Sour ceRange& location, SourceRange* addedRange, ExceptionState&);
133 bool deleteRule(const SourceRange&, ExceptionState&); 133 bool deleteRule(const SourceRange&, ExceptionState&);
134 134
135 CSSStyleSheet* pageStyleSheet() { return m_pageStyleSheet.get(); } 135 CSSStyleSheet* pageStyleSheet() { return m_pageStyleSheet.get(); }
136 136
137 PassRefPtr<TypeBuilder::CSS::CSSStyleSheetHeader> buildObjectForStyleSheetIn fo(); 137 PassRefPtr<TypeBuilder::CSS::CSSStyleSheetHeader> buildObjectForStyleSheetIn fo();
138 PassRefPtr<TypeBuilder::CSS::CSSRule> buildObjectForRule(CSSStyleRule*, Pass RefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSMedia> >); 138 PassRefPtr<TypeBuilder::CSS::CSSRule> buildObjectForRule(CSSStyleRule*, Pass RefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSMedia> >);
139 139
140 PassRefPtr<TypeBuilder::CSS::SourceRange> ruleHeaderSourceRange(const CSSRul e*); 140 PassRefPtr<TypeBuilder::CSS::SourceRange> ruleHeaderSourceRange(CSSRule*);
141 PassRefPtr<TypeBuilder::CSS::SourceRange> mediaQueryExpValueSourceRange(cons t CSSRule*, size_t mediaQueryIndex, size_t mediaQueryExpIndex); 141 PassRefPtr<TypeBuilder::CSS::SourceRange> mediaQueryExpValueSourceRange(CSSR ule*, size_t mediaQueryIndex, size_t mediaQueryExpIndex);
142 142
143 bool isInlineStyle() override { return false; } 143 bool isInlineStyle() override { return false; }
144 const CSSRuleVector& flatRules(); 144 const CSSRuleVector& flatRules();
145 145
146 protected: 146 protected:
147 virtual PassRefPtrWillBeRawPtr<InspectorStyle> inspectorStyle(RefPtrWillBeRa wPtr<CSSStyleDeclaration>) override; 147 virtual PassRefPtrWillBeRawPtr<InspectorStyle> inspectorStyle(RefPtrWillBeRa wPtr<CSSStyleDeclaration>) override;
148 148
149 private: 149 private:
150 InspectorStyleSheet(InspectorResourceAgent*, const String& id, PassRefPtrWil lBeRawPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOrigin::Enu m, const String& documentURL, InspectorCSSAgent*); 150 InspectorStyleSheet(InspectorResourceAgent*, const String& id, PassRefPtrWil lBeRawPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOrigin::Enu m, const String& documentURL, InspectorCSSAgent*);
151 unsigned ruleIndexBySourceRange(const CSSMediaRule* parentMediaRule, const S ourceRange&); 151 unsigned ruleIndexBySourceRange(CSSMediaRule* parentMediaRule, const SourceR ange&);
152 bool findRuleByHeaderRange(const SourceRange&, CSSRule**, CSSRuleSourceData* *); 152 RefPtrWillBeRawPtr<CSSRuleSourceData> findRuleByHeaderRange(const SourceRang e&);
153 bool findRuleByBodyRange(const SourceRange&, CSSRule**, CSSRuleSourceData**) ; 153 RefPtrWillBeRawPtr<CSSRuleSourceData> findRuleByBodyRange(const SourceRange& );
154 RefPtrWillBeRawPtr<CSSRule> ruleForSourceData(CSSRuleSourceData*);
155 RefPtrWillBeRawPtr<CSSRuleSourceData> sourceDataForRule(CSSRule*);
154 CSSStyleRule* insertCSSOMRuleInStyleSheet(const SourceRange&, const String& ruleText, ExceptionState&); 156 CSSStyleRule* insertCSSOMRuleInStyleSheet(const SourceRange&, const String& ruleText, ExceptionState&);
155 CSSStyleRule* insertCSSOMRuleInMediaRule(CSSMediaRule*, const SourceRange&, const String& ruleText, ExceptionState&); 157 CSSStyleRule* insertCSSOMRuleInMediaRule(CSSMediaRule*, const SourceRange&, const String& ruleText, ExceptionState&);
156 CSSStyleRule* insertCSSOMRuleBySourceRange(const SourceRange&, const String& ruleText, ExceptionState&); 158 CSSStyleRule* insertCSSOMRuleBySourceRange(const SourceRange&, const String& ruleText, ExceptionState&);
157 String sourceMapURL(); 159 String sourceMapURL();
158 String sourceURL(); 160 String sourceURL();
159 void ensureFlatRules(); 161 void collectFlatRules();
160 bool resourceStyleSheetText(String* result); 162 bool resourceStyleSheetText(String* result);
161 bool inlineStyleSheetText(String* result); 163 bool inlineStyleSheetText(String* result);
162 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::Selector> > selectorsFromSou rce(const CSSRuleSourceData*, const String&); 164 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::Selector>> selectorsFromSour ce(CSSRuleSourceData*, const String&);
163 PassRefPtr<TypeBuilder::CSS::SelectorList> buildObjectForSelectorList(CSSSty leRule*); 165 PassRefPtr<TypeBuilder::CSS::SelectorList> buildObjectForSelectorList(CSSSty leRule*);
164 String url(); 166 String url();
165 bool hasSourceURL(); 167 bool hasSourceURL();
166 bool startsAtZero(); 168 bool startsAtZero();
167 169
168 unsigned indexOf(CSSStyleDeclaration*);
169 void replaceText(const SourceRange&, const String& text, SourceRange* newRan ge, String* oldText); 170 void replaceText(const SourceRange&, const String& text, SourceRange* newRan ge, String* oldText);
170 void innerSetText(const String& newText, bool markAsLocallyModified); 171 void innerSetText(const String& newText, bool markAsLocallyModified);
171 Element* ownerStyleElement(); 172 Element* ownerStyleElement();
172 173
173 RawPtrWillBeMember<InspectorCSSAgent> m_cssAgent; 174 RawPtrWillBeMember<InspectorCSSAgent> m_cssAgent;
174 RawPtrWillBeMember<InspectorResourceAgent> m_resourceAgent; 175 RawPtrWillBeMember<InspectorResourceAgent> m_resourceAgent;
175 RefPtrWillBeMember<CSSStyleSheet> m_pageStyleSheet; 176 RefPtrWillBeMember<CSSStyleSheet> m_pageStyleSheet;
176 TypeBuilder::CSS::StyleSheetOrigin::Enum m_origin; 177 TypeBuilder::CSS::StyleSheetOrigin::Enum m_origin;
177 String m_documentURL; 178 String m_documentURL;
178 OwnPtrWillBeMember<RuleSourceDataList> m_sourceData; 179 OwnPtrWillBeMember<RuleSourceDataList> m_sourceData;
(...skipping 23 matching lines...) Expand all
202 InspectorStyleSheetForInlineStyle(const String& id, PassRefPtrWillBeRawPtr<E lement>, Listener*); 203 InspectorStyleSheetForInlineStyle(const String& id, PassRefPtrWillBeRawPtr<E lement>, Listener*);
203 const String& elementStyleText(); 204 const String& elementStyleText();
204 205
205 RefPtrWillBeMember<Element> m_element; 206 RefPtrWillBeMember<Element> m_element;
206 RefPtrWillBeMember<InspectorStyle> m_inspectorStyle; 207 RefPtrWillBeMember<InspectorStyle> m_inspectorStyle;
207 }; 208 };
208 209
209 } // namespace blink 210 } // namespace blink
210 211
211 #endif // !defined(InspectorStyleSheet_h) 212 #endif // !defined(InspectorStyleSheet_h)
OLDNEW
« no previous file with comments | « no previous file | Source/core/inspector/InspectorStyleSheet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698