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

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

Issue 18371008: Add a WebDocument::watchCssSelectors(selectors) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@pinned
Patch Set: Sync Created 7 years, 2 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
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 FontDescription; 40 class FontDescription;
41 class RenderRegion; 41 class RenderRegion;
42 class StyleRule;
42 43
43 class StyleResolverState { 44 class StyleResolverState {
44 WTF_MAKE_NONCOPYABLE(StyleResolverState); 45 WTF_MAKE_NONCOPYABLE(StyleResolverState);
45 public: 46 public:
46 StyleResolverState(Document&, Element*, RenderStyle* parentStyle = 0, Render Region* regionForStyling = 0); 47 StyleResolverState(Document&, Element*, RenderStyle* parentStyle = 0, Render Region* regionForStyling = 0);
47 ~StyleResolverState(); 48 ~StyleResolverState();
48 49
49 // 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.
50 // This is why we have to store the document separately. 51 // This is why we have to store the document separately.
51 Document& document() const { return m_document; } 52 Document& document() const { return m_document; }
(...skipping 14 matching lines...) Expand all
66 void setAnimationUpdate(PassOwnPtr<CSSAnimationUpdate> update) { m_animation Update = update; } 67 void setAnimationUpdate(PassOwnPtr<CSSAnimationUpdate> update) { m_animation Update = update; }
67 const CSSAnimationUpdate* animationUpdate() { return m_animationUpdate.get() ; } 68 const CSSAnimationUpdate* animationUpdate() { return m_animationUpdate.get() ; }
68 PassOwnPtr<CSSAnimationUpdate> takeAnimationUpdate() { return m_animationUpd ate.release(); } 69 PassOwnPtr<CSSAnimationUpdate> takeAnimationUpdate() { return m_animationUpd ate.release(); }
69 70
70 void setParentStyle(PassRefPtr<RenderStyle> parentStyle) { m_parentStyle = p arentStyle; } 71 void setParentStyle(PassRefPtr<RenderStyle> parentStyle) { m_parentStyle = p arentStyle; }
71 const RenderStyle* parentStyle() const { return m_parentStyle.get(); } 72 const RenderStyle* parentStyle() const { return m_parentStyle.get(); }
72 RenderStyle* parentStyle() { return m_parentStyle.get(); } 73 RenderStyle* parentStyle() { return m_parentStyle.get(); }
73 74
74 const RenderRegion* regionForStyling() const { return m_regionForStyling; } 75 const RenderRegion* regionForStyling() const { return m_regionForStyling; }
75 76
77 void setCurrentRule(StyleRule* currentRule) { m_currentRule = currentRule; }
78 const StyleRule* currentRule() const { return m_currentRule; }
79
76 // 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
77 // 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
78 // 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).
79 // 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
80 // 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.
81 void setApplyPropertyToRegularStyle(bool isApply) { m_applyPropertyToRegular Style = isApply; } 85 void setApplyPropertyToRegularStyle(bool isApply) { m_applyPropertyToRegular Style = isApply; }
82 void setApplyPropertyToVisitedLinkStyle(bool isApply) { m_applyPropertyToVis itedLinkStyle = isApply; } 86 void setApplyPropertyToVisitedLinkStyle(bool isApply) { m_applyPropertyToVis itedLinkStyle = isApply; }
83 bool applyPropertyToRegularStyle() const { return m_applyPropertyToRegularSt yle; } 87 bool applyPropertyToRegularStyle() const { return m_applyPropertyToRegularSt yle; }
84 bool applyPropertyToVisitedLinkStyle() const { return m_applyPropertyToVisit edLinkStyle; } 88 bool applyPropertyToVisitedLinkStyle() const { return m_applyPropertyToVisit edLinkStyle; }
85 89
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 159
156 FontBuilder m_fontBuilder; 160 FontBuilder m_fontBuilder;
157 161
158 CachedUAStyle m_cachedUAStyle; 162 CachedUAStyle m_cachedUAStyle;
159 163
160 ElementStyleResources m_elementStyleResources; 164 ElementStyleResources m_elementStyleResources;
161 // CSSToStyleMap is a pure-logic class and only contains 165 // CSSToStyleMap is a pure-logic class and only contains
162 // a back-pointer to this object. 166 // a back-pointer to this object.
163 CSSToStyleMap m_styleMap; 167 CSSToStyleMap m_styleMap;
164 Vector<AtomicString> m_contentAttrValues; 168 Vector<AtomicString> m_contentAttrValues;
169
170 StyleRule* m_currentRule;
165 }; 171 };
166 172
167 } // namespace WebCore 173 } // namespace WebCore
168 174
169 #endif // StyleResolverState_h 175 #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