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

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

Issue 838313002: Move StyleResolver code out of ScopedStyleResolver. (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
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 * Copyright (C) 2012 Google Inc. All rights reserved. 4 * Copyright (C) 2012 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 19 matching lines...) Expand all
30 #include "sky/engine/core/css/ElementRuleCollector.h" 30 #include "sky/engine/core/css/ElementRuleCollector.h"
31 #include "sky/engine/core/css/RuleSet.h" 31 #include "sky/engine/core/css/RuleSet.h"
32 #include "sky/engine/core/dom/TreeScope.h" 32 #include "sky/engine/core/dom/TreeScope.h"
33 #include "sky/engine/wtf/HashMap.h" 33 #include "sky/engine/wtf/HashMap.h"
34 #include "sky/engine/wtf/HashSet.h" 34 #include "sky/engine/wtf/HashSet.h"
35 #include "sky/engine/wtf/OwnPtr.h" 35 #include "sky/engine/wtf/OwnPtr.h"
36 #include "sky/engine/wtf/PassOwnPtr.h" 36 #include "sky/engine/wtf/PassOwnPtr.h"
37 37
38 namespace blink { 38 namespace blink {
39 39
40 class StyleResolver;
41 class StyleSheetContents; 40 class StyleSheetContents;
42 class RuleFeatureSet; 41 class RuleFeatureSet;
43 42
44 // This class selects a RenderStyle for a given element based on a collection of stylesheets. 43 // This class selects a RenderStyle for a given element based on a collection of stylesheets.
45 class ScopedStyleResolver final { 44 class ScopedStyleResolver final {
46 WTF_MAKE_NONCOPYABLE(ScopedStyleResolver); 45 WTF_MAKE_NONCOPYABLE(ScopedStyleResolver);
47 WTF_MAKE_FAST_ALLOCATED; 46 WTF_MAKE_FAST_ALLOCATED;
48 public: 47 public:
49 static PassOwnPtr<ScopedStyleResolver> create(TreeScope& scope) 48 static PassOwnPtr<ScopedStyleResolver> create(TreeScope& scope)
50 { 49 {
51 return adoptPtr(new ScopedStyleResolver(scope)); 50 return adoptPtr(new ScopedStyleResolver(scope));
52 } 51 }
53 52
54 const TreeScope& treeScope() const { return *m_scope; } 53 const TreeScope& treeScope() const { return *m_scope; }
55 54
56 public: 55 public:
57 const StyleRuleKeyframes* keyframeStylesForAnimation(String animationName); 56 const StyleRuleKeyframes* keyframeStylesForAnimation(String animationName);
58 57
59 void collectMatchingAuthorRules(ElementRuleCollector&, bool includeEmptyRule s, CascadeScope, CascadeOrder = ignoreCascadeOrder); 58 void collectMatchingAuthorRules(ElementRuleCollector&, bool includeEmptyRule s, CascadeScope, CascadeOrder = ignoreCascadeOrder);
60 void addRulesFromSheet(CSSStyleSheet*, StyleResolver*); 59 void addRulesFromSheet(CSSStyleSheet*);
61 60
62 void resetAuthorStyle(); 61 void resetAuthorStyle();
63 62
64 const RuleFeatureSet& features() const { return m_features; } 63 const RuleFeatureSet& features() const { return m_features; }
65 64
66 private: 65 private:
67 explicit ScopedStyleResolver(TreeScope&); 66 explicit ScopedStyleResolver(TreeScope&);
68 67
69 RawPtr<TreeScope> m_scope; 68 RawPtr<TreeScope> m_scope;
70 Vector<RawPtr<CSSStyleSheet> > m_authorStyleSheets; 69 Vector<RawPtr<CSSStyleSheet> > m_authorStyleSheets;
71 70
72 RuleFeatureSet m_features; 71 RuleFeatureSet m_features;
73 }; 72 };
74 73
75 } // namespace blink 74 } // namespace blink
76 75
77 #endif // SKY_ENGINE_CORE_CSS_RESOLVER_SCOPEDSTYLERESOLVER_H_ 76 #endif // SKY_ENGINE_CORE_CSS_RESOLVER_SCOPEDSTYLERESOLVER_H_
OLDNEW
« no previous file with comments | « sky/engine/core/css/StyleSheetContents.cpp ('k') | sky/engine/core/css/resolver/ScopedStyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698