OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
19 */ | 19 */ |
20 | 20 |
21 #ifndef SKY_ENGINE_CORE_CSS_CSSSTYLEDECLARATION_H_ | 21 #ifndef SKY_ENGINE_CORE_CSS_CSSSTYLEDECLARATION_H_ |
22 #define SKY_ENGINE_CORE_CSS_CSSSTYLEDECLARATION_H_ | 22 #define SKY_ENGINE_CORE_CSS_CSSSTYLEDECLARATION_H_ |
23 | 23 |
24 #include "gen/sky/core/CSSPropertyNames.h" | 24 #include "gen/sky/core/CSSPropertyNames.h" |
25 #include "sky/engine/bindings/core/v8/ScriptWrappable.h" | 25 #include "sky/engine/tonic/dart_wrappable.h" |
26 #include "sky/engine/wtf/Forward.h" | 26 #include "sky/engine/wtf/Forward.h" |
27 #include "sky/engine/wtf/Noncopyable.h" | 27 #include "sky/engine/wtf/Noncopyable.h" |
28 | 28 |
29 namespace blink { | 29 namespace blink { |
30 | 30 |
31 class CSSProperty; | 31 class CSSProperty; |
32 class CSSStyleSheet; | 32 class CSSStyleSheet; |
33 class CSSValue; | 33 class CSSValue; |
34 class ExceptionState; | 34 class ExceptionState; |
35 class MutableStylePropertySet; | 35 class MutableStylePropertySet; |
36 | 36 |
37 class CSSStyleDeclaration : public ScriptWrappable { | 37 class CSSStyleDeclaration : public DartWrappable { |
38 DEFINE_WRAPPERTYPEINFO(); | 38 DEFINE_WRAPPERTYPEINFO(); |
39 WTF_MAKE_NONCOPYABLE(CSSStyleDeclaration); WTF_MAKE_FAST_ALLOCATED; | 39 WTF_MAKE_NONCOPYABLE(CSSStyleDeclaration); WTF_MAKE_FAST_ALLOCATED; |
40 public: | 40 public: |
41 virtual ~CSSStyleDeclaration() { } | 41 virtual ~CSSStyleDeclaration() { } |
42 | 42 |
43 #if !ENABLE(OILPAN) | 43 #if !ENABLE(OILPAN) |
44 virtual void ref() = 0; | 44 virtual void ref() = 0; |
45 virtual void deref() = 0; | 45 virtual void deref() = 0; |
46 #endif | 46 #endif |
47 | 47 |
48 virtual String cssText() const = 0; | 48 virtual String cssText() const = 0; |
49 virtual void setCSSText(const String&, ExceptionState&) = 0; | 49 virtual void setCSSText(const String&, ExceptionState&) = 0; |
50 virtual unsigned length() const = 0; | 50 virtual unsigned length() const = 0; |
51 virtual String item(unsigned index) const = 0; | 51 virtual String item(unsigned index) const = 0; |
52 virtual PassRefPtr<CSSValue> getPropertyCSSValue(const String& propertyName)
= 0; | 52 virtual PassRefPtr<CSSValue> getPropertyCSSValue(const String& propertyName)
= 0; |
53 virtual String getPropertyValue(const String& propertyName) = 0; | 53 virtual String getPropertyValue(const String& propertyName) = 0; |
54 virtual String getPropertyShorthand(const String& propertyName) = 0; | 54 virtual String getPropertyShorthand(const String& propertyName) = 0; |
55 virtual bool isPropertyImplicit(const String& propertyName) = 0; | 55 virtual bool isPropertyImplicit(const String& propertyName) = 0; |
56 virtual void setProperty(const String& propertyName, const String& value, co
nst String& priority, ExceptionState&) = 0; | 56 virtual void setProperty(const String& propertyName, const String& value, Ex
ceptionState&) = 0; |
57 virtual String removeProperty(const String& propertyName, ExceptionState&) =
0; | 57 virtual String removeProperty(const String& propertyName, ExceptionState&) =
0; |
58 | 58 |
59 // CSSPropertyID versions of the CSSOM functions to support bindings and edi
ting. | 59 // CSSPropertyID versions of the CSSOM functions to support bindings and edi
ting. |
60 // Use the non-virtual methods in the concrete subclasses when possible. | 60 // Use the non-virtual methods in the concrete subclasses when possible. |
61 // The CSSValue returned by this function should not be exposed to the web a
s it may be used by multiple documents at the same time. | 61 // The CSSValue returned by this function should not be exposed to the web a
s it may be used by multiple documents at the same time. |
62 virtual PassRefPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) = 0; | 62 virtual PassRefPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) = 0; |
63 virtual String getPropertyValueInternal(CSSPropertyID) = 0; | 63 virtual String getPropertyValueInternal(CSSPropertyID) = 0; |
64 virtual void setPropertyInternal(CSSPropertyID, const String& value, Excepti
onState&) = 0; | 64 virtual void setPropertyInternal(CSSPropertyID, const String& value, Excepti
onState&) = 0; |
65 | 65 |
66 virtual PassRefPtr<MutableStylePropertySet> copyProperties() const = 0; | 66 virtual PassRefPtr<MutableStylePropertySet> copyProperties() const = 0; |
67 | 67 |
68 virtual bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const = 0; | 68 virtual bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const = 0; |
69 virtual CSSStyleSheet* parentStyleSheet() const { return 0; } | 69 virtual CSSStyleSheet* parentStyleSheet() const { return 0; } |
70 | 70 |
71 protected: | 71 protected: |
72 CSSStyleDeclaration() | 72 CSSStyleDeclaration() |
73 { | 73 { |
74 } | 74 } |
75 }; | 75 }; |
76 | 76 |
77 } // namespace blink | 77 } // namespace blink |
78 | 78 |
79 #endif // SKY_ENGINE_CORE_CSS_CSSSTYLEDECLARATION_H_ | 79 #endif // SKY_ENGINE_CORE_CSS_CSSSTYLEDECLARATION_H_ |
OLD | NEW |