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

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

Issue 1085033003: Introduce InspectorIdentifiers<> and use it to assign/lookup LocalFrame and DocumentLoader (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: win build error fixed Created 5 years, 8 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 namespace blink { 42 namespace blink {
43 43
44 class CSSMediaRule; 44 class CSSMediaRule;
45 class CSSStyleDeclaration; 45 class CSSStyleDeclaration;
46 class CSSStyleRule; 46 class CSSStyleRule;
47 class CSSStyleSheet; 47 class CSSStyleSheet;
48 class Document; 48 class Document;
49 class Element; 49 class Element;
50 class ExceptionState; 50 class ExceptionState;
51 class InspectorCSSAgent; 51 class InspectorCSSAgent;
52 class InspectorPageAgent;
53 class InspectorResourceAgent; 52 class InspectorResourceAgent;
54 class InspectorStyleSheetBase; 53 class InspectorStyleSheetBase;
55 54
56 typedef WillBeHeapVector<RefPtrWillBeMember<CSSRule> > CSSRuleVector; 55 typedef WillBeHeapVector<RefPtrWillBeMember<CSSRule> > CSSRuleVector;
57 typedef String ErrorString; 56 typedef String ErrorString;
58 typedef Vector<unsigned> LineEndings; 57 typedef Vector<unsigned> LineEndings;
59 58
60 class InspectorCSSId { 59 class InspectorCSSId {
61 public: 60 public:
62 InspectorCSSId() 61 InspectorCSSId()
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 private: 182 private:
184 friend class InspectorStyle; 183 friend class InspectorStyle;
185 184
186 String m_id; 185 String m_id;
187 Listener* m_listener; 186 Listener* m_listener;
188 OwnPtr<LineEndings> m_lineEndings; 187 OwnPtr<LineEndings> m_lineEndings;
189 }; 188 };
190 189
191 class InspectorStyleSheet : public InspectorStyleSheetBase { 190 class InspectorStyleSheet : public InspectorStyleSheetBase {
192 public: 191 public:
193 static PassRefPtrWillBeRawPtr<InspectorStyleSheet> create(InspectorPageAgent *, InspectorResourceAgent*, const String& id, PassRefPtrWillBeRawPtr<CSSStyleShe et> pageStyleSheet, TypeBuilder::CSS::StyleSheetOrigin::Enum, const String& docu mentURL, InspectorCSSAgent*); 192 static PassRefPtrWillBeRawPtr<InspectorStyleSheet> create(InspectorResourceA gent*, const String& id, PassRefPtrWillBeRawPtr<CSSStyleSheet> pageStyleSheet, T ypeBuilder::CSS::StyleSheetOrigin::Enum, const String& documentURL, InspectorCSS Agent*);
194 193
195 virtual ~InspectorStyleSheet(); 194 virtual ~InspectorStyleSheet();
196 DECLARE_VIRTUAL_TRACE(); 195 DECLARE_VIRTUAL_TRACE();
197 196
198 String finalURL() const; 197 String finalURL() const;
199 virtual Document* ownerDocument() const override; 198 virtual Document* ownerDocument() const override;
200 virtual bool setText(const String&, ExceptionState&) override; 199 virtual bool setText(const String&, ExceptionState&) override;
201 virtual bool getText(String* result) const override; 200 virtual bool getText(String* result) const override;
202 String ruleSelector(const InspectorCSSId&, ExceptionState&); 201 String ruleSelector(const InspectorCSSId&, ExceptionState&);
203 bool setRuleSelector(const InspectorCSSId&, const String& selector, Exceptio nState&); 202 bool setRuleSelector(const InspectorCSSId&, const String& selector, Exceptio nState&);
(...skipping 25 matching lines...) Expand all
229 228
230 protected: 229 protected:
231 virtual PassRefPtrWillBeRawPtr<InspectorStyle> inspectorStyleForId(const Ins pectorCSSId&) override; 230 virtual PassRefPtrWillBeRawPtr<InspectorStyle> inspectorStyleForId(const Ins pectorCSSId&) override;
232 virtual unsigned ruleCount() override; 231 virtual unsigned ruleCount() override;
233 232
234 // Also accessed by friend class InspectorStyle. 233 // Also accessed by friend class InspectorStyle.
235 virtual PassRefPtrWillBeRawPtr<CSSRuleSourceData> ruleSourceDataAt(unsigned) const override; 234 virtual PassRefPtrWillBeRawPtr<CSSRuleSourceData> ruleSourceDataAt(unsigned) const override;
236 virtual bool ensureParsedDataReady() override; 235 virtual bool ensureParsedDataReady() override;
237 236
238 private: 237 private:
239 InspectorStyleSheet(InspectorPageAgent*, InspectorResourceAgent*, const Stri ng& id, PassRefPtrWillBeRawPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS:: StyleSheetOrigin::Enum, const String& documentURL, InspectorCSSAgent*); 238 InspectorStyleSheet(InspectorResourceAgent*, const String& id, PassRefPtrWil lBeRawPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOrigin::Enu m, const String& documentURL, InspectorCSSAgent*);
240 unsigned ruleIndexBySourceRange(const CSSMediaRule* parentMediaRule, const S ourceRange&); 239 unsigned ruleIndexBySourceRange(const CSSMediaRule* parentMediaRule, const S ourceRange&);
241 CSSStyleRule* insertCSSOMRuleInStyleSheet(const SourceRange&, const String& ruleText, ExceptionState&); 240 CSSStyleRule* insertCSSOMRuleInStyleSheet(const SourceRange&, const String& ruleText, ExceptionState&);
242 CSSStyleRule* insertCSSOMRuleInMediaRule(CSSMediaRule*, const SourceRange&, const String& ruleText, ExceptionState&); 241 CSSStyleRule* insertCSSOMRuleInMediaRule(CSSMediaRule*, const SourceRange&, const String& ruleText, ExceptionState&);
243 CSSStyleRule* insertCSSOMRuleBySourceRange(const SourceRange&, const String& ruleText, ExceptionState&); 242 CSSStyleRule* insertCSSOMRuleBySourceRange(const SourceRange&, const String& ruleText, ExceptionState&);
244 bool verifyRuleText(const String& ruleText); 243 bool verifyRuleText(const String& ruleText);
245 bool verifySelectorText(const String& selectorText); 244 bool verifySelectorText(const String& selectorText);
246 bool verifyMediaText(const String& mediaText); 245 bool verifyMediaText(const String& mediaText);
247 unsigned ruleIndexByStyle(CSSStyleDeclaration*) const; 246 unsigned ruleIndexByStyle(CSSStyleDeclaration*) const;
248 String sourceMapURL() const; 247 String sourceMapURL() const;
249 String sourceURL() const; 248 String sourceURL() const;
250 bool ensureText() const; 249 bool ensureText() const;
251 void ensureFlatRules() const; 250 void ensureFlatRules() const;
252 bool styleSheetTextWithChangedStyle(CSSStyleDeclaration*, const String& newS tyleText, String* result); 251 bool styleSheetTextWithChangedStyle(CSSStyleDeclaration*, const String& newS tyleText, String* result);
253 bool originalStyleSheetText(String* result) const; 252 bool originalStyleSheetText(String* result) const;
254 bool resourceStyleSheetText(String* result) const; 253 bool resourceStyleSheetText(String* result) const;
255 bool inlineStyleSheetText(String* result) const; 254 bool inlineStyleSheetText(String* result) const;
256 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::Selector> > selectorsFromSou rce(const CSSRuleSourceData*, const String&); 255 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::Selector> > selectorsFromSou rce(const CSSRuleSourceData*, const String&);
257 PassRefPtr<TypeBuilder::CSS::SelectorList> buildObjectForSelectorList(CSSSty leRule*); 256 PassRefPtr<TypeBuilder::CSS::SelectorList> buildObjectForSelectorList(CSSSty leRule*);
258 String url() const; 257 String url() const;
259 bool hasSourceURL() const; 258 bool hasSourceURL() const;
260 bool startsAtZero() const; 259 bool startsAtZero() const;
261 260
262 void updateText(const String& newText); 261 void updateText(const String& newText);
263 Element* ownerStyleElement() const; 262 Element* ownerStyleElement() const;
264 263
265 RawPtrWillBeMember<InspectorCSSAgent> m_cssAgent; 264 RawPtrWillBeMember<InspectorCSSAgent> m_cssAgent;
266 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent;
267 RawPtrWillBeMember<InspectorResourceAgent> m_resourceAgent; 265 RawPtrWillBeMember<InspectorResourceAgent> m_resourceAgent;
268 RefPtrWillBeMember<CSSStyleSheet> m_pageStyleSheet; 266 RefPtrWillBeMember<CSSStyleSheet> m_pageStyleSheet;
269 TypeBuilder::CSS::StyleSheetOrigin::Enum m_origin; 267 TypeBuilder::CSS::StyleSheetOrigin::Enum m_origin;
270 String m_documentURL; 268 String m_documentURL;
271 OwnPtr<ParsedStyleSheet> m_parsedStyleSheet; 269 OwnPtr<ParsedStyleSheet> m_parsedStyleSheet;
272 mutable CSSRuleVector m_flatRules; 270 mutable CSSRuleVector m_flatRules;
273 mutable String m_sourceURL; 271 mutable String m_sourceURL;
274 }; 272 };
275 273
276 class InspectorStyleSheetForInlineStyle final : public InspectorStyleSheetBase { 274 class InspectorStyleSheetForInlineStyle final : public InspectorStyleSheetBase {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 mutable String m_styleText; 308 mutable String m_styleText;
311 mutable bool m_isStyleTextValid; 309 mutable bool m_isStyleTextValid;
312 }; 310 };
313 311
314 312
315 } // namespace blink 313 } // namespace blink
316 314
317 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::InspectorStyleProperty); 315 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::InspectorStyleProperty);
318 316
319 #endif // !defined(InspectorStyleSheet_h) 317 #endif // !defined(InspectorStyleSheet_h)
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorResourceAgent.cpp ('k') | Source/core/inspector/InspectorStyleSheet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698