Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Side by Side Diff: Source/core/css/CSSStyleDeclaration.h

Issue 18311002: Partial implementation of CSSVariablesMap for CSS Variables CSSOM (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Removed unused IDL callback definition Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 CSSStyleDeclaration_h 21 #ifndef CSSStyleDeclaration_h
22 #define CSSStyleDeclaration_h 22 #define CSSStyleDeclaration_h
23 23
24 #include "CSSPropertyNames.h" 24 #include "CSSPropertyNames.h"
25 #include "bindings/v8/ScriptWrappable.h" 25 #include "bindings/v8/ScriptWrappable.h"
26 #include <wtf/Forward.h> 26 #include "wtf/Forward.h"
27 #include "wtf/Vector.h"
27 28
28 namespace WebCore { 29 namespace WebCore {
29 30
30 class CSSProperty; 31 class CSSProperty;
31 class CSSRule; 32 class CSSRule;
32 class CSSStyleSheet; 33 class CSSStyleSheet;
33 class CSSValue; 34 class CSSValue;
35 class CSSVariablesMap;
34 class MutableStylePropertySet; 36 class MutableStylePropertySet;
35 class StylePropertySet; 37 class VariablesIterator;
36 38
37 typedef int ExceptionCode; 39 typedef int ExceptionCode;
38 40
39 class CSSStyleDeclaration : public ScriptWrappable { 41 class CSSStyleDeclaration : public ScriptWrappable {
40 WTF_MAKE_NONCOPYABLE(CSSStyleDeclaration); WTF_MAKE_FAST_ALLOCATED; 42 WTF_MAKE_NONCOPYABLE(CSSStyleDeclaration); WTF_MAKE_FAST_ALLOCATED;
41 public: 43 public:
42 virtual ~CSSStyleDeclaration() { } 44 virtual ~CSSStyleDeclaration() { }
43 45
44 virtual void ref() = 0; 46 virtual void ref() = 0;
45 virtual void deref() = 0; 47 virtual void deref() = 0;
46 48
47 virtual CSSRule* parentRule() const = 0; 49 virtual CSSRule* parentRule() const = 0;
48 virtual String cssText() const = 0; 50 virtual String cssText() const = 0;
49 virtual void setCssText(const String&, ExceptionCode&) = 0; 51 virtual void setCssText(const String&, ExceptionCode&) = 0;
50 virtual unsigned length() const = 0; 52 virtual unsigned length() const = 0;
51 virtual String item(unsigned index) const = 0; 53 virtual String item(unsigned index) const = 0;
52 virtual PassRefPtr<CSSValue> getPropertyCSSValue(const String& propertyName) = 0; 54 virtual PassRefPtr<CSSValue> getPropertyCSSValue(const String& propertyName) = 0;
53 virtual String getPropertyValue(const String& propertyName) = 0; 55 virtual String getPropertyValue(const String& propertyName) = 0;
54 virtual String getPropertyPriority(const String& propertyName) = 0; 56 virtual String getPropertyPriority(const String& propertyName) = 0;
55 virtual String getPropertyShorthand(const String& propertyName) = 0; 57 virtual String getPropertyShorthand(const String& propertyName) = 0;
56 virtual bool isPropertyImplicit(const String& propertyName) = 0; 58 virtual bool isPropertyImplicit(const String& propertyName) = 0;
57 virtual void setProperty(const String& propertyName, const String& value, co nst String& priority, ExceptionCode&) = 0; 59 virtual void setProperty(const String& propertyName, const String& value, co nst String& priority, ExceptionCode&) = 0;
58 virtual String removeProperty(const String& propertyName, ExceptionCode&) = 0; 60 virtual String removeProperty(const String& propertyName, ExceptionCode&) = 0;
59 61
62 virtual PassRefPtr<CSSVariablesMap> var() = 0;
63 virtual unsigned variableCount() const = 0;
64 virtual String variableValue(const AtomicString& name) const = 0;
65 virtual void setVariableValue(const AtomicString& name, const String& value, ExceptionCode&) = 0;
66 virtual bool removeVariable(const AtomicString& name) = 0;
67 virtual void clearVariables(ExceptionCode&) = 0;
68
60 // CSSPropertyID versions of the CSSOM functions to support bindings and edi ting. 69 // CSSPropertyID versions of the CSSOM functions to support bindings and edi ting.
61 // Use the non-virtual methods in the concrete subclasses when possible. 70 // Use the non-virtual methods in the concrete subclasses when possible.
62 // 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. 71 // 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.
63 virtual PassRefPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) = 0; 72 virtual PassRefPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) = 0;
64 virtual String getPropertyValueInternal(CSSPropertyID) = 0; 73 virtual String getPropertyValueInternal(CSSPropertyID) = 0;
65 virtual void setPropertyInternal(CSSPropertyID, const String& value, bool im portant, ExceptionCode&) = 0; 74 virtual void setPropertyInternal(CSSPropertyID, const String& value, bool im portant, ExceptionCode&) = 0;
66 75
67 virtual PassRefPtr<MutableStylePropertySet> copyProperties() const = 0; 76 virtual PassRefPtr<MutableStylePropertySet> copyProperties() const = 0;
68 77
69 virtual bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const = 0; 78 virtual bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const = 0;
70 virtual CSSStyleSheet* parentStyleSheet() const { return 0; } 79 virtual CSSStyleSheet* parentStyleSheet() const { return 0; }
71 80
72 virtual void reportMemoryUsage(MemoryObjectInfo*) const = 0; 81 virtual void reportMemoryUsage(MemoryObjectInfo*) const = 0;
73 82
74 protected: 83 protected:
75 CSSStyleDeclaration() 84 CSSStyleDeclaration()
76 { 85 {
77 ScriptWrappable::init(this); 86 ScriptWrappable::init(this);
78 } 87 }
79 }; 88 };
80 89
81 } // namespace WebCore 90 } // namespace WebCore
82 91
83 #endif // CSSStyleDeclaration_h 92 #endif // CSSStyleDeclaration_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698