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