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

Side by Side Diff: Source/core/css/StyleScopeResolver.h

Issue 13973026: remove memoryinstrumentation Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove the rest part of MemoryInstrumentation Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/StyleRuleImport.cpp ('k') | Source/core/css/StyleScopeResolver.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 * 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 bool ensureStackConsistency(ContainerNode*); 70 bool ensureStackConsistency(ContainerNode*);
71 unsigned stackSize() const { return m_stack.size(); } 71 unsigned stackSize() const { return m_stack.size(); }
72 const StackFrame& stackFrameAt(unsigned index) const { return m_stack.at(ind ex); } 72 const StackFrame& stackFrameAt(unsigned index) const { return m_stack.at(ind ex); }
73 bool matchesStyleBounds(const StackFrame& frame) const { return frame.m_auth orStyleBoundsIndex == m_stackParentBoundsIndex; } 73 bool matchesStyleBounds(const StackFrame& frame) const { return frame.m_auth orStyleBoundsIndex == m_stackParentBoundsIndex; }
74 void collectFeaturesTo(RuleFeatureSet&); 74 void collectFeaturesTo(RuleFeatureSet&);
75 75
76 void addHostRule(StyleRuleHost*, bool hasDocumentSecurityOrigin, const Conta inerNode* scope); 76 void addHostRule(StyleRuleHost*, bool hasDocumentSecurityOrigin, const Conta inerNode* scope);
77 bool styleSharingCandidateMatchesHostRules(const Element*); 77 bool styleSharingCandidateMatchesHostRules(const Element*);
78 void matchHostRules(const Element*, Vector<RuleSet*>& matchedRules); 78 void matchHostRules(const Element*, Vector<RuleSet*>& matchedRules);
79 79
80 void reportMemoryUsage(MemoryObjectInfo*) const;
81
82 private: 80 private:
83 RuleSet* ruleSetFor(const ContainerNode* scope) const; 81 RuleSet* ruleSetFor(const ContainerNode* scope) const;
84 void setupStack(const ContainerNode*); 82 void setupStack(const ContainerNode*);
85 bool stackIsConsistent(const ContainerNode* parent) const { return parent && parent == m_stackParent; } 83 bool stackIsConsistent(const ContainerNode* parent) const { return parent && parent == m_stackParent; }
86 RuleSet* ensureAtHostRuleSetFor(const ShadowRoot*); 84 RuleSet* ensureAtHostRuleSetFor(const ShadowRoot*);
87 RuleSet* atHostRuleSetFor(const ShadowRoot*) const; 85 RuleSet* atHostRuleSetFor(const ShadowRoot*) const;
88 86
89 ScopedRuleSetMap m_authorStyles; 87 ScopedRuleSetMap m_authorStyles;
90 88
91 // Vector (used as stack) that keeps track of scoping elements (i.e., elemen ts with a <style scoped> child) 89 // Vector (used as stack) that keeps track of scoping elements (i.e., elemen ts with a <style scoped> child)
(...skipping 10 matching lines...) Expand all
102 inline bool StyleScopeResolver::ensureStackConsistency(ContainerNode* parent) 100 inline bool StyleScopeResolver::ensureStackConsistency(ContainerNode* parent)
103 { 101 {
104 // Match scoped author rules by traversing the scoped element stack (rebuild it if it got inconsistent). 102 // Match scoped author rules by traversing the scoped element stack (rebuild it if it got inconsistent).
105 if (!stackIsConsistent(parent)) 103 if (!stackIsConsistent(parent))
106 setupStack(parent); 104 setupStack(parent);
107 return !m_stack.isEmpty(); 105 return !m_stack.isEmpty();
108 } 106 }
109 } // namespace WebCore 107 } // namespace WebCore
110 108
111 #endif // StyleScopeResolver_h 109 #endif // StyleScopeResolver_h
OLDNEW
« no previous file with comments | « Source/core/css/StyleRuleImport.cpp ('k') | Source/core/css/StyleScopeResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698