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

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

Issue 18311002: Partial implementation of CSSVariablesMap for CSS Variables CSSOM (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased webexposed tests 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,
(...skipping 23 matching lines...) Expand all
34 class CSSRule; 34 class CSSRule;
35 class CSSStyleDeclaration; 35 class CSSStyleDeclaration;
36 class Element; 36 class Element;
37 class ImmutableStylePropertySet; 37 class ImmutableStylePropertySet;
38 class KURL; 38 class KURL;
39 class MutableStylePropertySet; 39 class MutableStylePropertySet;
40 class PropertySetCSSStyleDeclaration; 40 class PropertySetCSSStyleDeclaration;
41 class StylePropertyShorthand; 41 class StylePropertyShorthand;
42 class StyleSheetContents; 42 class StyleSheetContents;
43 43
44 typedef int ExceptionCode;
45
44 class StylePropertySet : public RefCounted<StylePropertySet> { 46 class StylePropertySet : public RefCounted<StylePropertySet> {
45 friend class PropertyReference; 47 friend class PropertyReference;
46 public: 48 public:
47 // Override RefCounted's deref() to ensure operator delete is called on 49 // Override RefCounted's deref() to ensure operator delete is called on
48 // the appropriate subclass type. 50 // the appropriate subclass type.
49 void deref(); 51 void deref();
50 52
51 class PropertyReference { 53 class PropertyReference {
52 public: 54 public:
53 PropertyReference(const StylePropertySet& propertySet, unsigned index) 55 PropertyReference(const StylePropertySet& propertySet, unsigned index)
(...skipping 24 matching lines...) Expand all
78 const CSSValue* propertyValue() const; 80 const CSSValue* propertyValue() const;
79 81
80 const StylePropertySet& m_propertySet; 82 const StylePropertySet& m_propertySet;
81 unsigned m_index; 83 unsigned m_index;
82 }; 84 };
83 85
84 unsigned propertyCount() const; 86 unsigned propertyCount() const;
85 bool isEmpty() const; 87 bool isEmpty() const;
86 PropertyReference propertyAt(unsigned index) const { return PropertyReferenc e(*this, index); } 88 PropertyReference propertyAt(unsigned index) const { return PropertyReferenc e(*this, index); }
87 int findPropertyIndex(CSSPropertyID) const; 89 int findPropertyIndex(CSSPropertyID) const;
90 size_t findVariableIndex(const AtomicString& name) const;
88 91
89 PassRefPtr<CSSValue> getPropertyCSSValue(CSSPropertyID) const; 92 PassRefPtr<CSSValue> getPropertyCSSValue(CSSPropertyID) const;
90 String getPropertyValue(CSSPropertyID) const; 93 String getPropertyValue(CSSPropertyID) const;
94 unsigned variableCount() const;
95 String variableValue(const AtomicString& name) const;
96
91 bool propertyIsImportant(CSSPropertyID) const; 97 bool propertyIsImportant(CSSPropertyID) const;
92 CSSPropertyID getPropertyShorthand(CSSPropertyID) const; 98 CSSPropertyID getPropertyShorthand(CSSPropertyID) const;
93 bool isPropertyImplicit(CSSPropertyID) const; 99 bool isPropertyImplicit(CSSPropertyID) const;
94 100
95 PassRefPtr<MutableStylePropertySet> copyBlockProperties() const; 101 PassRefPtr<MutableStylePropertySet> copyBlockProperties() const;
96 102
97 CSSParserMode cssParserMode() const { return static_cast<CSSParserMode>(m_cs sParserMode); } 103 CSSParserMode cssParserMode() const { return static_cast<CSSParserMode>(m_cs sParserMode); }
98 104
99 void addSubresourceStyleURLs(ListHashSet<KURL>&, StyleSheetContents* context StyleSheet) const; 105 void addSubresourceStyleURLs(ListHashSet<KURL>&, StyleSheetContents* context StyleSheet) const;
100 106
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 // These expand shorthand properties into multiple properties. 196 // These expand shorthand properties into multiple properties.
191 bool setProperty(CSSPropertyID, const String& value, bool important = false, StyleSheetContents* contextStyleSheet = 0); 197 bool setProperty(CSSPropertyID, const String& value, bool important = false, StyleSheetContents* contextStyleSheet = 0);
192 void setProperty(CSSPropertyID, PassRefPtr<CSSValue>, bool important = false ); 198 void setProperty(CSSPropertyID, PassRefPtr<CSSValue>, bool important = false );
193 199
194 // These do not. FIXME: This is too messy, we can do better. 200 // These do not. FIXME: This is too messy, we can do better.
195 bool setProperty(CSSPropertyID, CSSValueID identifier, bool important = fals e); 201 bool setProperty(CSSPropertyID, CSSValueID identifier, bool important = fals e);
196 bool setProperty(CSSPropertyID, CSSPropertyID identifier, bool important = f alse); 202 bool setProperty(CSSPropertyID, CSSPropertyID identifier, bool important = f alse);
197 void appendPrefixingVariantProperty(const CSSProperty&); 203 void appendPrefixingVariantProperty(const CSSProperty&);
198 void setPrefixingVariantProperty(const CSSProperty&); 204 void setPrefixingVariantProperty(const CSSProperty&);
199 void setProperty(const CSSProperty&, CSSProperty* slot = 0); 205 void setProperty(const CSSProperty&, CSSProperty* slot = 0);
206 bool setVariableValue(const AtomicString& name, const String& value, Excepti onCode&, bool important = false);
esprehn 2013/07/04 02:48:52 StylePropertySet is an internal API, it shouldn't
alancutter (OOO until 2018) 2013/07/04 06:18:14 Thanks for catching this, there's no reason Except
200 207
201 bool removeProperty(CSSPropertyID, String* returnText = 0); 208 bool removeProperty(CSSPropertyID, String* returnText = 0);
202 void removePrefixedOrUnprefixedProperty(CSSPropertyID); 209 void removePrefixedOrUnprefixedProperty(CSSPropertyID);
203 void removeBlockProperties(); 210 void removeBlockProperties();
204 bool removePropertiesInSet(const CSSPropertyID* set, unsigned length); 211 bool removePropertiesInSet(const CSSPropertyID* set, unsigned length);
205 void removeEquivalentProperties(const StylePropertySet*); 212 void removeEquivalentProperties(const StylePropertySet*);
206 void removeEquivalentProperties(const CSSStyleDeclaration*); 213 void removeEquivalentProperties(const CSSStyleDeclaration*);
214 bool removeVariable(const AtomicString& name);
215 bool clearVariables();
207 216
208 void mergeAndOverrideOnConflict(const StylePropertySet*); 217 void mergeAndOverrideOnConflict(const StylePropertySet*);
209 218
210 void clear(); 219 void clear();
211 void parseDeclaration(const String& styleDeclaration, StyleSheetContents* co ntextStyleSheet); 220 void parseDeclaration(const String& styleDeclaration, StyleSheetContents* co ntextStyleSheet);
212 221
213 CSSStyleDeclaration* ensureCSSStyleDeclaration(); 222 CSSStyleDeclaration* ensureCSSStyleDeclaration();
214 CSSStyleDeclaration* ensureInlineCSSStyleDeclaration(Element* parentElement) ; 223 CSSStyleDeclaration* ensureInlineCSSStyleDeclaration(Element* parentElement) ;
215 224
216 Vector<CSSProperty, 4> m_propertyVector; 225 Vector<CSSProperty, 4> m_propertyVector;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 268
260 if (m_isMutable) 269 if (m_isMutable)
261 delete static_cast<MutableStylePropertySet*>(this); 270 delete static_cast<MutableStylePropertySet*>(this);
262 else 271 else
263 delete static_cast<ImmutableStylePropertySet*>(this); 272 delete static_cast<ImmutableStylePropertySet*>(this);
264 } 273 }
265 274
266 } // namespace WebCore 275 } // namespace WebCore
267 276
268 #endif // StylePropertySet_h 277 #endif // StylePropertySet_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698