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, 2007, 2008, 2009, 2010, 2012 Apple Inc. All | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All |
4 * rights reserved. | 4 * rights reserved. |
5 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. | 5 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. |
6 * Copyright (C) 2013 Intel Corporation. All rights reserved. | 6 * Copyright (C) 2013 Intel Corporation. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // Only StylePropertySerializer uses the following two classes. | 76 // Only StylePropertySerializer uses the following two classes. |
77 class PropertyValueForSerializer { | 77 class PropertyValueForSerializer { |
78 STACK_ALLOCATED(); | 78 STACK_ALLOCATED(); |
79 | 79 |
80 public: | 80 public: |
81 explicit PropertyValueForSerializer( | 81 explicit PropertyValueForSerializer( |
82 StylePropertySet::PropertyReference property) | 82 StylePropertySet::PropertyReference property) |
83 : m_value(property.value()), | 83 : m_value(property.value()), |
84 m_id(property.id()), | 84 m_id(property.id()), |
85 m_isImportant(property.isImportant()), | 85 m_isImportant(property.isImportant()), |
86 m_isImplicit(property.isImplicit()), | |
87 m_isInherited(property.isInherited()) {} | 86 m_isInherited(property.isInherited()) {} |
88 | 87 |
89 // TODO(sashab): Make this take a const CSSValue&. | 88 // TODO(sashab): Make this take a const CSSValue&. |
90 PropertyValueForSerializer(CSSPropertyID id, | 89 PropertyValueForSerializer(CSSPropertyID id, |
91 const CSSValue* value, | 90 const CSSValue* value, |
92 bool isImportant) | 91 bool isImportant) |
93 : m_value(value), | 92 : m_value(value), |
94 m_id(id), | 93 m_id(id), |
95 m_isImportant(isImportant), | 94 m_isImportant(isImportant), |
96 m_isImplicit(value->isImplicitInitialValue()), | |
97 m_isInherited(value->isInheritedValue()) {} | 95 m_isInherited(value->isInheritedValue()) {} |
98 | 96 |
99 CSSPropertyID id() const { return m_id; } | 97 CSSPropertyID id() const { return m_id; } |
100 const CSSValue* value() const { return m_value; } | 98 const CSSValue* value() const { return m_value; } |
101 bool isImportant() const { return m_isImportant; } | 99 bool isImportant() const { return m_isImportant; } |
102 bool isImplicit() const { return m_isImplicit; } | |
103 bool isInherited() const { return m_isInherited; } | 100 bool isInherited() const { return m_isInherited; } |
104 bool isValid() const { return m_value; } | 101 bool isValid() const { return m_value; } |
105 | 102 |
106 private: | 103 private: |
107 Member<const CSSValue> m_value; | 104 Member<const CSSValue> m_value; |
108 CSSPropertyID m_id; | 105 CSSPropertyID m_id; |
109 bool m_isImportant; | 106 bool m_isImportant; |
110 bool m_isImplicit; | |
111 bool m_isInherited; | 107 bool m_isInherited; |
112 }; | 108 }; |
113 | 109 |
114 String getCustomPropertyText(const PropertyValueForSerializer&, | 110 String getCustomPropertyText(const PropertyValueForSerializer&, |
115 bool isNotFirstDecl) const; | 111 bool isNotFirstDecl) const; |
116 | 112 |
117 class StylePropertySetForSerializer final { | 113 class StylePropertySetForSerializer final { |
118 DISALLOW_NEW(); | 114 DISALLOW_NEW(); |
119 | 115 |
120 public: | 116 public: |
121 explicit StylePropertySetForSerializer(const StylePropertySet&); | 117 explicit StylePropertySetForSerializer(const StylePropertySet&); |
122 | 118 |
123 unsigned propertyCount() const; | 119 unsigned propertyCount() const; |
124 PropertyValueForSerializer propertyAt(unsigned index) const; | 120 PropertyValueForSerializer propertyAt(unsigned index) const; |
125 bool shouldProcessPropertyAt(unsigned index) const; | 121 bool shouldProcessPropertyAt(unsigned index) const; |
126 int findPropertyIndex(CSSPropertyID) const; | 122 int findPropertyIndex(CSSPropertyID) const; |
127 const CSSValue* getPropertyCSSValue(CSSPropertyID) const; | 123 const CSSValue* getPropertyCSSValue(CSSPropertyID) const; |
128 bool isPropertyImplicit(CSSPropertyID) const; | |
129 | 124 |
130 DECLARE_TRACE(); | 125 DECLARE_TRACE(); |
131 | 126 |
132 private: | 127 private: |
133 bool hasExpandedAllProperty() const { | 128 bool hasExpandedAllProperty() const { |
134 return hasAllProperty() && m_needToExpandAll; | 129 return hasAllProperty() && m_needToExpandAll; |
135 } | 130 } |
136 bool hasAllProperty() const { return m_allIndex != -1; } | 131 bool hasAllProperty() const { return m_allIndex != -1; } |
137 | 132 |
138 Member<const StylePropertySet> m_propertySet; | 133 Member<const StylePropertySet> m_propertySet; |
139 int m_allIndex; | 134 int m_allIndex; |
140 std::bitset<numCSSProperties> m_longhandPropertyUsed; | 135 std::bitset<numCSSProperties> m_longhandPropertyUsed; |
141 bool m_needToExpandAll; | 136 bool m_needToExpandAll; |
142 }; | 137 }; |
143 | 138 |
144 const StylePropertySetForSerializer m_propertySet; | 139 const StylePropertySetForSerializer m_propertySet; |
145 }; | 140 }; |
146 | 141 |
147 } // namespace blink | 142 } // namespace blink |
148 | 143 |
149 #endif // StylePropertySerializer_h | 144 #endif // StylePropertySerializer_h |
OLD | NEW |