| 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 virtual unsigned ruleIndexByStyle(CSSStyleDeclaration*) const; | 215 virtual unsigned ruleIndexByStyle(CSSStyleDeclaration*) const; |
| 216 virtual bool ensureParsedDataReady(); | 216 virtual bool ensureParsedDataReady(); |
| 217 virtual PassRefPtr<InspectorStyle> inspectorStyleForId(const InspectorCSSId&
); | 217 virtual PassRefPtr<InspectorStyle> inspectorStyleForId(const InspectorCSSId&
); |
| 218 virtual void rememberInspectorStyle(RefPtr<InspectorStyle> inspectorStyle); | 218 virtual void rememberInspectorStyle(RefPtr<InspectorStyle> inspectorStyle); |
| 219 virtual void forgetInspectorStyle(CSSStyleDeclaration* style); | 219 virtual void forgetInspectorStyle(CSSStyleDeclaration* style); |
| 220 | 220 |
| 221 // Also accessed by friend class InspectorStyle. | 221 // Also accessed by friend class InspectorStyle. |
| 222 virtual bool setStyleText(CSSStyleDeclaration*, const String&); | 222 virtual bool setStyleText(CSSStyleDeclaration*, const String&); |
| 223 | 223 |
| 224 private: | 224 private: |
| 225 typedef Vector<RefPtr<CSSStyleRule> > CSSStyleRuleVector; |
| 225 friend class InspectorStyle; | 226 friend class InspectorStyle; |
| 226 | 227 |
| 227 static void collectFlatRules(PassRefPtr<CSSRuleList>, Vector<CSSStyleRule*>*
result); | 228 static void collectFlatRules(PassRefPtr<CSSRuleList>, CSSStyleRuleVector* re
sult); |
| 228 bool ensureText() const; | 229 bool ensureText() const; |
| 229 bool ensureSourceData(); | 230 bool ensureSourceData(); |
| 230 void ensureFlatRules() const; | 231 void ensureFlatRules() const; |
| 231 bool styleSheetTextWithChangedStyle(CSSStyleDeclaration*, const String& newS
tyleText, String* result); | 232 bool styleSheetTextWithChangedStyle(CSSStyleDeclaration*, const String& newS
tyleText, String* result); |
| 232 void revalidateStyle(CSSStyleDeclaration*); | 233 void revalidateStyle(CSSStyleDeclaration*); |
| 233 bool originalStyleSheetText(String* result) const; | 234 bool originalStyleSheetText(String* result) const; |
| 234 bool resourceStyleSheetText(String* result) const; | 235 bool resourceStyleSheetText(String* result) const; |
| 235 bool inlineStyleSheetText(String* result) const; | 236 bool inlineStyleSheetText(String* result) const; |
| 236 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSRule> > buildArrayForRule
List(CSSRuleList*); | 237 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSRule> > buildArrayForRule
List(CSSRuleList*); |
| 237 PassRefPtr<TypeBuilder::CSS::SelectorList> buildObjectForSelectorList(CSSSty
leRule*); | 238 PassRefPtr<TypeBuilder::CSS::SelectorList> buildObjectForSelectorList(CSSSty
leRule*); |
| 238 | 239 |
| 239 InspectorPageAgent* m_pageAgent; | 240 InspectorPageAgent* m_pageAgent; |
| 240 String m_id; | 241 String m_id; |
| 241 RefPtr<CSSStyleSheet> m_pageStyleSheet; | 242 RefPtr<CSSStyleSheet> m_pageStyleSheet; |
| 242 TypeBuilder::CSS::StyleSheetOrigin::Enum m_origin; | 243 TypeBuilder::CSS::StyleSheetOrigin::Enum m_origin; |
| 243 String m_documentURL; | 244 String m_documentURL; |
| 244 bool m_isRevalidating; | 245 bool m_isRevalidating; |
| 245 ParsedStyleSheet* m_parsedStyleSheet; | 246 ParsedStyleSheet* m_parsedStyleSheet; |
| 246 InspectorStyleMap m_inspectorStyles; | 247 InspectorStyleMap m_inspectorStyles; |
| 247 mutable Vector<CSSStyleRule*> m_flatRules; | 248 mutable CSSStyleRuleVector m_flatRules; |
| 248 Listener* m_listener; | 249 Listener* m_listener; |
| 249 }; | 250 }; |
| 250 | 251 |
| 251 class InspectorStyleSheetForInlineStyle : public InspectorStyleSheet { | 252 class InspectorStyleSheetForInlineStyle : public InspectorStyleSheet { |
| 252 public: | 253 public: |
| 253 static PassRefPtr<InspectorStyleSheetForInlineStyle> create(InspectorPageAge
nt*, const String& id, PassRefPtr<Element>, TypeBuilder::CSS::StyleSheetOrigin::
Enum, Listener*); | 254 static PassRefPtr<InspectorStyleSheetForInlineStyle> create(InspectorPageAge
nt*, const String& id, PassRefPtr<Element>, TypeBuilder::CSS::StyleSheetOrigin::
Enum, Listener*); |
| 254 | 255 |
| 255 void didModifyElementAttribute(); | 256 void didModifyElementAttribute(); |
| 256 virtual bool getText(String* result) const; | 257 virtual bool getText(String* result) const; |
| 257 virtual CSSStyleDeclaration* styleForId(const InspectorCSSId& id) const { AS
SERT_UNUSED(id, !id.ordinal()); return inlineStyle(); } | 258 virtual CSSStyleDeclaration* styleForId(const InspectorCSSId& id) const { AS
SERT_UNUSED(id, !id.ordinal()); return inlineStyle(); } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 282 // Contains "style" attribute value. | 283 // Contains "style" attribute value. |
| 283 mutable String m_styleText; | 284 mutable String m_styleText; |
| 284 mutable bool m_isStyleTextValid; | 285 mutable bool m_isStyleTextValid; |
| 285 }; | 286 }; |
| 286 | 287 |
| 287 #endif | 288 #endif |
| 288 | 289 |
| 289 } // namespace WebCore | 290 } // namespace WebCore |
| 290 | 291 |
| 291 #endif // !defined(InspectorStyleSheet_h) | 292 #endif // !defined(InspectorStyleSheet_h) |
| OLD | NEW |