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 26 matching lines...) Expand all Loading... |
37 namespace WebCore { | 37 namespace WebCore { |
38 | 38 |
39 class FontDescription; | 39 class FontDescription; |
40 class RenderRegion; | 40 class RenderRegion; |
41 | 41 |
42 class StyleResolverState { | 42 class StyleResolverState { |
43 WTF_MAKE_NONCOPYABLE(StyleResolverState); | 43 WTF_MAKE_NONCOPYABLE(StyleResolverState); |
44 public: | 44 public: |
45 StyleResolverState() | 45 StyleResolverState() |
46 : m_element(0) | 46 : m_element(0) |
47 , m_childIndex(0) | |
48 , m_styledElement(0) | 47 , m_styledElement(0) |
49 , m_parentNode(0) | 48 , m_parentNode(0) |
50 , m_parentStyle(0) | 49 , m_parentStyle(0) |
51 , m_rootElementStyle(0) | 50 , m_rootElementStyle(0) |
52 , m_regionForStyling(0) | 51 , m_regionForStyling(0) |
53 , m_elementLinkState(NotInsideLink) | 52 , m_elementLinkState(NotInsideLink) |
54 , m_distributedToInsertionPoint(false) | 53 , m_distributedToInsertionPoint(false) |
55 , m_elementAffectedByClassRules(false) | 54 , m_elementAffectedByClassRules(false) |
56 , m_applyPropertyToRegularStyle(true) | 55 , m_applyPropertyToRegularStyle(true) |
57 , m_applyPropertyToVisitedLinkStyle(false) | 56 , m_applyPropertyToVisitedLinkStyle(false) |
58 , m_lineHeightValue(0) | 57 , m_lineHeightValue(0) |
59 , m_fontDirty(false) | 58 , m_fontDirty(false) |
60 , m_styleMap(*this, m_elementStyleResources) | 59 , m_styleMap(*this, m_elementStyleResources) |
61 { } | 60 { } |
62 | 61 |
63 void initForStyleResolve(Document*, Element*, int childIndex = 0, RenderStyl
e* parentStyle = 0, RenderRegion* regionForStyling = 0); | 62 void initForStyleResolve(Document*, Element*, RenderStyle* parentStyle = 0,
RenderRegion* regionForStyling = 0); |
64 void clear(); | 63 void clear(); |
65 | 64 |
66 Document* document() const { return m_element->document(); } | 65 Document* document() const { return m_element->document(); } |
67 Element* element() const { return m_element; } | 66 Element* element() const { return m_element; } |
68 int childIndex() const { return m_childIndex; } | |
69 Element* styledElement() const { return m_styledElement; } | 67 Element* styledElement() const { return m_styledElement; } |
70 void setStyle(PassRefPtr<RenderStyle> style) { m_style = style; } | 68 void setStyle(PassRefPtr<RenderStyle> style) { m_style = style; } |
71 RenderStyle* style() const { return m_style.get(); } | 69 RenderStyle* style() const { return m_style.get(); } |
72 PassRefPtr<RenderStyle> takeStyle() { return m_style.release(); } | 70 PassRefPtr<RenderStyle> takeStyle() { return m_style.release(); } |
73 | 71 |
74 const ContainerNode* parentNode() const { return m_parentNode; } | 72 const ContainerNode* parentNode() const { return m_parentNode; } |
75 void setParentStyle(PassRefPtr<RenderStyle> parentStyle) { m_parentStyle = p
arentStyle; } | 73 void setParentStyle(PassRefPtr<RenderStyle> parentStyle) { m_parentStyle = p
arentStyle; } |
76 RenderStyle* parentStyle() const { return m_parentStyle.get(); } | 74 RenderStyle* parentStyle() const { return m_parentStyle.get(); } |
77 RenderStyle* rootElementStyle() const { return m_rootElementStyle; } | 75 RenderStyle* rootElementStyle() const { return m_rootElementStyle; } |
78 | 76 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // of each individual length value in the render style / tree. CSSPrimitiveV
alue::computeLength*() | 133 // of each individual length value in the render style / tree. CSSPrimitiveV
alue::computeLength*() |
136 // multiplies each resolved length with the zoom multiplier - so for SVG we
need to disable that. | 134 // multiplies each resolved length with the zoom multiplier - so for SVG we
need to disable that. |
137 // Though all CSS values that can be applied to outermost <svg> elements (wi
dth/height/border/padding...) | 135 // Though all CSS values that can be applied to outermost <svg> elements (wi
dth/height/border/padding...) |
138 // need to respect the scaling. RenderBox (the parent class of RenderSVGRoot
) grabs values like | 136 // need to respect the scaling. RenderBox (the parent class of RenderSVGRoot
) grabs values like |
139 // width/height/border/padding/... from the RenderStyle -> for SVG these val
ues would never scale, | 137 // width/height/border/padding/... from the RenderStyle -> for SVG these val
ues would never scale, |
140 // if we'd pass a 1.0 zoom factor everyhwere. So we only pass a zoom factor
of 1.0 for specific | 138 // if we'd pass a 1.0 zoom factor everyhwere. So we only pass a zoom factor
of 1.0 for specific |
141 // properties that are NOT allowed to scale within a zoomed SVG document (le
tter/word-spacing/font-size). | 139 // properties that are NOT allowed to scale within a zoomed SVG document (le
tter/word-spacing/font-size). |
142 bool useSVGZoomRules() const { return m_element && m_element->isSVGElement()
; } | 140 bool useSVGZoomRules() const { return m_element && m_element->isSVGElement()
; } |
143 | 141 |
144 private: | 142 private: |
145 void initElement(Element*, int childIndex); | 143 void initElement(Element*); |
146 | 144 |
147 Element* m_element; | 145 Element* m_element; |
148 int m_childIndex; | |
149 RefPtr<RenderStyle> m_style; | 146 RefPtr<RenderStyle> m_style; |
150 Element* m_styledElement; | 147 Element* m_styledElement; |
151 ContainerNode* m_parentNode; | 148 ContainerNode* m_parentNode; |
152 RefPtr<RenderStyle> m_parentStyle; | 149 RefPtr<RenderStyle> m_parentStyle; |
153 RenderStyle* m_rootElementStyle; | 150 RenderStyle* m_rootElementStyle; |
154 | 151 |
155 // Required to ASSERT in applyProperties. | 152 // Required to ASSERT in applyProperties. |
156 RenderRegion* m_regionForStyling; | 153 RenderRegion* m_regionForStyling; |
157 | 154 |
158 EInsideLink m_elementLinkState; | 155 EInsideLink m_elementLinkState; |
(...skipping 11 matching lines...) Expand all Loading... |
170 CachedUAStyle m_cachedUAStyle; | 167 CachedUAStyle m_cachedUAStyle; |
171 ElementStyleResources m_elementStyleResources; | 168 ElementStyleResources m_elementStyleResources; |
172 // CSSToStyleMap is a pure-logic class and only contains | 169 // CSSToStyleMap is a pure-logic class and only contains |
173 // a back-pointer to this object. | 170 // a back-pointer to this object. |
174 CSSToStyleMap m_styleMap; | 171 CSSToStyleMap m_styleMap; |
175 }; | 172 }; |
176 | 173 |
177 } // namespace WebCore | 174 } // namespace WebCore |
178 | 175 |
179 #endif // StyleResolverState_h | 176 #endif // StyleResolverState_h |
OLD | NEW |