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

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

Issue 5216392399814656: Clear StyleResolverState after each resolve. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: You people refactor too quickly. (Sync ;) 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 return m_styleTree.ensureScopedStyleResolver(scope ? scope : document()) ; 223 return m_styleTree.ensureScopedStyleResolver(scope ? scope : document()) ;
224 } 224 }
225 225
226 private: 226 private:
227 RenderStyle* locateSharedStyle(); 227 RenderStyle* locateSharedStyle();
228 bool styleSharingCandidateMatchesRuleSet(RuleSet*); 228 bool styleSharingCandidateMatchesRuleSet(RuleSet*);
229 Node* locateCousinList(Element* parent, unsigned& visitedNodeCount) const; 229 Node* locateCousinList(Element* parent, unsigned& visitedNodeCount) const;
230 Element* findSiblingForStyleSharing(Node*, unsigned& count) const; 230 Element* findSiblingForStyleSharing(Node*, unsigned& count) const;
231 bool canShareStyleWithElement(Element*) const; 231 bool canShareStyleWithElement(Element*) const;
232 232
233 PassRefPtr<RenderStyle> styleForKeyframe(const RenderStyle*, const StyleKeyf rame*, KeyframeValue&); 233 PassRefPtr<RenderStyle> styleForKeyframe(Element*, const RenderStyle*, const StyleKeyframe*, KeyframeValue&);
234 234
235 public: 235 public:
236 // These methods will give back the set of rules that matched for a given el ement (or a pseudo-element). 236 // These methods will give back the set of rules that matched for a given el ement (or a pseudo-element).
237 enum CSSRuleFilter { 237 enum CSSRuleFilter {
238 UAAndUserCSSRules = 1 << 1, 238 UAAndUserCSSRules = 1 << 1,
239 AuthorCSSRules = 1 << 2, 239 AuthorCSSRules = 1 << 2,
240 EmptyCSSRules = 1 << 3, 240 EmptyCSSRules = 1 << 3,
241 CrossOriginCSSRules = 1 << 4, 241 CrossOriginCSSRules = 1 << 4,
242 AllButEmptyCSSRules = UAAndUserCSSRules | AuthorCSSRules | CrossOriginCS SRules, 242 AllButEmptyCSSRules = UAAndUserCSSRules | AuthorCSSRules | CrossOriginCS SRules,
243 AllCSSRules = AllButEmptyCSSRules | EmptyCSSRules, 243 AllCSSRules = AllButEmptyCSSRules | EmptyCSSRules,
244 }; 244 };
245 PassRefPtr<CSSRuleList> styleRulesForElement(Element*, unsigned rulesToInclu de = AllButEmptyCSSRules); 245 PassRefPtr<CSSRuleList> styleRulesForElement(Element*, unsigned rulesToInclu de = AllButEmptyCSSRules);
246 PassRefPtr<CSSRuleList> pseudoStyleRulesForElement(Element*, PseudoId, unsig ned rulesToInclude = AllButEmptyCSSRules); 246 PassRefPtr<CSSRuleList> pseudoStyleRulesForElement(Element*, PseudoId, unsig ned rulesToInclude = AllButEmptyCSSRules);
247 247
248 public: 248 public:
249 void applyPropertyToStyle(CSSPropertyID, CSSValue*, RenderStyle*); 249 struct PropertyValue {
dglazkov 2013/07/12 16:45:47 Does this have to be nested? I just tried to un-ne
Jeffrey Yasskin 2013/07/12 19:41:28 Doesn't need to be, although the name should be mo
250 250 PropertyValue(CSSPropertyID property, CSSValue* value)
251 void applyPropertyToCurrentStyle(CSSPropertyID, CSSValue*); 251 : property(property), value(value) { }
252 // Stores value=propertySet.getPropertyCSSValue(id).get().
253 PropertyValue(CSSPropertyID, const StylePropertySet&);
254 CSSPropertyID property;
255 CSSValue* value;
256 };
257 // |properties| is an array with |count| elements.
258 void applyPropertiesToStyle(const PropertyValue* properties, size_t count, R enderStyle*);
252 259
253 void updateFont(); 260 void updateFont();
254 void initializeFontStyle(Settings*); 261 void initializeFontStyle(Settings*);
255 void setFontSize(FontDescription&, float size); 262 void setFontSize(FontDescription&, float size);
256 263
257 public: 264 public:
258 bool hasSelectorForId(const AtomicString&) const; 265 bool hasSelectorForId(const AtomicString&) const;
259 bool hasSelectorForClass(const AtomicString&) const; 266 bool hasSelectorForClass(const AtomicString&) const;
260 bool hasSelectorForAttribute(const AtomicString&) const; 267 bool hasSelectorForAttribute(const AtomicString&) const;
261 268
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 PseudoId ignoreDynamicPseudo = NOPSEUDO; 419 PseudoId ignoreDynamicPseudo = NOPSEUDO;
413 if (selectorChecker.match(selectorCheckingContext, ignoreDynamicPseudo, DOMSiblingTraversalStrategy()) == SelectorChecker::SelectorMatches) 420 if (selectorChecker.match(selectorCheckingContext, ignoreDynamicPseudo, DOMSiblingTraversalStrategy()) == SelectorChecker::SelectorMatches)
414 return true; 421 return true;
415 } 422 }
416 return false; 423 return false;
417 } 424 }
418 425
419 } // namespace WebCore 426 } // namespace WebCore
420 427
421 #endif // StyleResolver_h 428 #endif // StyleResolver_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698