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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 EInsideLink elementLinkState() const { return m_elementContext.elementLinkSt
ate(); } | 59 EInsideLink elementLinkState() const { return m_elementContext.elementLinkSt
ate(); } |
60 bool distributedToInsertionPoint() const { return m_elementContext.distribut
edToInsertionPoint(); } | 60 bool distributedToInsertionPoint() const { return m_elementContext.distribut
edToInsertionPoint(); } |
61 | 61 |
62 const ElementResolveContext& elementContext() const { return m_elementContex
t; } | 62 const ElementResolveContext& elementContext() const { return m_elementContex
t; } |
63 | 63 |
64 void setStyle(PassRefPtr<RenderStyle> style) | 64 void setStyle(PassRefPtr<RenderStyle> style) |
65 { | 65 { |
66 // FIXME: Improve RAII of StyleResolverState to remove this function. | 66 // FIXME: Improve RAII of StyleResolverState to remove this function. |
67 m_style = style; | 67 m_style = style; |
68 m_cssToLengthConversionData = CSSToLengthConversionData(m_style.get(), r
ootElementStyle(), document().renderView(), m_style->effectiveZoom()); | 68 m_cssToLengthConversionData = CSSToLengthConversionData(m_style.get(), r
ootElementStyle(), document().renderView(), m_style->effectiveZoom()); |
69 m_fontBuilder.setFontDescription(m_style->fontDescription()); | |
70 } | 69 } |
71 const RenderStyle* style() const { return m_style.get(); } | 70 const RenderStyle* style() const { return m_style.get(); } |
72 RenderStyle* style() { return m_style.get(); } | 71 RenderStyle* style() { return m_style.get(); } |
73 PassRefPtr<RenderStyle> takeStyle() { return m_style.release(); } | 72 PassRefPtr<RenderStyle> takeStyle() { return m_style.release(); } |
74 | 73 |
75 const CSSToLengthConversionData& cssToLengthConversionData() const { return
m_cssToLengthConversionData; } | 74 const CSSToLengthConversionData& cssToLengthConversionData() const { return
m_cssToLengthConversionData; } |
76 | 75 |
77 void setConversionFontSizes(const CSSToLengthConversionData::FontSizes& font
Sizes) { m_cssToLengthConversionData.setFontSizes(fontSizes); } | 76 void setConversionFontSizes(const CSSToLengthConversionData::FontSizes& font
Sizes) { m_cssToLengthConversionData.setFontSizes(fontSizes); } |
78 void setConversionZoom(float zoom) { m_cssToLengthConversionData.setZoom(zoo
m); } | 77 void setConversionZoom(float zoom) { m_cssToLengthConversionData.setZoom(zoo
m); } |
79 | 78 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 return m_elementStyleResources.styleImage(document(), document().textLin
kColors(), style()->color(), propertyId, value); | 119 return m_elementStyleResources.styleImage(document(), document().textLin
kColors(), style()->color(), propertyId, value); |
121 } | 120 } |
122 | 121 |
123 FontBuilder& fontBuilder() { return m_fontBuilder; } | 122 FontBuilder& fontBuilder() { return m_fontBuilder; } |
124 // FIXME: These exist as a primitive way to track mutations to font-related
properties | 123 // FIXME: These exist as a primitive way to track mutations to font-related
properties |
125 // on a RenderStyle. As designed, these are very error-prone, as some caller
s | 124 // on a RenderStyle. As designed, these are very error-prone, as some caller
s |
126 // set these directly on the RenderStyle w/o telling us. Presumably we'll | 125 // set these directly on the RenderStyle w/o telling us. Presumably we'll |
127 // want to design a better wrapper around RenderStyle for tracking these mut
ations | 126 // want to design a better wrapper around RenderStyle for tracking these mut
ations |
128 // and separate it from StyleResolverState. | 127 // and separate it from StyleResolverState. |
129 const FontDescription& parentFontDescription() { return m_parentStyle->fontD
escription(); } | 128 const FontDescription& parentFontDescription() { return m_parentStyle->fontD
escription(); } |
130 void setZoom(float f) { m_fontBuilder.didChangeFontParameters(m_style->setZo
om(f)); } | 129 void setZoom(float f) { m_fontBuilder.didChangeEffectiveZoom(m_style->setZoo
m(f)); } |
131 void setEffectiveZoom(float f) { m_fontBuilder.didChangeFontParameters(m_sty
le->setEffectiveZoom(f)); } | 130 void setEffectiveZoom(float f) { m_fontBuilder.didChangeEffectiveZoom(m_styl
e->setEffectiveZoom(f)); } |
132 void setWritingMode(WritingMode writingMode) { m_fontBuilder.didChangeFontPa
rameters(m_style->setWritingMode(writingMode)); } | 131 void setWritingMode(WritingMode writingMode) { m_fontBuilder.didChangeWritin
gMode(m_style->setWritingMode(writingMode)); } |
133 void setTextOrientation(TextOrientation textOrientation) { m_fontBuilder.did
ChangeFontParameters(m_style->setTextOrientation(textOrientation)); } | 132 void setTextOrientation(TextOrientation textOrientation) { m_fontBuilder.did
ChangeTextOrientation(m_style->setTextOrientation(textOrientation)); } |
134 | 133 |
135 private: | 134 private: |
136 ElementResolveContext m_elementContext; | 135 ElementResolveContext m_elementContext; |
137 RawPtrWillBeMember<Document> m_document; | 136 RawPtrWillBeMember<Document> m_document; |
138 | 137 |
139 // m_style is the primary output for each element's style resolve. | 138 // m_style is the primary output for each element's style resolve. |
140 RefPtr<RenderStyle> m_style; | 139 RefPtr<RenderStyle> m_style; |
141 | 140 |
142 CSSToLengthConversionData m_cssToLengthConversionData; | 141 CSSToLengthConversionData m_cssToLengthConversionData; |
143 | 142 |
144 // m_parentStyle is not always just ElementResolveContext::parentStyle, | 143 // m_parentStyle is not always just ElementResolveContext::parentStyle, |
145 // so we keep it separate. | 144 // so we keep it separate. |
146 RefPtr<RenderStyle> m_parentStyle; | 145 RefPtr<RenderStyle> m_parentStyle; |
147 | 146 |
148 OwnPtrWillBeMember<CSSAnimationUpdate> m_animationUpdate; | 147 OwnPtrWillBeMember<CSSAnimationUpdate> m_animationUpdate; |
149 | 148 |
150 bool m_applyPropertyToRegularStyle; | 149 bool m_applyPropertyToRegularStyle; |
151 bool m_applyPropertyToVisitedLinkStyle; | 150 bool m_applyPropertyToVisitedLinkStyle; |
152 | 151 |
153 FontBuilder m_fontBuilder; | 152 FontBuilder m_fontBuilder; |
154 | 153 |
155 OwnPtr<CachedUAStyle> m_cachedUAStyle; | 154 OwnPtr<CachedUAStyle> m_cachedUAStyle; |
156 | 155 |
157 ElementStyleResources m_elementStyleResources; | 156 ElementStyleResources m_elementStyleResources; |
158 }; | 157 }; |
159 | 158 |
160 } // namespace blink | 159 } // namespace blink |
161 | 160 |
162 #endif // StyleResolverState_h | 161 #endif // StyleResolverState_h |
OLD | NEW |