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 r
ights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. |
4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. | 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. |
5 * Copyright (C) 2013 Intel Corporation. All rights reserved. | 5 * Copyright (C) 2013 Intel Corporation. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "core/css/StylePropertySet.h" | 27 #include "core/css/StylePropertySet.h" |
28 | 28 |
29 #include "wtf/BitArray.h" | 29 #include "wtf/BitArray.h" |
30 | 30 |
31 namespace blink { | 31 namespace blink { |
32 | 32 |
33 class StylePropertySet; | 33 class StylePropertySet; |
34 class StylePropertyShorthand; | 34 class StylePropertyShorthand; |
35 | 35 |
36 class StylePropertySerializer { | 36 class StylePropertySerializer { |
| 37 STACK_ALLOCATED(); |
37 public: | 38 public: |
38 explicit StylePropertySerializer(const StylePropertySet&); | 39 explicit StylePropertySerializer(const StylePropertySet&); |
39 | 40 |
40 String asText() const; | 41 String asText() const; |
41 String getPropertyValue(CSSPropertyID) const; | 42 String getPropertyValue(CSSPropertyID) const; |
42 private: | 43 private: |
43 String getCommonValue(const StylePropertyShorthand&) const; | 44 String getCommonValue(const StylePropertyShorthand&) const; |
44 enum CommonValueMode { OmitUncommonValues, ReturnNullOnUncommonValues }; | 45 enum CommonValueMode { OmitUncommonValues, ReturnNullOnUncommonValues }; |
45 String borderPropertyValue(CommonValueMode) const; | 46 String borderPropertyValue(CommonValueMode) const; |
46 String getLayeredShorthandValue(const StylePropertyShorthand&) const; | 47 String getLayeredShorthandValue(const StylePropertyShorthand&) const; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 bool isValid() const { return m_value; } | 82 bool isValid() const { return m_value; } |
82 | 83 |
83 private: | 84 private: |
84 RawPtrWillBeMember<const CSSValue> m_value; | 85 RawPtrWillBeMember<const CSSValue> m_value; |
85 CSSPropertyID m_id; | 86 CSSPropertyID m_id; |
86 bool m_isImportant; | 87 bool m_isImportant; |
87 bool m_isImplicit; | 88 bool m_isImplicit; |
88 bool m_isInherited; | 89 bool m_isInherited; |
89 }; | 90 }; |
90 | 91 |
91 class StylePropertySetForSerializer { | 92 class StylePropertySetForSerializer final { |
| 93 DISALLOW_ALLOCATION(); |
92 public: | 94 public: |
93 explicit StylePropertySetForSerializer(const StylePropertySet&); | 95 explicit StylePropertySetForSerializer(const StylePropertySet&); |
94 | 96 |
95 unsigned propertyCount() const; | 97 unsigned propertyCount() const; |
96 PropertyValueForSerializer propertyAt(unsigned index) const; | 98 PropertyValueForSerializer propertyAt(unsigned index) const; |
97 bool shouldProcessPropertyAt(unsigned index) const; | 99 bool shouldProcessPropertyAt(unsigned index) const; |
98 int findPropertyIndex(CSSPropertyID) const; | 100 int findPropertyIndex(CSSPropertyID) const; |
99 const CSSValue* getPropertyCSSValue(CSSPropertyID) const; | 101 const CSSValue* getPropertyCSSValue(CSSPropertyID) const; |
100 String getPropertyValue(CSSPropertyID) const; | 102 String getPropertyValue(CSSPropertyID) const; |
101 bool isPropertyImplicit(CSSPropertyID) const; | 103 bool isPropertyImplicit(CSSPropertyID) const; |
102 bool propertyIsImportant(CSSPropertyID) const; | 104 bool propertyIsImportant(CSSPropertyID) const; |
103 | 105 |
| 106 DECLARE_TRACE(); |
| 107 |
104 private: | 108 private: |
105 bool hasExpandedAllProperty() const { return hasAllProperty() && m_needT
oExpandAll; } | 109 bool hasExpandedAllProperty() const { return hasAllProperty() && m_needT
oExpandAll; } |
106 bool hasAllProperty() const { return m_allIndex != -1; } | 110 bool hasAllProperty() const { return m_allIndex != -1; } |
107 | 111 |
108 const StylePropertySet& m_propertySet; | 112 RawPtrWillBeMember<const StylePropertySet> m_propertySet; |
109 int m_allIndex; | 113 int m_allIndex; |
110 BitArray<numCSSProperties> m_longhandPropertyUsed; | 114 BitArray<numCSSProperties> m_longhandPropertyUsed; |
111 bool m_needToExpandAll; | 115 bool m_needToExpandAll; |
112 }; | 116 }; |
113 | 117 |
114 const StylePropertySetForSerializer m_propertySet; | 118 const StylePropertySetForSerializer m_propertySet; |
115 }; | 119 }; |
116 | 120 |
117 } // namespace blink | 121 } // namespace blink |
118 | 122 |
119 #endif | 123 #endif // StylePropertySerializer_h |
OLD | NEW |