OLD | NEW |
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 Loading... |
42 namespace WebCore { | 42 namespace WebCore { |
43 | 43 |
44 class CSSRuleList; | 44 class CSSRuleList; |
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 InspectorPageAgent; | 51 class InspectorPageAgent; |
52 class InspectorResourceAgent; | |
53 class InspectorStyleSheetBase; | 52 class InspectorStyleSheetBase; |
54 | 53 |
55 typedef WillBePersistentHeapVector<RefPtrWillBeMember<CSSRule> > CSSRuleVector; | 54 typedef WillBePersistentHeapVector<RefPtrWillBeMember<CSSRule> > CSSRuleVector; |
56 typedef String ErrorString; | 55 typedef String ErrorString; |
57 | 56 |
58 class InspectorCSSId { | 57 class InspectorCSSId { |
59 public: | 58 public: |
60 InspectorCSSId() | 59 InspectorCSSId() |
61 : m_ordinal(0) | 60 : m_ordinal(0) |
62 { | 61 { |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 184 |
186 private: | 185 private: |
187 friend class InspectorStyle; | 186 friend class InspectorStyle; |
188 | 187 |
189 String m_id; | 188 String m_id; |
190 Listener* m_listener; | 189 Listener* m_listener; |
191 }; | 190 }; |
192 | 191 |
193 class InspectorStyleSheet : public InspectorStyleSheetBase { | 192 class InspectorStyleSheet : public InspectorStyleSheetBase { |
194 public: | 193 public: |
195 static PassRefPtr<InspectorStyleSheet> create(InspectorPageAgent*, Inspector
ResourceAgent*, const String& id, PassRefPtrWillBeRawPtr<CSSStyleSheet> pageStyl
eSheet, TypeBuilder::CSS::StyleSheetOrigin::Enum, const String& documentURL, Lis
tener*); | 194 static PassRefPtr<InspectorStyleSheet> create(InspectorPageAgent*, const Str
ing& id, PassRefPtrWillBeRawPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS:
:StyleSheetOrigin::Enum, const String& documentURL, Listener*); |
196 | 195 |
197 virtual ~InspectorStyleSheet(); | 196 virtual ~InspectorStyleSheet(); |
198 | 197 |
199 String finalURL() const; | 198 String finalURL() const; |
200 virtual Document* ownerDocument() const OVERRIDE; | 199 virtual Document* ownerDocument() const OVERRIDE; |
201 virtual bool setText(const String&, ExceptionState&) OVERRIDE; | 200 virtual bool setText(const String&, ExceptionState&) OVERRIDE; |
202 virtual bool getText(String* result) const OVERRIDE; | 201 virtual bool getText(String* result) const OVERRIDE; |
203 String ruleSelector(const InspectorCSSId&, ExceptionState&); | 202 String ruleSelector(const InspectorCSSId&, ExceptionState&); |
204 bool setRuleSelector(const InspectorCSSId&, const String& selector, Exceptio
nState&); | 203 bool setRuleSelector(const InspectorCSSId&, const String& selector, Exceptio
nState&); |
205 CSSStyleRule* addRule(const String& selector, ExceptionState&); | 204 CSSStyleRule* addRule(const String& selector, ExceptionState&); |
(...skipping 17 matching lines...) Expand all Loading... |
223 | 222 |
224 protected: | 223 protected: |
225 virtual PassRefPtr<InspectorStyle> inspectorStyleForId(const InspectorCSSId&
) OVERRIDE; | 224 virtual PassRefPtr<InspectorStyle> inspectorStyleForId(const InspectorCSSId&
) OVERRIDE; |
226 virtual unsigned ruleCount() OVERRIDE; | 225 virtual unsigned ruleCount() OVERRIDE; |
227 | 226 |
228 // Also accessed by friend class InspectorStyle. | 227 // Also accessed by friend class InspectorStyle. |
229 virtual PassRefPtrWillBeRawPtr<CSSRuleSourceData> ruleSourceDataAt(unsigned)
const OVERRIDE; | 228 virtual PassRefPtrWillBeRawPtr<CSSRuleSourceData> ruleSourceDataAt(unsigned)
const OVERRIDE; |
230 virtual bool ensureParsedDataReady() OVERRIDE; | 229 virtual bool ensureParsedDataReady() OVERRIDE; |
231 | 230 |
232 private: | 231 private: |
233 InspectorStyleSheet(InspectorPageAgent*, InspectorResourceAgent*, const Stri
ng& id, PassRefPtrWillBeRawPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::
StyleSheetOrigin::Enum, const String& documentURL, Listener*); | 232 InspectorStyleSheet(InspectorPageAgent*, const String& id, PassRefPtrWillBeR
awPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOrigin::Enum, c
onst String& documentURL, Listener*); |
234 | 233 |
235 unsigned ruleIndexByStyle(CSSStyleDeclaration*) const; | 234 unsigned ruleIndexByStyle(CSSStyleDeclaration*) const; |
236 String sourceMapURL() const; | 235 String sourceMapURL() const; |
237 String sourceURL() const; | 236 String sourceURL() const; |
238 bool ensureText() const; | 237 bool ensureText() const; |
239 void ensureFlatRules() const; | 238 void ensureFlatRules() const; |
240 bool styleSheetTextWithChangedStyle(CSSStyleDeclaration*, const String& newS
tyleText, String* result); | 239 bool styleSheetTextWithChangedStyle(CSSStyleDeclaration*, const String& newS
tyleText, String* result); |
241 bool originalStyleSheetText(String* result) const; | 240 bool originalStyleSheetText(String* result) const; |
242 bool resourceStyleSheetText(String* result) const; | 241 bool resourceStyleSheetText(String* result) const; |
243 bool inlineStyleSheetText(String* result) const; | 242 bool inlineStyleSheetText(String* result) const; |
244 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::Selector> > selectorsFromSou
rce(const CSSRuleSourceData*, const String&); | 243 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::Selector> > selectorsFromSou
rce(const CSSRuleSourceData*, const String&); |
245 PassRefPtr<TypeBuilder::CSS::SelectorList> buildObjectForSelectorList(CSSSty
leRule*); | 244 PassRefPtr<TypeBuilder::CSS::SelectorList> buildObjectForSelectorList(CSSSty
leRule*); |
246 String url() const; | 245 String url() const; |
247 bool hasSourceURL() const; | 246 bool hasSourceURL() const; |
248 bool startsAtZero() const; | 247 bool startsAtZero() const; |
249 | 248 |
250 InspectorPageAgent* m_pageAgent; | 249 InspectorPageAgent* m_pageAgent; |
251 InspectorResourceAgent* m_resourceAgent; | |
252 RefPtrWillBePersistent<CSSStyleSheet> m_pageStyleSheet; | 250 RefPtrWillBePersistent<CSSStyleSheet> m_pageStyleSheet; |
253 TypeBuilder::CSS::StyleSheetOrigin::Enum m_origin; | 251 TypeBuilder::CSS::StyleSheetOrigin::Enum m_origin; |
254 String m_documentURL; | 252 String m_documentURL; |
255 OwnPtr<ParsedStyleSheet> m_parsedStyleSheet; | 253 OwnPtr<ParsedStyleSheet> m_parsedStyleSheet; |
256 mutable CSSRuleVector m_flatRules; | 254 mutable CSSRuleVector m_flatRules; |
257 mutable String m_sourceURL; | 255 mutable String m_sourceURL; |
258 }; | 256 }; |
259 | 257 |
260 class InspectorStyleSheetForInlineStyle FINAL : public InspectorStyleSheetBase { | 258 class InspectorStyleSheetForInlineStyle FINAL : public InspectorStyleSheetBase { |
261 public: | 259 public: |
(...skipping 30 matching lines...) Expand all Loading... |
292 mutable String m_styleText; | 290 mutable String m_styleText; |
293 mutable bool m_isStyleTextValid; | 291 mutable bool m_isStyleTextValid; |
294 }; | 292 }; |
295 | 293 |
296 | 294 |
297 } // namespace WebCore | 295 } // namespace WebCore |
298 | 296 |
299 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(WebCore::InspectorStyleProperty); | 297 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(WebCore::InspectorStyleProperty); |
300 | 298 |
301 #endif // !defined(InspectorStyleSheet_h) | 299 #endif // !defined(InspectorStyleSheet_h) |
OLD | NEW |