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 20 matching lines...) Expand all Loading... |
31 #include "core/css/resolver/FontBuilder.h" | 31 #include "core/css/resolver/FontBuilder.h" |
32 #include "core/dom/Element.h" | 32 #include "core/dom/Element.h" |
33 #include "core/rendering/style/CachedUAStyle.h" | 33 #include "core/rendering/style/CachedUAStyle.h" |
34 #include "core/rendering/style/RenderStyle.h" | 34 #include "core/rendering/style/RenderStyle.h" |
35 #include "core/rendering/style/StyleInheritedData.h" | 35 #include "core/rendering/style/StyleInheritedData.h" |
36 | 36 |
37 namespace WebCore { | 37 namespace WebCore { |
38 | 38 |
39 class FontDescription; | 39 class FontDescription; |
40 class RenderRegion; | 40 class RenderRegion; |
| 41 class StyleRule; |
41 | 42 |
42 class StyleResolverState { | 43 class StyleResolverState { |
43 WTF_MAKE_NONCOPYABLE(StyleResolverState); | 44 WTF_MAKE_NONCOPYABLE(StyleResolverState); |
44 public: | 45 public: |
45 StyleResolverState(Document*, Element*, RenderStyle* parentStyle = 0, Render
Region* regionForStyling = 0); | 46 StyleResolverState(Document*, Element*, RenderStyle* parentStyle = 0, Render
Region* regionForStyling = 0); |
46 ~StyleResolverState(); | 47 ~StyleResolverState(); |
47 | 48 |
48 // In FontLoader and CanvasRenderingContext2D, we don't have an element to g
rab the document from. | 49 // In FontLoader and CanvasRenderingContext2D, we don't have an element to g
rab the document from. |
49 // This is why we have to store the document separately. | 50 // This is why we have to store the document separately. |
50 Document* document() const { return m_document; } | 51 Document* document() const { return m_document; } |
(...skipping 10 matching lines...) Expand all Loading... |
61 const RenderStyle* style() const { return m_style.get(); } | 62 const RenderStyle* style() const { return m_style.get(); } |
62 RenderStyle* style() { return m_style.get(); } | 63 RenderStyle* style() { return m_style.get(); } |
63 PassRefPtr<RenderStyle> takeStyle() { return m_style.release(); } | 64 PassRefPtr<RenderStyle> takeStyle() { return m_style.release(); } |
64 | 65 |
65 void setParentStyle(PassRefPtr<RenderStyle> parentStyle) { m_parentStyle = p
arentStyle; } | 66 void setParentStyle(PassRefPtr<RenderStyle> parentStyle) { m_parentStyle = p
arentStyle; } |
66 const RenderStyle* parentStyle() const { return m_parentStyle.get(); } | 67 const RenderStyle* parentStyle() const { return m_parentStyle.get(); } |
67 RenderStyle* parentStyle() { return m_parentStyle.get(); } | 68 RenderStyle* parentStyle() { return m_parentStyle.get(); } |
68 | 69 |
69 const RenderRegion* regionForStyling() const { return m_regionForStyling; } | 70 const RenderRegion* regionForStyling() const { return m_regionForStyling; } |
70 | 71 |
| 72 void setCurrentRule(StyleRule* currentRule) { m_currentRule = currentRule; } |
| 73 const StyleRule* currentRule() const { return m_currentRule; } |
| 74 |
71 // FIXME: These are effectively side-channel "out parameters" for the variou
s | 75 // FIXME: These are effectively side-channel "out parameters" for the variou
s |
72 // map functions. When we map from CSS to style objects we use this state ob
ject | 76 // map functions. When we map from CSS to style objects we use this state ob
ject |
73 // to track various meta-data about that mapping (e.g. if it's cache-able). | 77 // to track various meta-data about that mapping (e.g. if it's cache-able). |
74 // We need to move this data off of StyleResolverState and closer to the | 78 // We need to move this data off of StyleResolverState and closer to the |
75 // objects it applies to. Possibly separating (immutable) inputs from (mutab
le) outputs. | 79 // objects it applies to. Possibly separating (immutable) inputs from (mutab
le) outputs. |
76 void setApplyPropertyToRegularStyle(bool isApply) { m_applyPropertyToRegular
Style = isApply; } | 80 void setApplyPropertyToRegularStyle(bool isApply) { m_applyPropertyToRegular
Style = isApply; } |
77 void setApplyPropertyToVisitedLinkStyle(bool isApply) { m_applyPropertyToVis
itedLinkStyle = isApply; } | 81 void setApplyPropertyToVisitedLinkStyle(bool isApply) { m_applyPropertyToVis
itedLinkStyle = isApply; } |
78 bool applyPropertyToRegularStyle() const { return m_applyPropertyToRegularSt
yle; } | 82 bool applyPropertyToRegularStyle() const { return m_applyPropertyToRegularSt
yle; } |
79 bool applyPropertyToVisitedLinkStyle() const { return m_applyPropertyToVisit
edLinkStyle; } | 83 bool applyPropertyToVisitedLinkStyle() const { return m_applyPropertyToVisit
edLinkStyle; } |
80 | 84 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 152 |
149 FontBuilder m_fontBuilder; | 153 FontBuilder m_fontBuilder; |
150 | 154 |
151 CachedUAStyle m_cachedUAStyle; | 155 CachedUAStyle m_cachedUAStyle; |
152 | 156 |
153 ElementStyleResources m_elementStyleResources; | 157 ElementStyleResources m_elementStyleResources; |
154 // CSSToStyleMap is a pure-logic class and only contains | 158 // CSSToStyleMap is a pure-logic class and only contains |
155 // a back-pointer to this object. | 159 // a back-pointer to this object. |
156 CSSToStyleMap m_styleMap; | 160 CSSToStyleMap m_styleMap; |
157 Vector<AtomicString> m_contentAttrValues; | 161 Vector<AtomicString> m_contentAttrValues; |
| 162 |
| 163 StyleRule* m_currentRule; |
158 }; | 164 }; |
159 | 165 |
160 } // namespace WebCore | 166 } // namespace WebCore |
161 | 167 |
162 #endif // StyleResolverState_h | 168 #endif // StyleResolverState_h |
OLD | NEW |