| 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 static String styleSheetURL(CSSStyleSheet* pageStyleSheet); | 174 static String styleSheetURL(CSSStyleSheet* pageStyleSheet); |
| 175 static void collectFlatRules(PassRefPtrWillBeRawPtr<CSSRuleList>, CSSRuleVec
tor* result); | 175 static void collectFlatRules(PassRefPtrWillBeRawPtr<CSSRuleList>, CSSRuleVec
tor* result); |
| 176 | 176 |
| 177 virtual ~InspectorStyleSheet(); | 177 virtual ~InspectorStyleSheet(); |
| 178 | 178 |
| 179 String id() const { return m_id; } | 179 String id() const { return m_id; } |
| 180 String finalURL() const; | 180 String finalURL() const; |
| 181 virtual Document* ownerDocument() const; | 181 virtual Document* ownerDocument() const; |
| 182 bool canBind() const { return m_origin != TypeBuilder::CSS::StyleSheetOrigin
::User_agent && m_origin != TypeBuilder::CSS::StyleSheetOrigin::User; } | 182 bool canBind() const { return m_origin != TypeBuilder::CSS::StyleSheetOrigin
::User_agent && m_origin != TypeBuilder::CSS::StyleSheetOrigin::User; } |
| 183 CSSStyleSheet* pageStyleSheet() const { return m_pageStyleSheet.get(); } | 183 CSSStyleSheet* pageStyleSheet() const { return m_pageStyleSheet.get(); } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 197 virtual TypeBuilder::CSS::StyleSheetOrigin::Enum origin() const { return m_o
rigin; } | 197 virtual TypeBuilder::CSS::StyleSheetOrigin::Enum origin() const { return m_o
rigin; } |
| 198 virtual bool getText(String* result) const; | 198 virtual bool getText(String* result) const; |
| 199 virtual CSSStyleDeclaration* styleForId(const InspectorCSSId&) const; | 199 virtual CSSStyleDeclaration* styleForId(const InspectorCSSId&) const; |
| 200 void fireStyleSheetChanged(); | 200 void fireStyleSheetChanged(); |
| 201 PassRefPtr<TypeBuilder::CSS::SourceRange> ruleHeaderSourceRange(const CSSRul
e*); | 201 PassRefPtr<TypeBuilder::CSS::SourceRange> ruleHeaderSourceRange(const CSSRul
e*); |
| 202 | 202 |
| 203 InspectorCSSId ruleId(CSSStyleRule*) const; | 203 InspectorCSSId ruleId(CSSStyleRule*) const; |
| 204 InspectorCSSId styleId(CSSStyleDeclaration* style) const { return ruleOrStyl
eId(style); } | 204 InspectorCSSId styleId(CSSStyleDeclaration* style) const { return ruleOrStyl
eId(style); } |
| 205 | 205 |
| 206 protected: | 206 protected: |
| 207 InspectorStyleSheet(InspectorPageAgent*, InspectorResourceAgent*, const Stri
ng& id, PassRefPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOr
igin::Enum, const String& documentURL, Listener*); | 207 InspectorStyleSheet(InspectorPageAgent*, InspectorResourceAgent*, const Stri
ng& id, PassRefPtrWillBeRawPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::
StyleSheetOrigin::Enum, const String& documentURL, Listener*); |
| 208 | 208 |
| 209 InspectorCSSId ruleOrStyleId(CSSStyleDeclaration* style) const; | 209 InspectorCSSId ruleOrStyleId(CSSStyleDeclaration* style) const; |
| 210 virtual PassRefPtr<CSSRuleSourceData> ruleSourceDataFor(CSSStyleDeclaration*
) const; | 210 virtual PassRefPtr<CSSRuleSourceData> ruleSourceDataFor(CSSStyleDeclaration*
) const; |
| 211 virtual unsigned ruleIndexByStyle(CSSStyleDeclaration*) const; | 211 virtual unsigned ruleIndexByStyle(CSSStyleDeclaration*) const; |
| 212 virtual unsigned ruleIndexByRule(const CSSRule*) const; | 212 virtual unsigned ruleIndexByRule(const CSSRule*) const; |
| 213 virtual bool ensureParsedDataReady(); | 213 virtual bool ensureParsedDataReady(); |
| 214 virtual PassRefPtr<InspectorStyle> inspectorStyleForId(const InspectorCSSId&
); | 214 virtual PassRefPtr<InspectorStyle> inspectorStyleForId(const InspectorCSSId&
); |
| 215 virtual String sourceMapURL() const; | 215 virtual String sourceMapURL() const; |
| 216 virtual String sourceURL() const; | 216 virtual String sourceURL() const; |
| 217 | 217 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 231 bool inlineStyleSheetText(String* result) const; | 231 bool inlineStyleSheetText(String* result) const; |
| 232 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::Selector> > selectorsFromSou
rce(const CSSRuleSourceData*, const String&) const; | 232 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::Selector> > selectorsFromSou
rce(const CSSRuleSourceData*, const String&) const; |
| 233 PassRefPtr<TypeBuilder::CSS::SelectorList> buildObjectForSelectorList(CSSSty
leRule*); | 233 PassRefPtr<TypeBuilder::CSS::SelectorList> buildObjectForSelectorList(CSSSty
leRule*); |
| 234 String url() const; | 234 String url() const; |
| 235 bool hasSourceURL() const; | 235 bool hasSourceURL() const; |
| 236 bool startsAtZero() const; | 236 bool startsAtZero() const; |
| 237 | 237 |
| 238 InspectorPageAgent* m_pageAgent; | 238 InspectorPageAgent* m_pageAgent; |
| 239 InspectorResourceAgent* m_resourceAgent; | 239 InspectorResourceAgent* m_resourceAgent; |
| 240 String m_id; | 240 String m_id; |
| 241 RefPtr<CSSStyleSheet> m_pageStyleSheet; | 241 RefPtrWillBePersistent<CSSStyleSheet> m_pageStyleSheet; |
| 242 TypeBuilder::CSS::StyleSheetOrigin::Enum m_origin; | 242 TypeBuilder::CSS::StyleSheetOrigin::Enum m_origin; |
| 243 String m_documentURL; | 243 String m_documentURL; |
| 244 ParsedStyleSheet* m_parsedStyleSheet; | 244 ParsedStyleSheet* m_parsedStyleSheet; |
| 245 mutable CSSRuleVector m_flatRules; | 245 mutable CSSRuleVector m_flatRules; |
| 246 Listener* m_listener; | 246 Listener* m_listener; |
| 247 mutable String m_sourceURL; | 247 mutable String m_sourceURL; |
| 248 }; | 248 }; |
| 249 | 249 |
| 250 class InspectorStyleSheetForInlineStyle FINAL : public InspectorStyleSheet { | 250 class InspectorStyleSheetForInlineStyle FINAL : public InspectorStyleSheet { |
| 251 public: | 251 public: |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 | 284 |
| 285 // Contains "style" attribute value. | 285 // Contains "style" attribute value. |
| 286 mutable String m_styleText; | 286 mutable String m_styleText; |
| 287 mutable bool m_isStyleTextValid; | 287 mutable bool m_isStyleTextValid; |
| 288 }; | 288 }; |
| 289 | 289 |
| 290 | 290 |
| 291 } // namespace WebCore | 291 } // namespace WebCore |
| 292 | 292 |
| 293 #endif // !defined(InspectorStyleSheet_h) | 293 #endif // !defined(InspectorStyleSheet_h) |
| OLD | NEW |