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

Side by Side Diff: Source/core/css/resolver/ScopedStyleResolver.cpp

Issue 579253002: Change StyleResolver::document() to be private (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 } 67 }
68 return 0; 68 return 0;
69 } 69 }
70 70
71 void ScopedStyleResolver::addRulesFromSheet(CSSStyleSheet* cssSheet, const Media QueryEvaluator& medium, StyleResolver* resolver) 71 void ScopedStyleResolver::addRulesFromSheet(CSSStyleSheet* cssSheet, const Media QueryEvaluator& medium, StyleResolver* resolver)
72 { 72 {
73 m_authorStyleSheets.append(cssSheet); 73 m_authorStyleSheets.append(cssSheet);
74 unsigned index = m_authorStyleSheets.size() - 1; 74 unsigned index = m_authorStyleSheets.size() - 1;
75 StyleSheetContents* sheet = cssSheet->contents(); 75 StyleSheetContents* sheet = cssSheet->contents();
76 76
77 AddRuleFlags addRuleFlags = resolver->document().securityOrigin()->canReques t(sheet->baseURL()) ? RuleHasDocumentSecurityOrigin : RuleHasNoSpecialState; 77 AddRuleFlags addRuleFlags = m_scope->document().securityOrigin()->canRequest (sheet->baseURL()) ? RuleHasDocumentSecurityOrigin : RuleHasNoSpecialState;
rune 2014/09/24 08:16:20 Why are we having StyleResolver call into ScopedSt
78 const RuleSet& ruleSet = sheet->ensureRuleSet(medium, addRuleFlags); 78 const RuleSet& ruleSet = sheet->ensureRuleSet(medium, addRuleFlags);
79 resolver->addMediaQueryResults(ruleSet.viewportDependentMediaQueryResults()) ; 79 resolver->addMediaQueryResults(ruleSet.viewportDependentMediaQueryResults()) ;
80 resolver->processScopedRules(ruleSet, cssSheet, index, treeScope().rootNode( )); 80 resolver->processScopedRules(ruleSet, cssSheet, index, treeScope().rootNode( ));
81 } 81 }
82 82
83 void ScopedStyleResolver::collectFeaturesTo(RuleFeatureSet& features, HashSet<co nst StyleSheetContents*>& visitedSharedStyleSheetContents) const 83 void ScopedStyleResolver::collectFeaturesTo(RuleFeatureSet& features, HashSet<co nst StyleSheetContents*>& visitedSharedStyleSheetContents) const
84 { 84 {
85 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) { 85 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) {
86 StyleSheetContents* contents = m_authorStyleSheets[i]->contents(); 86 StyleSheetContents* contents = m_authorStyleSheets[i]->contents();
87 if (contents->hasOneClient() || visitedSharedStyleSheetContents.add(cont ents).isNewEntry) 87 if (contents->hasOneClient() || visitedSharedStyleSheetContents.add(cont ents).isNewEntry)
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 void ScopedStyleResolver::trace(Visitor* visitor) 154 void ScopedStyleResolver::trace(Visitor* visitor)
155 { 155 {
156 #if ENABLE(OILPAN) 156 #if ENABLE(OILPAN)
157 visitor->trace(m_scope); 157 visitor->trace(m_scope);
158 visitor->trace(m_authorStyleSheets); 158 visitor->trace(m_authorStyleSheets);
159 visitor->trace(m_keyframesRuleMap); 159 visitor->trace(m_keyframesRuleMap);
160 #endif 160 #endif
161 } 161 }
162 162
163 } // namespace blink 163 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698