OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
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 14 matching lines...) Expand all Loading... |
25 #include "core/CSSPropertyNames.h" | 25 #include "core/CSSPropertyNames.h" |
26 | 26 |
27 #include "core/css/CSSSVGDocumentValue.h" | 27 #include "core/css/CSSSVGDocumentValue.h" |
28 #include "core/css/CSSToLengthConversionData.h" | 28 #include "core/css/CSSToLengthConversionData.h" |
29 #include "core/css/resolver/CSSToStyleMap.h" | 29 #include "core/css/resolver/CSSToStyleMap.h" |
30 #include "core/css/resolver/ElementResolveContext.h" | 30 #include "core/css/resolver/ElementResolveContext.h" |
31 #include "core/css/resolver/ElementStyleResources.h" | 31 #include "core/css/resolver/ElementStyleResources.h" |
32 #include "core/css/resolver/FontBuilder.h" | 32 #include "core/css/resolver/FontBuilder.h" |
33 #include "core/dom/Document.h" | 33 #include "core/dom/Document.h" |
34 #include "core/dom/Element.h" | 34 #include "core/dom/Element.h" |
35 #include "core/rendering/style/CachedUAStyle.h" | |
36 #include "core/rendering/style/RenderStyle.h" | 35 #include "core/rendering/style/RenderStyle.h" |
37 #include "core/rendering/style/StyleInheritedData.h" | 36 #include "core/rendering/style/StyleInheritedData.h" |
38 | 37 |
39 namespace blink { | 38 namespace blink { |
40 | 39 |
41 class CSSAnimationUpdate; | 40 class CSSAnimationUpdate; |
42 class FontDescription; | 41 class FontDescription; |
43 class StyleRule; | 42 class StyleRule; |
44 | 43 |
45 class StyleResolverState { | 44 class StyleResolverState { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // We need to move this data off of StyleResolverState and closer to the | 81 // We need to move this data off of StyleResolverState and closer to the |
83 // objects it applies to. Possibly separating (immutable) inputs from (mutab
le) outputs. | 82 // objects it applies to. Possibly separating (immutable) inputs from (mutab
le) outputs. |
84 void setApplyPropertyToRegularStyle(bool isApply) { m_applyPropertyToRegular
Style = isApply; } | 83 void setApplyPropertyToRegularStyle(bool isApply) { m_applyPropertyToRegular
Style = isApply; } |
85 void setApplyPropertyToVisitedLinkStyle(bool isApply) { m_applyPropertyToVis
itedLinkStyle = isApply; } | 84 void setApplyPropertyToVisitedLinkStyle(bool isApply) { m_applyPropertyToVis
itedLinkStyle = isApply; } |
86 bool applyPropertyToRegularStyle() const { return m_applyPropertyToRegularSt
yle; } | 85 bool applyPropertyToRegularStyle() const { return m_applyPropertyToRegularSt
yle; } |
87 bool applyPropertyToVisitedLinkStyle() const { return m_applyPropertyToVisit
edLinkStyle; } | 86 bool applyPropertyToVisitedLinkStyle() const { return m_applyPropertyToVisit
edLinkStyle; } |
88 | 87 |
89 // Holds all attribute names found while applying "content" properties that
contain an "attr()" value. | 88 // Holds all attribute names found while applying "content" properties that
contain an "attr()" value. |
90 Vector<AtomicString>& contentAttrValues() { return m_contentAttrValues; } | 89 Vector<AtomicString>& contentAttrValues() { return m_contentAttrValues; } |
91 | 90 |
92 void cacheUserAgentBorderAndBackground() | 91 void setValuesUnchangedForWebkitAppearance() { m_valuesUnchangedForWebkitApp
earance = true; } |
93 { | 92 bool valuesUnchangedForWebkitAppearance() { return m_valuesUnchangedForWebki
tAppearance; } |
94 // RenderTheme only needs the cached style if it has an appearance, | |
95 // and constructing it is expensive so we avoid it if possible. | |
96 if (!style()->hasAppearance()) | |
97 return; | |
98 | |
99 m_cachedUAStyle = CachedUAStyle::create(style()); | |
100 } | |
101 | |
102 const CachedUAStyle* cachedUAStyle() const | |
103 { | |
104 return m_cachedUAStyle.get(); | |
105 } | |
106 | 93 |
107 ElementStyleResources& elementStyleResources() { return m_elementStyleResour
ces; } | 94 ElementStyleResources& elementStyleResources() { return m_elementStyleResour
ces; } |
108 const CSSToStyleMap& styleMap() const { return m_styleMap; } | 95 const CSSToStyleMap& styleMap() const { return m_styleMap; } |
109 CSSToStyleMap& styleMap() { return m_styleMap; } | 96 CSSToStyleMap& styleMap() { return m_styleMap; } |
110 | 97 |
111 // FIXME: Once styleImage can be made to not take a StyleResolverState | 98 // FIXME: Once styleImage can be made to not take a StyleResolverState |
112 // this convenience function should be removed. As-is, without this, call | 99 // this convenience function should be removed. As-is, without this, call |
113 // sites are extremely verbose. | 100 // sites are extremely verbose. |
114 PassRefPtr<StyleImage> styleImage(CSSPropertyID propertyId, CSSValue* value) | 101 PassRefPtr<StyleImage> styleImage(CSSPropertyID propertyId, CSSValue* value) |
115 { | 102 { |
(...skipping 25 matching lines...) Expand all Loading... |
141 // so we keep it separate from m_elementContext. | 128 // so we keep it separate from m_elementContext. |
142 RefPtr<RenderStyle> m_parentStyle; | 129 RefPtr<RenderStyle> m_parentStyle; |
143 | 130 |
144 OwnPtrWillBeMember<CSSAnimationUpdate> m_animationUpdate; | 131 OwnPtrWillBeMember<CSSAnimationUpdate> m_animationUpdate; |
145 | 132 |
146 bool m_applyPropertyToRegularStyle; | 133 bool m_applyPropertyToRegularStyle; |
147 bool m_applyPropertyToVisitedLinkStyle; | 134 bool m_applyPropertyToVisitedLinkStyle; |
148 | 135 |
149 FontBuilder m_fontBuilder; | 136 FontBuilder m_fontBuilder; |
150 | 137 |
151 OwnPtr<CachedUAStyle> m_cachedUAStyle; | 138 bool m_valuesUnchangedForWebkitAppearance; |
152 | 139 |
153 ElementStyleResources m_elementStyleResources; | 140 ElementStyleResources m_elementStyleResources; |
154 // CSSToStyleMap is a pure-logic class and only contains | 141 // CSSToStyleMap is a pure-logic class and only contains |
155 // a back-pointer to this object. | 142 // a back-pointer to this object. |
156 CSSToStyleMap m_styleMap; | 143 CSSToStyleMap m_styleMap; |
157 Vector<AtomicString> m_contentAttrValues; | 144 Vector<AtomicString> m_contentAttrValues; |
158 }; | 145 }; |
159 | 146 |
160 } // namespace blink | 147 } // namespace blink |
161 | 148 |
162 #endif // StyleResolverState_h | 149 #endif // StyleResolverState_h |
OLD | NEW |