Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: Source/core/css/resolver/StyleResolverState.h

Issue 143323014: *** DO NOT LAND *** Attempt to understand Regions complexity Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 21 matching lines...) Expand all
32 #include "core/css/resolver/FontBuilder.h" 32 #include "core/css/resolver/FontBuilder.h"
33 #include "core/dom/Element.h" 33 #include "core/dom/Element.h"
34 #include "core/rendering/style/CachedUAStyle.h" 34 #include "core/rendering/style/CachedUAStyle.h"
35 #include "core/rendering/style/RenderStyle.h" 35 #include "core/rendering/style/RenderStyle.h"
36 #include "core/rendering/style/StyleInheritedData.h" 36 #include "core/rendering/style/StyleInheritedData.h"
37 37
38 namespace WebCore { 38 namespace WebCore {
39 39
40 class CSSAnimationUpdate; 40 class CSSAnimationUpdate;
41 class FontDescription; 41 class FontDescription;
42 class RenderRegion;
43 class StyleRule; 42 class StyleRule;
44 43
45 class StyleResolverState { 44 class StyleResolverState {
46 WTF_MAKE_NONCOPYABLE(StyleResolverState); 45 WTF_MAKE_NONCOPYABLE(StyleResolverState);
47 public: 46 public:
48 StyleResolverState(Document&, Element*, RenderStyle* parentStyle = 0, Render Region* regionForStyling = 0); 47 StyleResolverState(Document&, Element*, RenderStyle* parentStyle = 0);
49 ~StyleResolverState(); 48 ~StyleResolverState();
50 49
51 // In FontFaceSet and CanvasRenderingContext2D, we don't have an element to grab the document from. 50 // In FontFaceSet and CanvasRenderingContext2D, we don't have an element to grab the document from.
52 // This is why we have to store the document separately. 51 // This is why we have to store the document separately.
53 Document& document() const { return m_document; } 52 Document& document() const { return m_document; }
54 // These are all just pass-through methods to ElementResolveContext. 53 // These are all just pass-through methods to ElementResolveContext.
55 Element* element() const { return m_elementContext.element(); } 54 Element* element() const { return m_elementContext.element(); }
56 const ContainerNode* parentNode() const { return m_elementContext.parentNode (); } 55 const ContainerNode* parentNode() const { return m_elementContext.parentNode (); }
57 const RenderStyle* rootElementStyle() const { return m_elementContext.rootEl ementStyle(); } 56 const RenderStyle* rootElementStyle() const { return m_elementContext.rootEl ementStyle(); }
58 EInsideLink elementLinkState() const { return m_elementContext.elementLinkSt ate(); } 57 EInsideLink elementLinkState() const { return m_elementContext.elementLinkSt ate(); }
59 bool distributedToInsertionPoint() const { return m_elementContext.distribut edToInsertionPoint(); } 58 bool distributedToInsertionPoint() const { return m_elementContext.distribut edToInsertionPoint(); }
60 59
61 const ElementResolveContext& elementContext() const { return m_elementContex t; } 60 const ElementResolveContext& elementContext() const { return m_elementContex t; }
62 61
63 void setStyle(PassRefPtr<RenderStyle> style) { m_style = style; m_cssToLengt hConversionData.setStyle(m_style.get()); } 62 void setStyle(PassRefPtr<RenderStyle> style) { m_style = style; m_cssToLengt hConversionData.setStyle(m_style.get()); }
64 const RenderStyle* style() const { return m_style.get(); } 63 const RenderStyle* style() const { return m_style.get(); }
65 RenderStyle* style() { return m_style.get(); } 64 RenderStyle* style() { return m_style.get(); }
66 PassRefPtr<RenderStyle> takeStyle() { return m_style.release(); } 65 PassRefPtr<RenderStyle> takeStyle() { return m_style.release(); }
67 66
68 const CSSToLengthConversionData& cssToLengthConversionData() const { return m_cssToLengthConversionData; } 67 const CSSToLengthConversionData& cssToLengthConversionData() const { return m_cssToLengthConversionData; }
69 68
70 void setAnimationUpdate(PassOwnPtr<CSSAnimationUpdate>); 69 void setAnimationUpdate(PassOwnPtr<CSSAnimationUpdate>);
71 const CSSAnimationUpdate* animationUpdate() { return m_animationUpdate.get() ; } 70 const CSSAnimationUpdate* animationUpdate() { return m_animationUpdate.get() ; }
72 PassOwnPtr<CSSAnimationUpdate> takeAnimationUpdate(); 71 PassOwnPtr<CSSAnimationUpdate> takeAnimationUpdate();
73 72
74 void setParentStyle(PassRefPtr<RenderStyle> parentStyle) { m_parentStyle = p arentStyle; } 73 void setParentStyle(PassRefPtr<RenderStyle> parentStyle) { m_parentStyle = p arentStyle; }
75 const RenderStyle* parentStyle() const { return m_parentStyle.get(); } 74 const RenderStyle* parentStyle() const { return m_parentStyle.get(); }
76 RenderStyle* parentStyle() { return m_parentStyle.get(); } 75 RenderStyle* parentStyle() { return m_parentStyle.get(); }
77 76
78 const RenderRegion* regionForStyling() const { return m_regionForStyling; }
79
80 void setCurrentRule(StyleRule* currentRule) { m_currentRule = currentRule; } 77 void setCurrentRule(StyleRule* currentRule) { m_currentRule = currentRule; }
81 const StyleRule* currentRule() const { return m_currentRule; } 78 const StyleRule* currentRule() const { return m_currentRule; }
82 79
83 // FIXME: These are effectively side-channel "out parameters" for the variou s 80 // FIXME: These are effectively side-channel "out parameters" for the variou s
84 // map functions. When we map from CSS to style objects we use this state ob ject 81 // map functions. When we map from CSS to style objects we use this state ob ject
85 // to track various meta-data about that mapping (e.g. if it's cache-able). 82 // to track various meta-data about that mapping (e.g. if it's cache-able).
86 // We need to move this data off of StyleResolverState and closer to the 83 // We need to move this data off of StyleResolverState and closer to the
87 // objects it applies to. Possibly separating (immutable) inputs from (mutab le) outputs. 84 // objects it applies to. Possibly separating (immutable) inputs from (mutab le) outputs.
88 void setApplyPropertyToRegularStyle(bool isApply) { m_applyPropertyToRegular Style = isApply; } 85 void setApplyPropertyToRegularStyle(bool isApply) { m_applyPropertyToRegular Style = isApply; }
89 void setApplyPropertyToVisitedLinkStyle(bool isApply) { m_applyPropertyToVis itedLinkStyle = isApply; } 86 void setApplyPropertyToVisitedLinkStyle(bool isApply) { m_applyPropertyToVis itedLinkStyle = isApply; }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 RefPtr<RenderStyle> m_style; 140 RefPtr<RenderStyle> m_style;
144 141
145 CSSToLengthConversionData m_cssToLengthConversionData; 142 CSSToLengthConversionData m_cssToLengthConversionData;
146 143
147 // m_parentStyle is not always just element->parentNode()->style() 144 // m_parentStyle is not always just element->parentNode()->style()
148 // so we keep it separate from m_elementContext. 145 // so we keep it separate from m_elementContext.
149 RefPtr<RenderStyle> m_parentStyle; 146 RefPtr<RenderStyle> m_parentStyle;
150 147
151 OwnPtr<CSSAnimationUpdate> m_animationUpdate; 148 OwnPtr<CSSAnimationUpdate> m_animationUpdate;
152 149
153 // Required to ASSERT in applyProperties.
154 // FIXME: Regions should not need special state on StyleResolverState
155 // no other @rule does.
156 RenderRegion* m_regionForStyling;
157
158 bool m_applyPropertyToRegularStyle; 150 bool m_applyPropertyToRegularStyle;
159 bool m_applyPropertyToVisitedLinkStyle; 151 bool m_applyPropertyToVisitedLinkStyle;
160 152
161 CSSValue* m_lineHeightValue; 153 CSSValue* m_lineHeightValue;
162 154
163 FontBuilder m_fontBuilder; 155 FontBuilder m_fontBuilder;
164 156
165 CachedUAStyle m_cachedUAStyle; 157 CachedUAStyle m_cachedUAStyle;
166 158
167 ElementStyleResources m_elementStyleResources; 159 ElementStyleResources m_elementStyleResources;
168 // CSSToStyleMap is a pure-logic class and only contains 160 // CSSToStyleMap is a pure-logic class and only contains
169 // a back-pointer to this object. 161 // a back-pointer to this object.
170 CSSToStyleMap m_styleMap; 162 CSSToStyleMap m_styleMap;
171 Vector<AtomicString> m_contentAttrValues; 163 Vector<AtomicString> m_contentAttrValues;
172 164
173 StyleRule* m_currentRule; 165 StyleRule* m_currentRule;
174 }; 166 };
175 167
176 } // namespace WebCore 168 } // namespace WebCore
177 169
178 #endif // StyleResolverState_h 170 #endif // StyleResolverState_h
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleResolver.cpp ('k') | Source/core/css/resolver/StyleResolverState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698