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, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
19 * | 19 * |
20 */ | 20 */ |
21 | 21 |
22 #ifndef StyleResolverState_h | 22 #ifndef StyleResolverState_h |
23 #define StyleResolverState_h | 23 #define StyleResolverState_h |
24 | 24 |
25 #include "CSSPropertyNames.h" | 25 #include "CSSPropertyNames.h" |
26 | 26 |
27 #include "core/animation/css/CSSAnimations.h" | 27 #include "core/animation/css/CSSAnimations.h" |
28 #include "core/css/CSSSVGDocumentValue.h" | 28 #include "core/css/CSSSVGDocumentValue.h" |
| 29 #include "core/css/CSSToLengthConversionData.h" |
29 #include "core/css/CSSToStyleMap.h" | 30 #include "core/css/CSSToStyleMap.h" |
30 #include "core/css/resolver/ElementResolveContext.h" | 31 #include "core/css/resolver/ElementResolveContext.h" |
31 #include "core/css/resolver/ElementStyleResources.h" | 32 #include "core/css/resolver/ElementStyleResources.h" |
32 #include "core/css/resolver/FontBuilder.h" | 33 #include "core/css/resolver/FontBuilder.h" |
33 #include "core/dom/Element.h" | 34 #include "core/dom/Element.h" |
34 #include "core/rendering/style/CachedUAStyle.h" | 35 #include "core/rendering/style/CachedUAStyle.h" |
35 #include "core/rendering/style/RenderStyle.h" | 36 #include "core/rendering/style/RenderStyle.h" |
36 #include "core/rendering/style/StyleInheritedData.h" | 37 #include "core/rendering/style/StyleInheritedData.h" |
37 | 38 |
38 namespace WebCore { | 39 namespace WebCore { |
(...skipping 12 matching lines...) Expand all Loading... |
51 Document& document() const { return m_document; } | 52 Document& document() const { return m_document; } |
52 // These are all just pass-through methods to ElementResolveContext. | 53 // These are all just pass-through methods to ElementResolveContext. |
53 Element* element() const { return m_elementContext.element(); } | 54 Element* element() const { return m_elementContext.element(); } |
54 const ContainerNode* parentNode() const { return m_elementContext.parentNode
(); } | 55 const ContainerNode* parentNode() const { return m_elementContext.parentNode
(); } |
55 const RenderStyle* rootElementStyle() const { return m_elementContext.rootEl
ementStyle(); } | 56 const RenderStyle* rootElementStyle() const { return m_elementContext.rootEl
ementStyle(); } |
56 EInsideLink elementLinkState() const { return m_elementContext.elementLinkSt
ate(); } | 57 EInsideLink elementLinkState() const { return m_elementContext.elementLinkSt
ate(); } |
57 bool distributedToInsertionPoint() const { return m_elementContext.distribut
edToInsertionPoint(); } | 58 bool distributedToInsertionPoint() const { return m_elementContext.distribut
edToInsertionPoint(); } |
58 | 59 |
59 const ElementResolveContext& elementContext() const { return m_elementContex
t; } | 60 const ElementResolveContext& elementContext() const { return m_elementContex
t; } |
60 | 61 |
61 void setStyle(PassRefPtr<RenderStyle> style) { m_style = style; } | 62 void setStyle(PassRefPtr<RenderStyle> style) { m_style = style; m_cssToLengt
hConversionData.setStyle(m_style.get()); } |
62 const RenderStyle* style() const { return m_style.get(); } | 63 const RenderStyle* style() const { return m_style.get(); } |
63 RenderStyle* style() { return m_style.get(); } | 64 RenderStyle* style() { return m_style.get(); } |
64 PassRefPtr<RenderStyle> takeStyle() { return m_style.release(); } | 65 PassRefPtr<RenderStyle> takeStyle() { return m_style.release(); } |
65 | 66 |
| 67 const CSSToLengthConversionData& cssToLengthConversionData() const { return
m_cssToLengthConversionData; } |
| 68 |
66 void setAnimationUpdate(PassOwnPtr<CSSAnimationUpdate> update) { m_animation
Update = update; } | 69 void setAnimationUpdate(PassOwnPtr<CSSAnimationUpdate> update) { m_animation
Update = update; } |
67 const CSSAnimationUpdate* animationUpdate() { return m_animationUpdate.get()
; } | 70 const CSSAnimationUpdate* animationUpdate() { return m_animationUpdate.get()
; } |
68 PassOwnPtr<CSSAnimationUpdate> takeAnimationUpdate() { return m_animationUpd
ate.release(); } | 71 PassOwnPtr<CSSAnimationUpdate> takeAnimationUpdate() { return m_animationUpd
ate.release(); } |
69 | 72 |
70 void setParentStyle(PassRefPtr<RenderStyle> parentStyle) { m_parentStyle = p
arentStyle; } | 73 void setParentStyle(PassRefPtr<RenderStyle> parentStyle) { m_parentStyle = p
arentStyle; } |
71 const RenderStyle* parentStyle() const { return m_parentStyle.get(); } | 74 const RenderStyle* parentStyle() const { return m_parentStyle.get(); } |
72 RenderStyle* parentStyle() { return m_parentStyle.get(); } | 75 RenderStyle* parentStyle() { return m_parentStyle.get(); } |
73 | 76 |
74 const RenderRegion* regionForStyling() const { return m_regionForStyling; } | 77 const RenderRegion* regionForStyling() const { return m_regionForStyling; } |
75 | 78 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 134 |
132 private: | 135 private: |
133 friend class StyleResolveScope; | 136 friend class StyleResolveScope; |
134 | 137 |
135 ElementResolveContext m_elementContext; | 138 ElementResolveContext m_elementContext; |
136 Document& m_document; | 139 Document& m_document; |
137 | 140 |
138 // m_style is the primary output for each element's style resolve. | 141 // m_style is the primary output for each element's style resolve. |
139 RefPtr<RenderStyle> m_style; | 142 RefPtr<RenderStyle> m_style; |
140 | 143 |
| 144 CSSToLengthConversionData m_cssToLengthConversionData; |
| 145 |
141 // m_parentStyle is not always just element->parentNode()->style() | 146 // m_parentStyle is not always just element->parentNode()->style() |
142 // so we keep it separate from m_elementContext. | 147 // so we keep it separate from m_elementContext. |
143 RefPtr<RenderStyle> m_parentStyle; | 148 RefPtr<RenderStyle> m_parentStyle; |
144 | 149 |
145 OwnPtr<CSSAnimationUpdate> m_animationUpdate; | 150 OwnPtr<CSSAnimationUpdate> m_animationUpdate; |
146 | 151 |
147 // Required to ASSERT in applyProperties. | 152 // Required to ASSERT in applyProperties. |
148 // FIXME: Regions should not need special state on StyleResolverState | 153 // FIXME: Regions should not need special state on StyleResolverState |
149 // no other @rule does. | 154 // no other @rule does. |
150 RenderRegion* m_regionForStyling; | 155 RenderRegion* m_regionForStyling; |
(...skipping 12 matching lines...) Expand all Loading... |
163 // a back-pointer to this object. | 168 // a back-pointer to this object. |
164 CSSToStyleMap m_styleMap; | 169 CSSToStyleMap m_styleMap; |
165 Vector<AtomicString> m_contentAttrValues; | 170 Vector<AtomicString> m_contentAttrValues; |
166 | 171 |
167 StyleRule* m_currentRule; | 172 StyleRule* m_currentRule; |
168 }; | 173 }; |
169 | 174 |
170 } // namespace WebCore | 175 } // namespace WebCore |
171 | 176 |
172 #endif // StyleResolverState_h | 177 #endif // StyleResolverState_h |
OLD | NEW |