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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 public: | 163 public: |
164 class Listener { | 164 class Listener { |
165 public: | 165 public: |
166 Listener() { } | 166 Listener() { } |
167 virtual ~Listener() { } | 167 virtual ~Listener() { } |
168 virtual void styleSheetChanged(InspectorStyleSheet*) = 0; | 168 virtual void styleSheetChanged(InspectorStyleSheet*) = 0; |
169 virtual void willReparseStyleSheet() = 0; | 169 virtual void willReparseStyleSheet() = 0; |
170 virtual void didReparseStyleSheet() = 0; | 170 virtual void didReparseStyleSheet() = 0; |
171 }; | 171 }; |
172 | 172 |
173 static PassRefPtr<InspectorStyleSheet> create(InspectorPageAgent*, Inspector
ResourceAgent*, const String& id, PassRefPtr<CSSStyleSheet> pageStyleSheet, Type
Builder::CSS::StyleSheetOrigin::Enum, const String& documentURL, Listener*); | 173 static PassRefPtr<InspectorStyleSheet> create(InspectorPageAgent*, Inspector
ResourceAgent*, const String& id, PassRefPtrWillBeRawPtr<CSSStyleSheet> pageStyl
eSheet, TypeBuilder::CSS::StyleSheetOrigin::Enum, const String& documentURL, Lis
tener*); |
174 | 174 |
175 virtual ~InspectorStyleSheet(); | 175 virtual ~InspectorStyleSheet(); |
176 | 176 |
177 String id() const { return m_id; } | 177 String id() const { return m_id; } |
178 String finalURL() const; | 178 String finalURL() const; |
179 virtual Document* ownerDocument() const; | 179 virtual Document* ownerDocument() const; |
180 CSSStyleSheet* pageStyleSheet() const { return m_pageStyleSheet.get(); } | 180 CSSStyleSheet* pageStyleSheet() const { return m_pageStyleSheet.get(); } |
181 virtual void reparseStyleSheet(const String&); | 181 virtual void reparseStyleSheet(const String&); |
182 virtual bool setText(const String&, ExceptionState&); | 182 virtual bool setText(const String&, ExceptionState&); |
183 virtual bool getText(String* result) const; | 183 virtual bool getText(String* result) const; |
184 String ruleSelector(const InspectorCSSId&, ExceptionState&); | 184 String ruleSelector(const InspectorCSSId&, ExceptionState&); |
185 bool setRuleSelector(const InspectorCSSId&, const String& selector, Exceptio
nState&); | 185 bool setRuleSelector(const InspectorCSSId&, const String& selector, Exceptio
nState&); |
186 CSSStyleRule* addRule(const String& selector, ExceptionState&); | 186 CSSStyleRule* addRule(const String& selector, ExceptionState&); |
187 bool deleteRule(const InspectorCSSId&, ExceptionState&); | 187 bool deleteRule(const InspectorCSSId&, ExceptionState&); |
188 bool setPropertyText(const InspectorCSSId&, unsigned propertyIndex, const St
ring& text, bool overwrite, String* oldPropertyText, ExceptionState&); | 188 bool setPropertyText(const InspectorCSSId&, unsigned propertyIndex, const St
ring& text, bool overwrite, String* oldPropertyText, ExceptionState&); |
189 | 189 |
190 PassRefPtr<TypeBuilder::CSS::CSSStyleSheetHeader> buildObjectForStyleSheetIn
fo() const; | 190 PassRefPtr<TypeBuilder::CSS::CSSStyleSheetHeader> buildObjectForStyleSheetIn
fo() const; |
191 PassRefPtr<TypeBuilder::CSS::CSSRule> buildObjectForRule(CSSStyleRule*, Pass
RefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSMedia> >); | 191 PassRefPtr<TypeBuilder::CSS::CSSRule> buildObjectForRule(CSSStyleRule*, Pass
RefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSMedia> >); |
192 PassRefPtr<TypeBuilder::CSS::CSSStyle> buildObjectForStyle(CSSStyleDeclarati
on*); | 192 PassRefPtr<TypeBuilder::CSS::CSSStyle> buildObjectForStyle(CSSStyleDeclarati
on*); |
193 | 193 |
194 PassRefPtr<TypeBuilder::CSS::SourceRange> ruleHeaderSourceRange(const CSSRul
e*); | 194 PassRefPtr<TypeBuilder::CSS::SourceRange> ruleHeaderSourceRange(const CSSRul
e*); |
195 | 195 |
196 InspectorCSSId ruleId(CSSStyleRule*) const; | 196 InspectorCSSId ruleId(CSSStyleRule*) const; |
197 InspectorCSSId styleId(CSSStyleDeclaration* style) const { return ruleIdBySt
yle(style); } | 197 InspectorCSSId styleId(CSSStyleDeclaration* style) const { return ruleIdBySt
yle(style); } |
198 virtual CSSStyleRule* ruleForId(const InspectorCSSId&) const; | 198 virtual CSSStyleRule* ruleForId(const InspectorCSSId&) const; |
199 virtual CSSStyleDeclaration* styleForId(const InspectorCSSId&) const; | 199 virtual CSSStyleDeclaration* styleForId(const InspectorCSSId&) const; |
200 | 200 |
201 protected: | 201 protected: |
202 InspectorStyleSheet(InspectorPageAgent*, InspectorResourceAgent*, const Stri
ng& id, PassRefPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOr
igin::Enum, const String& documentURL, Listener*); | 202 InspectorStyleSheet(InspectorPageAgent*, InspectorResourceAgent*, const Stri
ng& id, PassRefPtrWillBeRawPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::
StyleSheetOrigin::Enum, const String& documentURL, Listener*); |
203 | 203 |
204 void fireStyleSheetChanged(); | 204 void fireStyleSheetChanged(); |
205 virtual PassRefPtr<CSSRuleSourceData> ruleSourceDataFor(CSSStyleDeclaration*
) const; | 205 virtual PassRefPtr<CSSRuleSourceData> ruleSourceDataFor(CSSStyleDeclaration*
) const; |
206 virtual unsigned ruleIndexByStyle(CSSStyleDeclaration*) const; | 206 virtual unsigned ruleIndexByStyle(CSSStyleDeclaration*) const; |
207 virtual unsigned ruleIndexByRule(const CSSRule*) const; | 207 virtual unsigned ruleIndexByRule(const CSSRule*) const; |
208 virtual bool ensureParsedDataReady(); | 208 virtual bool ensureParsedDataReady(); |
209 virtual PassRefPtr<InspectorStyle> inspectorStyleForId(const InspectorCSSId&
); | 209 virtual PassRefPtr<InspectorStyle> inspectorStyleForId(const InspectorCSSId&
); |
210 virtual String sourceMapURL() const; | 210 virtual String sourceMapURL() const; |
211 virtual String sourceURL() const; | 211 virtual String sourceURL() const; |
212 | 212 |
(...skipping 14 matching lines...) Expand all Loading... |
227 bool inlineStyleSheetText(String* result) const; | 227 bool inlineStyleSheetText(String* result) const; |
228 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::Selector> > selectorsFromSou
rce(const CSSRuleSourceData*, const String&) const; | 228 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::Selector> > selectorsFromSou
rce(const CSSRuleSourceData*, const String&) const; |
229 PassRefPtr<TypeBuilder::CSS::SelectorList> buildObjectForSelectorList(CSSSty
leRule*); | 229 PassRefPtr<TypeBuilder::CSS::SelectorList> buildObjectForSelectorList(CSSSty
leRule*); |
230 String url() const; | 230 String url() const; |
231 bool hasSourceURL() const; | 231 bool hasSourceURL() const; |
232 bool startsAtZero() const; | 232 bool startsAtZero() const; |
233 | 233 |
234 InspectorPageAgent* m_pageAgent; | 234 InspectorPageAgent* m_pageAgent; |
235 InspectorResourceAgent* m_resourceAgent; | 235 InspectorResourceAgent* m_resourceAgent; |
236 String m_id; | 236 String m_id; |
237 RefPtr<CSSStyleSheet> m_pageStyleSheet; | 237 RefPtrWillBePersistent<CSSStyleSheet> m_pageStyleSheet; |
238 TypeBuilder::CSS::StyleSheetOrigin::Enum m_origin; | 238 TypeBuilder::CSS::StyleSheetOrigin::Enum m_origin; |
239 String m_documentURL; | 239 String m_documentURL; |
240 OwnPtr<ParsedStyleSheet> m_parsedStyleSheet; | 240 OwnPtr<ParsedStyleSheet> m_parsedStyleSheet; |
241 mutable CSSRuleVector m_flatRules; | 241 mutable CSSRuleVector m_flatRules; |
242 Listener* m_listener; | 242 Listener* m_listener; |
243 mutable String m_sourceURL; | 243 mutable String m_sourceURL; |
244 }; | 244 }; |
245 | 245 |
246 class InspectorStyleSheetForInlineStyle FINAL : public InspectorStyleSheet { | 246 class InspectorStyleSheetForInlineStyle FINAL : public InspectorStyleSheet { |
247 public: | 247 public: |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 280 |
281 // Contains "style" attribute value. | 281 // Contains "style" attribute value. |
282 mutable String m_styleText; | 282 mutable String m_styleText; |
283 mutable bool m_isStyleTextValid; | 283 mutable bool m_isStyleTextValid; |
284 }; | 284 }; |
285 | 285 |
286 | 286 |
287 } // namespace WebCore | 287 } // namespace WebCore |
288 | 288 |
289 #endif // !defined(InspectorStyleSheet_h) | 289 #endif // !defined(InspectorStyleSheet_h) |
OLD | NEW |