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

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: Initial Created 7 years, 5 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/rendering/style/FillLayer.h" 32 #include "core/rendering/style/FillLayer.h"
33 #include "core/rendering/style/RenderStyle.h" 33 #include "core/rendering/style/RenderStyle.h"
34 #include "core/rendering/style/StyleInheritedData.h" 34 #include "core/rendering/style/StyleInheritedData.h"
35 #include "wtf/HashMap.h" 35 #include "wtf/HashMap.h"
36 36
37 namespace WebCore { 37 namespace WebCore {
38 38
39 class FillLayer; 39 class FillLayer;
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() 47 StyleResolverState()
47 : m_element(0) 48 : m_element(0)
48 , m_styledElement(0) 49 , m_styledElement(0)
49 , m_parentNode(0) 50 , m_parentNode(0)
50 , m_parentStyle(0) 51 , m_parentStyle(0)
51 , m_rootElementStyle(0) 52 , m_rootElementStyle(0)
52 , m_regionForStyling(0) 53 , m_regionForStyling(0)
53 , m_elementLinkState(NotInsideLink) 54 , m_elementLinkState(NotInsideLink)
54 , m_distributedToInsertionPoint(false) 55 , m_distributedToInsertionPoint(false)
55 , m_elementAffectedByClassRules(false) 56 , m_elementAffectedByClassRules(false)
56 , m_applyPropertyToRegularStyle(true) 57 , m_applyPropertyToRegularStyle(true)
57 , m_applyPropertyToVisitedLinkStyle(false) 58 , m_applyPropertyToVisitedLinkStyle(false)
58 , m_isMatchedPropertiesCacheable(true) 59 , m_isMatchedPropertiesCacheable(true)
59 , m_lineHeightValue(0) 60 , m_lineHeightValue(0)
60 , m_fontDirty(false) 61 , m_fontDirty(false)
61 , m_hasUAAppearance(false) 62 , m_hasUAAppearance(false)
62 , m_backgroundData(BackgroundFillLayer) { } 63 , m_backgroundData(BackgroundFillLayer)
64 #if ENABLE(CSS_CALLBACKS)
65 , m_rule(0)
66 #endif
67 { }
63 68
64 public: 69 public:
65 void initForStyleResolve(Document*, Element*, RenderStyle* parentStyle = 0, RenderRegion* regionForStyling = 0); 70 void initForStyleResolve(Document*, Element*, RenderStyle* parentStyle = 0, RenderRegion* regionForStyling = 0);
66 void clear(); 71 void clear();
67 72
68 // FIXME: This function should live on TextLinkColors (or be passed a TextLi nkColors), 73 // FIXME: This function should live on TextLinkColors (or be passed a TextLi nkColors),
69 // but it has dependencies that need to be untangled first. 74 // but it has dependencies that need to be untangled first.
70 // This method might change an internal state, i.e. m_isMatchedPropertiesCac hable. 75 // This method might change an internal state, i.e. m_isMatchedPropertiesCac hable.
71 Color resolveColorFromPrimitiveValue(CSSPrimitiveValue*, bool forVisitedLink = false); 76 Color resolveColorFromPrimitiveValue(CSSPrimitiveValue*, bool forVisitedLink = false);
72 77
73 Document* document() const { return m_element->document(); } 78 Document* document() const { return m_element->document(); }
74 Element* element() const { return m_element; } 79 Element* element() const { return m_element; }
75 Element* styledElement() const { return m_styledElement; } 80 Element* styledElement() const { return m_styledElement; }
76 void setStyle(PassRefPtr<RenderStyle> style) { m_style = style; } 81 void setStyle(PassRefPtr<RenderStyle> style) { m_style = style; }
77 RenderStyle* style() const { return m_style.get(); } 82 RenderStyle* style() const { return m_style.get(); }
78 PassRefPtr<RenderStyle> takeStyle() { return m_style.release(); } 83 PassRefPtr<RenderStyle> takeStyle() { return m_style.release(); }
84 PassRefPtr<RenderStyle> takeStyleAndClear();
79 85
80 const ContainerNode* parentNode() const { return m_parentNode; } 86 const ContainerNode* parentNode() const { return m_parentNode; }
81 void setParentStyle(PassRefPtr<RenderStyle> parentStyle) { m_parentStyle = p arentStyle; } 87 void setParentStyle(PassRefPtr<RenderStyle> parentStyle) { m_parentStyle = p arentStyle; }
82 RenderStyle* parentStyle() const { return m_parentStyle.get(); } 88 RenderStyle* parentStyle() const { return m_parentStyle.get(); }
83 RenderStyle* rootElementStyle() const { return m_rootElementStyle; } 89 RenderStyle* rootElementStyle() const { return m_rootElementStyle; }
84 90
85 const RenderRegion* regionForStyling() const { return m_regionForStyling; } 91 const RenderRegion* regionForStyling() const { return m_regionForStyling; }
86 EInsideLink elementLinkState() const { return m_elementLinkState; } 92 EInsideLink elementLinkState() const { return m_elementLinkState; }
87 bool distributedToInsertionPoint() const { return m_distributedToInsertionPo int; } 93 bool distributedToInsertionPoint() const { return m_distributedToInsertionPo int; }
88 void setElementAffectedByClassRules(bool isAffected) { m_elementAffectedByCl assRules = isAffected; } 94 void setElementAffectedByClassRules(bool isAffected) { m_elementAffectedByCl assRules = isAffected; }
89 bool elementAffectedByClassRules() const { return m_elementAffectedByClassRu les; } 95 bool elementAffectedByClassRules() const { return m_elementAffectedByClassRu les; }
90 96
97 #if ENABLE(CSS_CALLBACKS)
98 void setRule(StyleRule* rule) { m_rule = rule; }
99 const StyleRule* rule() const { return m_rule; }
100 #endif
91 void setApplyPropertyToRegularStyle(bool isApply) { m_applyPropertyToRegular Style = isApply; } 101 void setApplyPropertyToRegularStyle(bool isApply) { m_applyPropertyToRegular Style = isApply; }
92 void setApplyPropertyToVisitedLinkStyle(bool isApply) { m_applyPropertyToVis itedLinkStyle = isApply; } 102 void setApplyPropertyToVisitedLinkStyle(bool isApply) { m_applyPropertyToVis itedLinkStyle = isApply; }
93 bool applyPropertyToRegularStyle() const { return m_applyPropertyToRegularSt yle; } 103 bool applyPropertyToRegularStyle() const { return m_applyPropertyToRegularSt yle; }
94 bool applyPropertyToVisitedLinkStyle() const { return m_applyPropertyToVisit edLinkStyle; } 104 bool applyPropertyToVisitedLinkStyle() const { return m_applyPropertyToVisit edLinkStyle; }
95 bool isMatchedPropertiesCacheable() const { return m_isMatchedPropertiesCach eable; } 105 bool isMatchedPropertiesCacheable() const { return m_isMatchedPropertiesCach eable; }
96 106
97 void setLineHeightValue(CSSValue* value) { m_lineHeightValue = value; } 107 void setLineHeightValue(CSSValue* value) { m_lineHeightValue = value; }
98 CSSValue* lineHeightValue() { return m_lineHeightValue; } 108 CSSValue* lineHeightValue() { return m_lineHeightValue; }
99 void setFontDirty(bool isDirty) { m_fontDirty = isDirty; } 109 void setFontDirty(bool isDirty) { m_fontDirty = isDirty; }
100 bool fontDirty() const { return m_fontDirty; } 110 bool fontDirty() const { return m_fontDirty; }
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 bool m_isMatchedPropertiesCacheable; 158 bool m_isMatchedPropertiesCacheable;
149 159
150 CSSValue* m_lineHeightValue; 160 CSSValue* m_lineHeightValue;
151 bool m_fontDirty; 161 bool m_fontDirty;
152 162
153 bool m_hasUAAppearance; 163 bool m_hasUAAppearance;
154 BorderData m_borderData; 164 BorderData m_borderData;
155 FillLayer m_backgroundData; 165 FillLayer m_backgroundData;
156 Color m_backgroundColor; 166 Color m_backgroundColor;
157 ElementStyleResources m_elementStyleResources; 167 ElementStyleResources m_elementStyleResources;
168
169 #if ENABLE(CSS_CALLBACKS)
170 StyleRule* m_rule;
171 #endif
158 }; 172 };
159
160 } // namespace WebCore 173 } // namespace WebCore
161 174
162 #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