| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 125 |
| 126 bool hasRawText() const { return !rawText.isEmpty(); } | 126 bool hasRawText() const { return !rawText.isEmpty(); } |
| 127 | 127 |
| 128 CSSPropertySourceData sourceData; | 128 CSSPropertySourceData sourceData; |
| 129 bool hasSource; | 129 bool hasSource; |
| 130 String rawText; | 130 String rawText; |
| 131 }; | 131 }; |
| 132 | 132 |
| 133 class InspectorStyle FINAL : public RefCounted<InspectorStyle> { | 133 class InspectorStyle FINAL : public RefCounted<InspectorStyle> { |
| 134 public: | 134 public: |
| 135 static PassRefPtr<InspectorStyle> create(const InspectorCSSId&, PassRefPtrWi
llBeRawPtr<CSSStyleDeclaration>, InspectorStyleSheetBase* parentStyleSheet); | 135 static PassRefPtr<InspectorStyle> create(const InspectorCSSId&, PassRefPtr<C
SSStyleDeclaration>, InspectorStyleSheetBase* parentStyleSheet); |
| 136 | 136 |
| 137 CSSStyleDeclaration* cssStyle() const { return m_style.get(); } | 137 CSSStyleDeclaration* cssStyle() const { return m_style.get(); } |
| 138 PassRefPtr<TypeBuilder::CSS::CSSStyle> buildObjectForStyle() const; | 138 PassRefPtr<TypeBuilder::CSS::CSSStyle> buildObjectForStyle() const; |
| 139 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSComputedStyleProperty> >
buildArrayForComputedStyle() const; | 139 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSComputedStyleProperty> >
buildArrayForComputedStyle() const; |
| 140 bool setPropertyText(unsigned index, const String& text, bool overwrite, Str
ing* oldText, ExceptionState&); | 140 bool setPropertyText(unsigned index, const String& text, bool overwrite, Str
ing* oldText, ExceptionState&); |
| 141 bool styleText(String* result) const; | 141 bool styleText(String* result) const; |
| 142 | 142 |
| 143 private: | 143 private: |
| 144 InspectorStyle(const InspectorCSSId&, PassRefPtrWillBeRawPtr<CSSStyleDeclara
tion>, InspectorStyleSheetBase* parentStyleSheet); | 144 InspectorStyle(const InspectorCSSId&, PassRefPtr<CSSStyleDeclaration>, Inspe
ctorStyleSheetBase* parentStyleSheet); |
| 145 | 145 |
| 146 bool verifyPropertyText(const String& propertyText, bool canOmitSemicolon); | 146 bool verifyPropertyText(const String& propertyText, bool canOmitSemicolon); |
| 147 void populateAllProperties(Vector<InspectorStyleProperty>& result) const; | 147 void populateAllProperties(Vector<InspectorStyleProperty>& result) const; |
| 148 PassRefPtr<TypeBuilder::CSS::CSSStyle> styleWithProperties() const; | 148 PassRefPtr<TypeBuilder::CSS::CSSStyle> styleWithProperties() const; |
| 149 PassRefPtr<CSSRuleSourceData> extractSourceData() const; | 149 PassRefPtr<CSSRuleSourceData> extractSourceData() const; |
| 150 bool applyStyleText(const String&); | 150 bool applyStyleText(const String&); |
| 151 String shorthandValue(const String& shorthandProperty) const; | 151 String shorthandValue(const String& shorthandProperty) const; |
| 152 NewLineAndWhitespace& newLineAndWhitespaceDelimiters() const; | 152 NewLineAndWhitespace& newLineAndWhitespaceDelimiters() const; |
| 153 inline Document* ownerDocument() const; | 153 inline Document* ownerDocument() const; |
| 154 | 154 |
| 155 InspectorCSSId m_styleId; | 155 InspectorCSSId m_styleId; |
| 156 RefPtrWillBePersistent<CSSStyleDeclaration> m_style; | 156 RefPtr<CSSStyleDeclaration> m_style; |
| 157 InspectorStyleSheetBase* m_parentStyleSheet; | 157 InspectorStyleSheetBase* m_parentStyleSheet; |
| 158 mutable std::pair<String, String> m_format; | 158 mutable std::pair<String, String> m_format; |
| 159 mutable bool m_formatAcquired; | 159 mutable bool m_formatAcquired; |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 class InspectorStyleSheetBase : public RefCounted<InspectorStyleSheetBase> { | 162 class InspectorStyleSheetBase : public RefCounted<InspectorStyleSheetBase> { |
| 163 public: | 163 public: |
| 164 class Listener { | 164 class Listener { |
| 165 public: | 165 public: |
| 166 Listener() { } | 166 Listener() { } |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 | 300 |
| 301 // Contains "style" attribute value. | 301 // Contains "style" attribute value. |
| 302 mutable String m_styleText; | 302 mutable String m_styleText; |
| 303 mutable bool m_isStyleTextValid; | 303 mutable bool m_isStyleTextValid; |
| 304 }; | 304 }; |
| 305 | 305 |
| 306 | 306 |
| 307 } // namespace WebCore | 307 } // namespace WebCore |
| 308 | 308 |
| 309 #endif // !defined(InspectorStyleSheet_h) | 309 #endif // !defined(InspectorStyleSheet_h) |
| OLD | NEW |