| 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 bool setPropertyText(const InspectorCSSId&, unsigned propertyIndex, const St
ring& text, bool overwrite, String* oldPropertyText, ExceptionState&); | 197 bool setPropertyText(const InspectorCSSId&, unsigned propertyIndex, const St
ring& text, bool overwrite, String* oldPropertyText, ExceptionState&); |
| 198 | 198 |
| 199 virtual TypeBuilder::CSS::StyleSheetOrigin::Enum origin() const { return m_o
rigin; } | 199 virtual TypeBuilder::CSS::StyleSheetOrigin::Enum origin() const { return m_o
rigin; } |
| 200 virtual bool getText(String* result) const; | 200 virtual bool getText(String* result) const; |
| 201 virtual CSSStyleDeclaration* styleForId(const InspectorCSSId&) const; | 201 virtual CSSStyleDeclaration* styleForId(const InspectorCSSId&) const; |
| 202 void fireStyleSheetChanged(); | 202 void fireStyleSheetChanged(); |
| 203 PassRefPtr<TypeBuilder::CSS::SourceRange> ruleHeaderSourceRange(const CSSRul
e*); | 203 PassRefPtr<TypeBuilder::CSS::SourceRange> ruleHeaderSourceRange(const CSSRul
e*); |
| 204 | 204 |
| 205 InspectorCSSId ruleId(CSSStyleRule*) const; | 205 InspectorCSSId ruleId(CSSStyleRule*) const; |
| 206 InspectorCSSId styleId(CSSStyleDeclaration* style) const { return ruleOrStyl
eId(style); } | 206 InspectorCSSId styleId(CSSStyleDeclaration* style) const { return ruleOrStyl
eId(style); } |
| 207 virtual PassOwnPtr<Vector<unsigned> > lineEndings() const; |
| 207 | 208 |
| 208 protected: | 209 protected: |
| 209 InspectorStyleSheet(InspectorPageAgent*, InspectorResourceAgent*, const Stri
ng& id, PassRefPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOr
igin::Enum, const String& documentURL, Listener*); | 210 InspectorStyleSheet(InspectorPageAgent*, InspectorResourceAgent*, const Stri
ng& id, PassRefPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOr
igin::Enum, const String& documentURL, Listener*); |
| 210 | 211 |
| 211 InspectorCSSId ruleOrStyleId(CSSStyleDeclaration* style) const; | 212 InspectorCSSId ruleOrStyleId(CSSStyleDeclaration* style) const; |
| 212 virtual PassRefPtr<CSSRuleSourceData> ruleSourceDataFor(CSSStyleDeclaration*
) const; | 213 virtual PassRefPtr<CSSRuleSourceData> ruleSourceDataFor(CSSStyleDeclaration*
) const; |
| 213 virtual unsigned ruleIndexByStyle(CSSStyleDeclaration*) const; | 214 virtual unsigned ruleIndexByStyle(CSSStyleDeclaration*) const; |
| 214 virtual unsigned ruleIndexByRule(const CSSRule*) const; | 215 virtual unsigned ruleIndexByRule(const CSSRule*) const; |
| 215 virtual bool ensureParsedDataReady(); | 216 virtual bool ensureParsedDataReady(); |
| 216 virtual PassRefPtr<InspectorStyle> inspectorStyleForId(const InspectorCSSId&
); | 217 virtual PassRefPtr<InspectorStyle> inspectorStyleForId(const InspectorCSSId&
); |
| 217 virtual String sourceMapURL() const; | 218 virtual String sourceMapURL() const; |
| 218 virtual String sourceURL() const; | 219 virtual String sourceURL() const; |
| 219 | 220 |
| 220 // Also accessed by friend class InspectorStyle. | 221 // Also accessed by friend class InspectorStyle. |
| 221 virtual bool setStyleText(CSSStyleDeclaration*, const String&); | 222 virtual bool setStyleText(CSSStyleDeclaration*, const String&); |
| 222 virtual PassOwnPtr<Vector<unsigned> > lineEndings() const; | |
| 223 | 223 |
| 224 private: | 224 private: |
| 225 friend class InspectorStyle; | 225 friend class InspectorStyle; |
| 226 | 226 |
| 227 bool checkPageStyleSheet(ExceptionState&) const; | 227 bool checkPageStyleSheet(ExceptionState&) const; |
| 228 bool ensureText() const; | 228 bool ensureText() const; |
| 229 bool ensureSourceData(); | 229 bool ensureSourceData(); |
| 230 void ensureFlatRules() const; | 230 void ensureFlatRules() const; |
| 231 bool styleSheetTextWithChangedStyle(CSSStyleDeclaration*, const String& newS
tyleText, String* result); | 231 bool styleSheetTextWithChangedStyle(CSSStyleDeclaration*, const String& newS
tyleText, String* result); |
| 232 void revalidateStyle(CSSStyleDeclaration*); | 232 void revalidateStyle(CSSStyleDeclaration*); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 256 public: | 256 public: |
| 257 static PassRefPtr<InspectorStyleSheetForInlineStyle> create(InspectorPageAge
nt*, InspectorResourceAgent*, const String& id, PassRefPtr<Element>, TypeBuilder
::CSS::StyleSheetOrigin::Enum, Listener*); | 257 static PassRefPtr<InspectorStyleSheetForInlineStyle> create(InspectorPageAge
nt*, InspectorResourceAgent*, const String& id, PassRefPtr<Element>, TypeBuilder
::CSS::StyleSheetOrigin::Enum, Listener*); |
| 258 | 258 |
| 259 void didModifyElementAttribute(); | 259 void didModifyElementAttribute(); |
| 260 virtual void reparseStyleSheet(const String&) OVERRIDE; | 260 virtual void reparseStyleSheet(const String&) OVERRIDE; |
| 261 virtual bool setText(const String&, ExceptionState&) OVERRIDE; | 261 virtual bool setText(const String&, ExceptionState&) OVERRIDE; |
| 262 virtual bool getText(String* result) const OVERRIDE; | 262 virtual bool getText(String* result) const OVERRIDE; |
| 263 virtual CSSStyleDeclaration* styleForId(const InspectorCSSId& id) const OVER
RIDE { ASSERT_UNUSED(id, !id.ordinal()); return inlineStyle(); } | 263 virtual CSSStyleDeclaration* styleForId(const InspectorCSSId& id) const OVER
RIDE { ASSERT_UNUSED(id, !id.ordinal()); return inlineStyle(); } |
| 264 virtual TypeBuilder::CSS::StyleSheetOrigin::Enum origin() const OVERRIDE { r
eturn TypeBuilder::CSS::StyleSheetOrigin::Regular; } | 264 virtual TypeBuilder::CSS::StyleSheetOrigin::Enum origin() const OVERRIDE { r
eturn TypeBuilder::CSS::StyleSheetOrigin::Regular; } |
| 265 | 265 |
| 266 virtual PassOwnPtr<Vector<unsigned> > lineEndings() const OVERRIDE; |
| 266 protected: | 267 protected: |
| 267 InspectorStyleSheetForInlineStyle(InspectorPageAgent*, InspectorResourceAgen
t*, const String& id, PassRefPtr<Element>, TypeBuilder::CSS::StyleSheetOrigin::E
num, Listener*); | 268 InspectorStyleSheetForInlineStyle(InspectorPageAgent*, InspectorResourceAgen
t*, const String& id, PassRefPtr<Element>, TypeBuilder::CSS::StyleSheetOrigin::E
num, Listener*); |
| 268 | 269 |
| 269 virtual Document* ownerDocument() const OVERRIDE; | 270 virtual Document* ownerDocument() const OVERRIDE; |
| 270 virtual PassRefPtr<CSSRuleSourceData> ruleSourceDataFor(CSSStyleDeclaration*
style) const OVERRIDE { ASSERT_UNUSED(style, style == inlineStyle()); return m_
ruleSourceData; } | 271 virtual PassRefPtr<CSSRuleSourceData> ruleSourceDataFor(CSSStyleDeclaration*
style) const OVERRIDE { ASSERT_UNUSED(style, style == inlineStyle()); return m_
ruleSourceData; } |
| 271 virtual unsigned ruleIndexByStyle(CSSStyleDeclaration*) const OVERRIDE { ret
urn 0; } | 272 virtual unsigned ruleIndexByStyle(CSSStyleDeclaration*) const OVERRIDE { ret
urn 0; } |
| 272 virtual bool ensureParsedDataReady() OVERRIDE; | 273 virtual bool ensureParsedDataReady() OVERRIDE; |
| 273 virtual PassRefPtr<InspectorStyle> inspectorStyleForId(const InspectorCSSId&
) OVERRIDE; | 274 virtual PassRefPtr<InspectorStyle> inspectorStyleForId(const InspectorCSSId&
) OVERRIDE; |
| 274 virtual String sourceMapURL() const OVERRIDE { return String(); } | 275 virtual String sourceMapURL() const OVERRIDE { return String(); } |
| 275 virtual String sourceURL() const OVERRIDE { return String(); } | 276 virtual String sourceURL() const OVERRIDE { return String(); } |
| 276 | 277 |
| 277 // Also accessed by friend class InspectorStyle. | 278 // Also accessed by friend class InspectorStyle. |
| 278 virtual bool setStyleText(CSSStyleDeclaration*, const String&) OVERRIDE; | 279 virtual bool setStyleText(CSSStyleDeclaration*, const String&) OVERRIDE; |
| 279 virtual PassOwnPtr<Vector<unsigned> > lineEndings() const OVERRIDE; | |
| 280 | 280 |
| 281 private: | 281 private: |
| 282 CSSStyleDeclaration* inlineStyle() const; | 282 CSSStyleDeclaration* inlineStyle() const; |
| 283 const String& elementStyleText() const; | 283 const String& elementStyleText() const; |
| 284 PassRefPtr<CSSRuleSourceData> getStyleAttributeData() const; | 284 PassRefPtr<CSSRuleSourceData> getStyleAttributeData() const; |
| 285 | 285 |
| 286 RefPtr<Element> m_element; | 286 RefPtr<Element> m_element; |
| 287 RefPtr<CSSRuleSourceData> m_ruleSourceData; | 287 RefPtr<CSSRuleSourceData> m_ruleSourceData; |
| 288 RefPtr<InspectorStyle> m_inspectorStyle; | 288 RefPtr<InspectorStyle> m_inspectorStyle; |
| 289 | 289 |
| 290 // Contains "style" attribute value. | 290 // Contains "style" attribute value. |
| 291 mutable String m_styleText; | 291 mutable String m_styleText; |
| 292 mutable bool m_isStyleTextValid; | 292 mutable bool m_isStyleTextValid; |
| 293 }; | 293 }; |
| 294 | 294 |
| 295 | 295 |
| 296 } // namespace WebCore | 296 } // namespace WebCore |
| 297 | 297 |
| 298 #endif // !defined(InspectorStyleSheet_h) | 298 #endif // !defined(InspectorStyleSheet_h) |
| OLD | NEW |