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

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

Issue 85693009: Get rid of Reset and ResetStyleResolverAndFontSelector. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years 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
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 resolver->addMediaQueryResults(ruleSet.viewportDependentMediaQueryResults()) ; 77 resolver->addMediaQueryResults(ruleSet.viewportDependentMediaQueryResults()) ;
78 resolver->processScopedRules(ruleSet, sheet->baseURL(), &m_scopingNode); 78 resolver->processScopedRules(ruleSet, sheet->baseURL(), &m_scopingNode);
79 } 79 }
80 80
81 void ScopedStyleResolver::collectFeaturesTo(RuleFeatureSet& features) 81 void ScopedStyleResolver::collectFeaturesTo(RuleFeatureSet& features)
82 { 82 {
83 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) 83 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i)
84 features.add(m_authorStyleSheets[i]->ruleSet().features()); 84 features.add(m_authorStyleSheets[i]->ruleSet().features());
85 } 85 }
86 86
87 void ScopedStyleResolver::resetAuthorStyle()
88 {
89 m_authorStyleSheets.clear();
90 m_keyframesRuleMap.clear();
91 }
92
93 bool ScopedStyleResolver::checkRegionStyle(Element* regionElement) 87 bool ScopedStyleResolver::checkRegionStyle(Element* regionElement)
94 { 88 {
95 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) { 89 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) {
96 const RuleSet& ruleSet = m_authorStyleSheets[i]->ruleSet(); 90 const RuleSet& ruleSet = m_authorStyleSheets[i]->ruleSet();
97 for (unsigned i = 0; i < ruleSet.m_regionSelectorsAndRuleSets.size(); ++ i) { 91 for (unsigned i = 0; i < ruleSet.m_regionSelectorsAndRuleSets.size(); ++ i) {
98 ASSERT(ruleSet.m_regionSelectorsAndRuleSets.at(i).ruleSet.get()); 92 ASSERT(ruleSet.m_regionSelectorsAndRuleSets.at(i).ruleSet.get());
99 if (checkRegionSelector(ruleSet.m_regionSelectorsAndRuleSets.at(i).s elector, regionElement)) 93 if (checkRegionSelector(ruleSet.m_regionSelectorsAndRuleSets.at(i).s elector, regionElement))
100 return true; 94 return true;
101 } 95 }
102 } 96 }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 154
161 void ScopedStyleResolver::collectViewportRulesTo(StyleResolver* resolver) const 155 void ScopedStyleResolver::collectViewportRulesTo(StyleResolver* resolver) const
162 { 156 {
163 if (!m_scopingNode.isDocumentNode()) 157 if (!m_scopingNode.isDocumentNode())
164 return; 158 return;
165 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) 159 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i)
166 resolver->viewportStyleResolver()->collectViewportRules(&m_authorStyleSh eets[i]->ruleSet(), ViewportStyleResolver::AuthorOrigin); 160 resolver->viewportStyleResolver()->collectViewportRules(&m_authorStyleSh eets[i]->ruleSet(), ViewportStyleResolver::AuthorOrigin);
167 } 161 }
168 162
169 } // namespace WebCore 163 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698