| 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 Apple Computer, Inc. | 3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. |
| 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 CSSProperty_h | 21 #ifndef CSSProperty_h |
| 22 #define CSSProperty_h | 22 #define CSSProperty_h |
| 23 | 23 |
| 24 #include "core/CSSPropertyNames.h" | 24 #include "core/CSSPropertyNames.h" |
| 25 #include "core/css/CSSPropertyMetadata.h" | |
| 26 #include "core/css/CSSValue.h" | 25 #include "core/css/CSSValue.h" |
| 27 #include "platform/RuntimeEnabledFeatures.h" | 26 #include "platform/RuntimeEnabledFeatures.h" |
| 28 #include "platform/text/TextDirection.h" | 27 #include "platform/text/TextDirection.h" |
| 29 #include "platform/text/WritingMode.h" | 28 #include "platform/text/WritingMode.h" |
| 30 #include "wtf/PassRefPtr.h" | 29 #include "wtf/PassRefPtr.h" |
| 31 #include "wtf/RefPtr.h" | 30 #include "wtf/RefPtr.h" |
| 32 | 31 |
| 33 namespace blink { | 32 namespace blink { |
| 34 | 33 |
| 35 struct StylePropertyMetadata { | 34 struct StylePropertyMetadata { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 50 uint16_t m_indexInShorthandsVector : 2; // If this property was set as part
of an ambiguous shorthand, gives the index in the shorthands vector. | 49 uint16_t m_indexInShorthandsVector : 2; // If this property was set as part
of an ambiguous shorthand, gives the index in the shorthands vector. |
| 51 uint16_t m_important : 1; | 50 uint16_t m_important : 1; |
| 52 uint16_t m_implicit : 1; // Whether or not the property was set implicitly a
s the result of a shorthand. | 51 uint16_t m_implicit : 1; // Whether or not the property was set implicitly a
s the result of a shorthand. |
| 53 uint16_t m_inherited : 1; | 52 uint16_t m_inherited : 1; |
| 54 }; | 53 }; |
| 55 | 54 |
| 56 class CSSProperty { | 55 class CSSProperty { |
| 57 ALLOW_ONLY_INLINE_ALLOCATION(); | 56 ALLOW_ONLY_INLINE_ALLOCATION(); |
| 58 public: | 57 public: |
| 59 CSSProperty(CSSPropertyID propertyID, PassRefPtrWillBeRawPtr<CSSValue> value
, bool important = false, bool isSetFromShorthand = false, int indexInShorthands
Vector = 0, bool implicit = false) | 58 CSSProperty(CSSPropertyID propertyID, PassRefPtrWillBeRawPtr<CSSValue> value
, bool important = false, bool isSetFromShorthand = false, int indexInShorthands
Vector = 0, bool implicit = false) |
| 60 : m_metadata(propertyID, isSetFromShorthand, indexInShorthandsVector, im
portant, implicit, CSSPropertyMetadata::isInheritedProperty(propertyID)) | 59 : m_metadata(propertyID, isSetFromShorthand, indexInShorthandsVector, im
portant, implicit, isInheritedProperty(propertyID)) |
| 61 , m_value(value) | 60 , m_value(value) |
| 62 { | 61 { |
| 63 } | 62 } |
| 64 | 63 |
| 65 // FIXME: Remove this. | 64 // FIXME: Remove this. |
| 66 CSSProperty(StylePropertyMetadata metadata, CSSValue* value) | 65 CSSProperty(StylePropertyMetadata metadata, CSSValue* value) |
| 67 : m_metadata(metadata) | 66 : m_metadata(metadata) |
| 68 , m_value(value) | 67 , m_value(value) |
| 69 { | 68 { |
| 70 } | 69 } |
| 71 | 70 |
| 72 CSSPropertyID id() const { return static_cast<CSSPropertyID>(m_metadata.m_pr
opertyID); } | 71 CSSPropertyID id() const { return static_cast<CSSPropertyID>(m_metadata.m_pr
opertyID); } |
| 73 bool isSetFromShorthand() const { return m_metadata.m_isSetFromShorthand; }; | 72 bool isSetFromShorthand() const { return m_metadata.m_isSetFromShorthand; }; |
| 74 CSSPropertyID shorthandID() const { return m_metadata.shorthandID(); }; | 73 CSSPropertyID shorthandID() const { return m_metadata.shorthandID(); }; |
| 75 bool isImportant() const { return m_metadata.m_important; } | 74 bool isImportant() const { return m_metadata.m_important; } |
| 76 | 75 |
| 77 CSSValue* value() const { return m_value.get(); } | 76 CSSValue* value() const { return m_value.get(); } |
| 78 | 77 |
| 79 void wrapValueInCommaSeparatedList(); | 78 void wrapValueInCommaSeparatedList(); |
| 80 | 79 |
| 81 static CSSPropertyID resolveDirectionAwareProperty(CSSPropertyID, TextDirect
ion, WritingMode); | 80 static CSSPropertyID resolveDirectionAwareProperty(CSSPropertyID, TextDirect
ion, WritingMode); |
| 81 static bool isInheritedProperty(CSSPropertyID); |
| 82 static bool isAffectedByAllProperty(CSSPropertyID); | 82 static bool isAffectedByAllProperty(CSSPropertyID); |
| 83 | 83 |
| 84 const StylePropertyMetadata& metadata() const { return m_metadata; } | 84 const StylePropertyMetadata& metadata() const { return m_metadata; } |
| 85 | 85 |
| 86 void trace(Visitor* visitor) { visitor->trace(m_value); } | 86 void trace(Visitor* visitor) { visitor->trace(m_value); } |
| 87 | 87 |
| 88 private: | 88 private: |
| 89 StylePropertyMetadata m_metadata; | 89 StylePropertyMetadata m_metadata; |
| 90 RefPtrWillBeMember<CSSValue> m_value; | 90 RefPtrWillBeMember<CSSValue> m_value; |
| 91 }; | 91 }; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 } | 187 } |
| 188 ASSERT(propertyId != CSSPropertyInvalid); | 188 ASSERT(propertyId != CSSPropertyInvalid); |
| 189 return propertyId; | 189 return propertyId; |
| 190 } | 190 } |
| 191 | 191 |
| 192 } // namespace blink | 192 } // namespace blink |
| 193 | 193 |
| 194 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::CSSProperty); | 194 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::CSSProperty); |
| 195 | 195 |
| 196 #endif // CSSProperty_h | 196 #endif // CSSProperty_h |
| OLD | NEW |