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

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

Issue 1181213007: DevTools: introduce CSS.setStyleText, we'll migrate setPropertyText to it later. (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 unified diff | Download patch | Annotate | Revision Log
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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 public: 168 public:
169 static PassRefPtrWillBeRawPtr<InspectorStyleSheet> create(InspectorResourceA gent*, const String& id, PassRefPtrWillBeRawPtr<CSSStyleSheet> pageStyleSheet, T ypeBuilder::CSS::StyleSheetOrigin::Enum, const String& documentURL, InspectorCSS Agent*); 169 static PassRefPtrWillBeRawPtr<InspectorStyleSheet> create(InspectorResourceA gent*, const String& id, PassRefPtrWillBeRawPtr<CSSStyleSheet> pageStyleSheet, T ypeBuilder::CSS::StyleSheetOrigin::Enum, const String& documentURL, InspectorCSS Agent*);
170 170
171 virtual ~InspectorStyleSheet(); 171 virtual ~InspectorStyleSheet();
172 DECLARE_VIRTUAL_TRACE(); 172 DECLARE_VIRTUAL_TRACE();
173 173
174 String finalURL() const; 174 String finalURL() const;
175 virtual Document* ownerDocument() const override; 175 virtual Document* ownerDocument() const override;
176 virtual bool setText(const String&, ExceptionState&) override; 176 virtual bool setText(const String&, ExceptionState&) override;
177 virtual bool getText(String* result) const override; 177 virtual bool getText(String* result) const override;
178 CSSStyleRule* setRuleSelector(const SourceRange&, const String& selector, So urceRange* newRange, String* oldSelector, ExceptionState&); 178 RefPtrWillBeRawPtr<CSSStyleRule> setRuleSelector(const SourceRange&, const String& selector, SourceRange* newRange, String* oldSelector, ExceptionState&);
179 CSSMediaRule* setMediaRuleText(const SourceRange&, const String& selector, S ourceRange* newRange, String* oldSelector, ExceptionState&); 179 RefPtrWillBeRawPtr<CSSStyleRule> setStyleText(const SourceRange&, const Str ing& text, SourceRange* newRange, String* oldSelector, ExceptionState&);
lushnikov 2015/06/17 13:55:10 this needs to be in InspectorStyleSheetBase
180 CSSStyleRule* addRule(const String& ruleText, const SourceRange& location, S ourceRange* addedRange, ExceptionState&); 180 RefPtrWillBeRawPtr<CSSMediaRule> setMediaRuleText(const SourceRange&, const String& selector, SourceRange* newRange, String* oldSelector, ExceptionState&);
181 RefPtrWillBeRawPtr<CSSStyleRule> addRule(const String& ruleText, const Sour ceRange& location, SourceRange* addedRange, ExceptionState&);
181 bool deleteRule(const SourceRange&, ExceptionState&); 182 bool deleteRule(const SourceRange&, ExceptionState&);
182 183
183 CSSStyleSheet* pageStyleSheet() const { return m_pageStyleSheet.get(); } 184 CSSStyleSheet* pageStyleSheet() const { return m_pageStyleSheet.get(); }
184 185
185 PassRefPtr<TypeBuilder::CSS::CSSStyleSheetHeader> buildObjectForStyleSheetIn fo() const; 186 PassRefPtr<TypeBuilder::CSS::CSSStyleSheetHeader> buildObjectForStyleSheetIn fo() const;
186 PassRefPtr<TypeBuilder::CSS::CSSRule> buildObjectForRule(CSSStyleRule*, Pass RefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSMedia> >); 187 PassRefPtr<TypeBuilder::CSS::CSSRule> buildObjectForRule(CSSStyleRule*, Pass RefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSMedia> >);
187 188
188 PassRefPtr<TypeBuilder::CSS::SourceRange> ruleHeaderSourceRange(const CSSRul e*); 189 PassRefPtr<TypeBuilder::CSS::SourceRange> ruleHeaderSourceRange(const CSSRul e*);
189 PassRefPtr<TypeBuilder::CSS::SourceRange> mediaQueryExpValueSourceRange(cons t CSSRule*, size_t mediaQueryIndex, size_t mediaQueryExpIndex); 190 PassRefPtr<TypeBuilder::CSS::SourceRange> mediaQueryExpValueSourceRange(cons t CSSRule*, size_t mediaQueryIndex, size_t mediaQueryExpIndex);
190 191
(...skipping 12 matching lines...) Expand all
203 virtual unsigned ruleCount() override; 204 virtual unsigned ruleCount() override;
204 205
205 // Also accessed by friend class InspectorStyle. 206 // Also accessed by friend class InspectorStyle.
206 virtual PassRefPtrWillBeRawPtr<CSSRuleSourceData> ruleSourceDataAt(unsigned) const override; 207 virtual PassRefPtrWillBeRawPtr<CSSRuleSourceData> ruleSourceDataAt(unsigned) const override;
207 virtual bool ensureParsedDataReady() override; 208 virtual bool ensureParsedDataReady() override;
208 209
209 private: 210 private:
210 InspectorStyleSheet(InspectorResourceAgent*, const String& id, PassRefPtrWil lBeRawPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOrigin::Enu m, const String& documentURL, InspectorCSSAgent*); 211 InspectorStyleSheet(InspectorResourceAgent*, const String& id, PassRefPtrWil lBeRawPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOrigin::Enu m, const String& documentURL, InspectorCSSAgent*);
211 unsigned ruleIndexBySourceRange(const CSSMediaRule* parentMediaRule, const S ourceRange&); 212 unsigned ruleIndexBySourceRange(const CSSMediaRule* parentMediaRule, const S ourceRange&);
212 bool findRuleByHeaderRange(const SourceRange&, CSSRule**, CSSRuleSourceData* *); 213 bool findRuleByHeaderRange(const SourceRange&, CSSRule**, CSSRuleSourceData* *);
214 bool findRuleByBodyRange(const SourceRange&, CSSRule**, CSSRuleSourceData**) ;
lushnikov 2015/06/17 13:55:10 ditto
213 CSSStyleRule* insertCSSOMRuleInStyleSheet(const SourceRange&, const String& ruleText, ExceptionState&); 215 CSSStyleRule* insertCSSOMRuleInStyleSheet(const SourceRange&, const String& ruleText, ExceptionState&);
214 CSSStyleRule* insertCSSOMRuleInMediaRule(CSSMediaRule*, const SourceRange&, const String& ruleText, ExceptionState&); 216 CSSStyleRule* insertCSSOMRuleInMediaRule(CSSMediaRule*, const SourceRange&, const String& ruleText, ExceptionState&);
215 CSSStyleRule* insertCSSOMRuleBySourceRange(const SourceRange&, const String& ruleText, ExceptionState&); 217 CSSStyleRule* insertCSSOMRuleBySourceRange(const SourceRange&, const String& ruleText, ExceptionState&);
216 bool verifyRuleText(const String& ruleText); 218 bool verifyRuleText(const String& ruleText);
217 bool verifySelectorText(const String& selectorText); 219 bool verifySelectorText(const String& selectorText);
218 bool verifyMediaText(const String& mediaText); 220 bool verifyMediaText(const String& mediaText);
219 String sourceMapURL() const; 221 String sourceMapURL() const;
220 String sourceURL() const; 222 String sourceURL() const;
221 bool ensureText() const; 223 bool ensureText() const;
222 void ensureFlatRules() const; 224 void ensureFlatRules() const;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 mutable String m_styleText; 283 mutable String m_styleText;
282 mutable bool m_isStyleTextValid; 284 mutable bool m_isStyleTextValid;
283 }; 285 };
284 286
285 287
286 } // namespace blink 288 } // namespace blink
287 289
288 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::InspectorStyleProperty); 290 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::InspectorStyleProperty);
289 291
290 #endif // !defined(InspectorStyleSheet_h) 292 #endif // !defined(InspectorStyleSheet_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698