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

Side by Side Diff: sky/engine/core/css/resolver/StyleResolver.h

Issue 858073003: Prune the API of StyleResolver. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | sky/engine/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 PassRefPtr<RenderStyle> styleForKeyframe(Element*, const RenderStyle&, Rende rStyle* parentStyle, const StyleKeyframe*, const AtomicString& animationName); 70 PassRefPtr<RenderStyle> styleForKeyframe(Element*, const RenderStyle&, Rende rStyle* parentStyle, const StyleKeyframe*, const AtomicString& animationName);
71 static PassRefPtr<AnimatableValue> createAnimatableValueSnapshot(Element&, C SSPropertyID, CSSValue&); 71 static PassRefPtr<AnimatableValue> createAnimatableValueSnapshot(Element&, C SSPropertyID, CSSValue&);
72 static PassRefPtr<AnimatableValue> createAnimatableValueSnapshot(StyleResolv erState&, CSSPropertyID, CSSValue&); 72 static PassRefPtr<AnimatableValue> createAnimatableValueSnapshot(StyleResolv erState&, CSSPropertyID, CSSValue&);
73 73
74 PassRefPtr<RenderStyle> defaultStyleForElement(); 74 PassRefPtr<RenderStyle> defaultStyleForElement();
75 PassRefPtr<RenderStyle> styleForText(Text*); 75 PassRefPtr<RenderStyle> styleForText(Text*);
76 76
77 static PassRefPtr<RenderStyle> styleForDocument(Document&); 77 static PassRefPtr<RenderStyle> styleForDocument(Document&);
78 78
79 // FIXME: This only has 5 callers and should be removed. Callers should be e xplicit about
80 // their dependency on Document* instead of grabbing one through StyleResolv er.
81 Document& document() { return *m_document; }
82
83 void styleTreeResolveScopedKeyframesRules(const Element*, Vector<RawPtr<Scop edStyleResolver>, 8>&); 79 void styleTreeResolveScopedKeyframesRules(const Element*, Vector<RawPtr<Scop edStyleResolver>, 8>&);
84 80
85 // |properties| is an array with |count| elements. 81 // |properties| is an array with |count| elements.
86 void applyPropertiesToStyle(const CSSPropertyValue* properties, size_t count , RenderStyle*); 82 void applyPropertiesToStyle(const CSSPropertyValue* properties, size_t count , RenderStyle*);
87 83
88 bool mediaQueryAffectedByViewportChange() const;
89
90 // FIXME: Rename to reflect the purpose, like didChangeFontSize or something . 84 // FIXME: Rename to reflect the purpose, like didChangeFontSize or something .
91 void invalidateMatchedPropertiesCache(); 85 void invalidateMatchedPropertiesCache();
92 86
93 void notifyResizeForViewportUnits(); 87 void notifyResizeForViewportUnits();
94 88
95 StyleSharingList& styleSharingList() { return m_styleSharingList; } 89 StyleSharingList& styleSharingList() { return m_styleSharingList; }
96 90
97 void addToStyleSharingList(Element&); 91 void addToStyleSharingList(Element&);
98 void clearStyleSharingList(); 92 void clearStyleSharingList();
99 93
100 StyleResolverStats* stats() { return m_styleResolverStats.get(); } 94 StyleResolverStats* stats() { return m_styleResolverStats.get(); }
101 StyleResolverStats* statsTotals() { return m_styleResolverStatsTotals.get(); } 95 StyleResolverStats* statsTotals() { return m_styleResolverStatsTotals.get(); }
102 enum StatsReportType { ReportDefaultStats, ReportSlowStats }; 96 enum StatsReportType { ReportDefaultStats, ReportSlowStats };
103 void enableStats(StatsReportType = ReportDefaultStats); 97 void enableStats(StatsReportType = ReportDefaultStats);
104 void disableStats(); 98 void disableStats();
105 void printStats(); 99 void printStats();
106 100
107 unsigned accessCount() const { return m_accessCount; }
108 void didAccess() { ++m_accessCount; }
109
110 private: 101 private:
111 // FIXME: This should probably go away, folded into FontBuilder. 102 // FIXME: This should probably go away, folded into FontBuilder.
112 void updateFont(StyleResolverState&); 103 void updateFont(StyleResolverState&);
113 104
114 void loadPendingResources(StyleResolverState&); 105 void loadPendingResources(StyleResolverState&);
115 106
116 void matchAuthorRules(Element*, ElementRuleCollector&); 107 void matchAuthorRules(Element*, ElementRuleCollector&);
117 void matchAllRules(StyleResolverState&, ElementRuleCollector&); 108 void matchAllRules(StyleResolverState&, ElementRuleCollector&);
118 void matchUARules(ElementRuleCollector&); 109 void matchUARules(ElementRuleCollector&);
119 110
(...skipping 14 matching lines...) Expand all
134 void applyMatchedProperties(StyleResolverState&, const MatchResult&, bool im portant, int startIndex, int endIndex, bool inheritedOnly); 125 void applyMatchedProperties(StyleResolverState&, const MatchResult&, bool im portant, int startIndex, int endIndex, bool inheritedOnly);
135 template <StyleApplicationPass pass> 126 template <StyleApplicationPass pass>
136 void applyProperties(StyleResolverState&, const StylePropertySet* properties , bool isImportant, bool inheritedOnly); 127 void applyProperties(StyleResolverState&, const StylePropertySet* properties , bool isImportant, bool inheritedOnly);
137 template <StyleApplicationPass pass> 128 template <StyleApplicationPass pass>
138 void applyAnimatedProperties(StyleResolverState&, const HashMap<CSSPropertyI D, RefPtr<Interpolation> >&); 129 void applyAnimatedProperties(StyleResolverState&, const HashMap<CSSPropertyI D, RefPtr<Interpolation> >&);
139 template <StyleResolver::StyleApplicationPass pass> 130 template <StyleResolver::StyleApplicationPass pass>
140 void applyAllProperty(StyleResolverState&, CSSValue*); 131 void applyAllProperty(StyleResolverState&, CSSValue*);
141 132
142 MatchedPropertiesCache m_matchedPropertiesCache; 133 MatchedPropertiesCache m_matchedPropertiesCache;
143 134
144 RawPtr<Document> m_document; 135 Document& m_document;
145 136
146 StyleSharingList m_styleSharingList; 137 StyleSharingList m_styleSharingList;
147 138
148 OwnPtr<StyleResolverStats> m_styleResolverStats; 139 OwnPtr<StyleResolverStats> m_styleResolverStats;
149 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals; 140 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals;
150 unsigned m_styleResolverStatsSequence; 141 unsigned m_styleResolverStatsSequence;
151
152 // Use only for Internals::updateStyleAndReturnAffectedElementCount.
153 unsigned m_accessCount;
154 }; 142 };
155 143
156 } // namespace blink 144 } // namespace blink
157 145
158 #endif // SKY_ENGINE_CORE_CSS_RESOLVER_STYLERESOLVER_H_ 146 #endif // SKY_ENGINE_CORE_CSS_RESOLVER_STYLERESOLVER_H_
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698