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, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 uint16_t m_isSetFromShorthand : 1; | 51 uint16_t m_isSetFromShorthand : 1; |
52 uint16_t m_indexInShorthandsVector : 2; // If this property was set as part
of an ambiguous shorthand, gives the index in the shorthands vector. | 52 uint16_t m_indexInShorthandsVector : 2; // If this property was set as part
of an ambiguous shorthand, gives the index in the shorthands vector. |
53 uint16_t m_important : 1; | 53 uint16_t m_important : 1; |
54 uint16_t m_implicit : 1; // Whether or not the property was set implicitly a
s the result of a shorthand. | 54 uint16_t m_implicit : 1; // Whether or not the property was set implicitly a
s the result of a shorthand. |
55 uint16_t m_inherited : 1; | 55 uint16_t m_inherited : 1; |
56 }; | 56 }; |
57 | 57 |
58 class CSSProperty { | 58 class CSSProperty { |
59 ALLOW_ONLY_INLINE_ALLOCATION(); | 59 ALLOW_ONLY_INLINE_ALLOCATION(); |
60 public: | 60 public: |
61 CSSProperty(CSSPropertyID propertyID, PassRefPtrWillBeRawPtr<CSSValue> value
, bool important = false, bool isSetFromShorthand = false, int indexInShorthands
Vector = 0, bool implicit = false) | 61 CSSProperty(CSSPropertyID propertyID, PassRefPtr<CSSValue> value, bool impor
tant = false, bool isSetFromShorthand = false, int indexInShorthandsVector = 0,
bool implicit = false) |
62 : m_metadata(propertyID, isSetFromShorthand, indexInShorthandsVector, im
portant, implicit, CSSPropertyMetadata::isInheritedProperty(propertyID)) | 62 : m_metadata(propertyID, isSetFromShorthand, indexInShorthandsVector, im
portant, implicit, CSSPropertyMetadata::isInheritedProperty(propertyID)) |
63 , m_value(value) | 63 , m_value(value) |
64 { | 64 { |
65 } | 65 } |
66 | 66 |
67 // FIXME: Remove this. | 67 // FIXME: Remove this. |
68 CSSProperty(StylePropertyMetadata metadata, CSSValue* value) | 68 CSSProperty(StylePropertyMetadata metadata, CSSValue* value) |
69 : m_metadata(metadata) | 69 : m_metadata(metadata) |
70 , m_value(value) | 70 , m_value(value) |
71 { | 71 { |
72 } | 72 } |
73 | 73 |
74 CSSPropertyID id() const { return static_cast<CSSPropertyID>(m_metadata.m_pr
opertyID); } | 74 CSSPropertyID id() const { return static_cast<CSSPropertyID>(m_metadata.m_pr
opertyID); } |
75 bool isSetFromShorthand() const { return m_metadata.m_isSetFromShorthand; } | 75 bool isSetFromShorthand() const { return m_metadata.m_isSetFromShorthand; } |
76 CSSPropertyID shorthandID() const { return m_metadata.shorthandID(); } | 76 CSSPropertyID shorthandID() const { return m_metadata.shorthandID(); } |
77 bool isImportant() const { return m_metadata.m_important; } | 77 bool isImportant() const { return m_metadata.m_important; } |
78 | 78 |
79 CSSValue* value() const { return m_value.get(); } | 79 CSSValue* value() const { return m_value.get(); } |
80 | 80 |
81 static CSSPropertyID resolveDirectionAwareProperty(CSSPropertyID, TextDirect
ion, WritingMode); | 81 static CSSPropertyID resolveDirectionAwareProperty(CSSPropertyID, TextDirect
ion, WritingMode); |
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 bool operator==(const CSSProperty& other) const; | 86 bool operator==(const CSSProperty& other) const; |
87 | 87 |
88 DEFINE_INLINE_TRACE() { visitor->trace(m_value); } | |
89 | |
90 private: | 88 private: |
91 StylePropertyMetadata m_metadata; | 89 StylePropertyMetadata m_metadata; |
92 RefPtrWillBeMember<CSSValue> m_value; | 90 RefPtr<CSSValue> m_value; |
93 }; | 91 }; |
94 | 92 |
95 } // namespace blink | 93 } // namespace blink |
96 | 94 |
97 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::CSSProperty); | 95 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::CSSProperty); |
98 | 96 |
99 #endif // CSSProperty_h | 97 #endif // CSSProperty_h |
OLD | NEW |