| 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, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 public: | 52 public: |
| 53 PropertyReference(const StylePropertySet& propertySet, unsigned index) | 53 PropertyReference(const StylePropertySet& propertySet, unsigned index) |
| 54 : m_propertySet(propertySet) | 54 : m_propertySet(propertySet) |
| 55 , m_index(index) | 55 , m_index(index) |
| 56 { | 56 { |
| 57 } | 57 } |
| 58 | 58 |
| 59 CSSPropertyID id() const { return static_cast<CSSPropertyID>(propertyMet
adata().m_propertyID); } | 59 CSSPropertyID id() const { return static_cast<CSSPropertyID>(propertyMet
adata().m_propertyID); } |
| 60 CSSPropertyID shorthandID() const { return propertyMetadata().shorthandI
D(); } | 60 CSSPropertyID shorthandID() const { return propertyMetadata().shorthandI
D(); } |
| 61 | 61 |
| 62 bool isImportant() const { return propertyMetadata().m_important; } | |
| 63 bool isInherited() const { return propertyMetadata().m_inherited; } | 62 bool isInherited() const { return propertyMetadata().m_inherited; } |
| 64 bool isImplicit() const { return propertyMetadata().m_implicit; } | 63 bool isImplicit() const { return propertyMetadata().m_implicit; } |
| 65 | 64 |
| 66 String cssName() const; | 65 String cssName() const; |
| 67 String cssText() const; | 66 String cssText() const; |
| 68 | 67 |
| 69 const CSSValue* value() const { return propertyValue(); } | 68 const CSSValue* value() const { return propertyValue(); } |
| 70 // FIXME: We should try to remove this mutable overload. | 69 // FIXME: We should try to remove this mutable overload. |
| 71 CSSValue* value() { return const_cast<CSSValue*>(propertyValue()); } | 70 CSSValue* value() { return const_cast<CSSValue*>(propertyValue()); } |
| 72 | 71 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 84 | 83 |
| 85 unsigned propertyCount() const; | 84 unsigned propertyCount() const; |
| 86 bool isEmpty() const; | 85 bool isEmpty() const; |
| 87 PropertyReference propertyAt(unsigned index) const { return PropertyReferenc
e(*this, index); } | 86 PropertyReference propertyAt(unsigned index) const { return PropertyReferenc
e(*this, index); } |
| 88 int findPropertyIndex(CSSPropertyID) const; | 87 int findPropertyIndex(CSSPropertyID) const; |
| 89 bool hasProperty(CSSPropertyID property) const { return findPropertyIndex(pr
operty) != -1; } | 88 bool hasProperty(CSSPropertyID property) const { return findPropertyIndex(pr
operty) != -1; } |
| 90 | 89 |
| 91 PassRefPtr<CSSValue> getPropertyCSSValue(CSSPropertyID) const; | 90 PassRefPtr<CSSValue> getPropertyCSSValue(CSSPropertyID) const; |
| 92 String getPropertyValue(CSSPropertyID) const; | 91 String getPropertyValue(CSSPropertyID) const; |
| 93 | 92 |
| 94 bool propertyIsImportant(CSSPropertyID) const; | |
| 95 CSSPropertyID getPropertyShorthand(CSSPropertyID) const; | 93 CSSPropertyID getPropertyShorthand(CSSPropertyID) const; |
| 96 bool isPropertyImplicit(CSSPropertyID) const; | 94 bool isPropertyImplicit(CSSPropertyID) const; |
| 97 | 95 |
| 98 PassRefPtr<MutableStylePropertySet> copyBlockProperties() const; | 96 PassRefPtr<MutableStylePropertySet> copyBlockProperties() const; |
| 99 | 97 |
| 100 CSSParserMode cssParserMode() const { return static_cast<CSSParserMode>(m_cs
sParserMode); } | 98 CSSParserMode cssParserMode() const { return static_cast<CSSParserMode>(m_cs
sParserMode); } |
| 101 | 99 |
| 102 PassRefPtr<MutableStylePropertySet> mutableCopy() const; | 100 PassRefPtr<MutableStylePropertySet> mutableCopy() const; |
| 103 PassRefPtr<ImmutableStylePropertySet> immutableCopyIfNeeded() const; | 101 PassRefPtr<ImmutableStylePropertySet> immutableCopyIfNeeded() const; |
| 104 | 102 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 ~MutableStylePropertySet() { } | 176 ~MutableStylePropertySet() { } |
| 179 static PassRefPtr<MutableStylePropertySet> create(CSSParserMode = HTMLStanda
rdMode); | 177 static PassRefPtr<MutableStylePropertySet> create(CSSParserMode = HTMLStanda
rdMode); |
| 180 static PassRefPtr<MutableStylePropertySet> create(const CSSProperty* propert
ies, unsigned count); | 178 static PassRefPtr<MutableStylePropertySet> create(const CSSProperty* propert
ies, unsigned count); |
| 181 | 179 |
| 182 unsigned propertyCount() const { return m_propertyVector.size(); } | 180 unsigned propertyCount() const { return m_propertyVector.size(); } |
| 183 | 181 |
| 184 void addParsedProperties(const Vector<CSSProperty, 256>&); | 182 void addParsedProperties(const Vector<CSSProperty, 256>&); |
| 185 void addParsedProperty(const CSSProperty&); | 183 void addParsedProperty(const CSSProperty&); |
| 186 | 184 |
| 187 // These expand shorthand properties into multiple properties. | 185 // These expand shorthand properties into multiple properties. |
| 188 bool setProperty(CSSPropertyID, const String& value, bool important = false,
StyleSheetContents* contextStyleSheet = 0); | 186 bool setProperty(CSSPropertyID, const String& value, StyleSheetContents* con
textStyleSheet = 0); |
| 189 void setProperty(CSSPropertyID, PassRefPtr<CSSValue>, bool important = false
); | 187 void setProperty(CSSPropertyID, PassRefPtr<CSSValue>); |
| 190 | 188 |
| 191 // These do not. FIXME: This is too messy, we can do better. | 189 // These do not. FIXME: This is too messy, we can do better. |
| 192 bool setProperty(CSSPropertyID, CSSValueID identifier, bool important = fals
e); | 190 bool setProperty(CSSPropertyID, CSSValueID identifier); |
| 193 bool setProperty(CSSPropertyID, CSSPropertyID identifier, bool important = f
alse); | 191 bool setProperty(CSSPropertyID, CSSPropertyID identifier); |
| 194 void appendProperty(const CSSProperty&); | 192 void appendProperty(const CSSProperty&); |
| 195 void setProperty(const CSSProperty&, CSSProperty* slot = 0); | 193 void setProperty(const CSSProperty&, CSSProperty* slot = 0); |
| 196 | 194 |
| 197 bool removeProperty(CSSPropertyID, String* returnText = 0); | 195 bool removeProperty(CSSPropertyID, String* returnText = 0); |
| 198 void removeBlockProperties(); | 196 void removeBlockProperties(); |
| 199 bool removePropertiesInSet(const CSSPropertyID* set, unsigned length); | 197 bool removePropertiesInSet(const CSSPropertyID* set, unsigned length); |
| 200 void removeEquivalentProperties(const StylePropertySet*); | 198 void removeEquivalentProperties(const StylePropertySet*); |
| 201 void removeEquivalentProperties(const CSSStyleDeclaration*); | 199 void removeEquivalentProperties(const CSSStyleDeclaration*); |
| 202 | 200 |
| 203 void clear(); | 201 void clear(); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 inline int StylePropertySet::findPropertyIndex(CSSPropertyID propertyID) const | 267 inline int StylePropertySet::findPropertyIndex(CSSPropertyID propertyID) const |
| 270 { | 268 { |
| 271 if (m_isMutable) | 269 if (m_isMutable) |
| 272 return toMutableStylePropertySet(this)->findPropertyIndex(propertyID); | 270 return toMutableStylePropertySet(this)->findPropertyIndex(propertyID); |
| 273 return toImmutableStylePropertySet(this)->findPropertyIndex(propertyID); | 271 return toImmutableStylePropertySet(this)->findPropertyIndex(propertyID); |
| 274 } | 272 } |
| 275 | 273 |
| 276 } // namespace blink | 274 } // namespace blink |
| 277 | 275 |
| 278 #endif // SKY_ENGINE_CORE_CSS_STYLEPROPERTYSET_H_ | 276 #endif // SKY_ENGINE_CORE_CSS_STYLEPROPERTYSET_H_ |
| OLD | NEW |