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

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

Issue 799143002: Remove single client special cases for StyleSheetContents. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 AddRuleFlags addRuleFlags = RuleHasNoSpecialState; 48 AddRuleFlags addRuleFlags = RuleHasNoSpecialState;
49 const RuleSet& ruleSet = sheet->ensureRuleSet(medium, addRuleFlags); 49 const RuleSet& ruleSet = sheet->ensureRuleSet(medium, addRuleFlags);
50 resolver->addMediaQueryResults(ruleSet.viewportDependentMediaQueryResults()) ; 50 resolver->addMediaQueryResults(ruleSet.viewportDependentMediaQueryResults()) ;
51 resolver->processScopedRules(ruleSet, cssSheet, index, treeScope().rootNode( )); 51 resolver->processScopedRules(ruleSet, cssSheet, index, treeScope().rootNode( ));
52 } 52 }
53 53
54 void ScopedStyleResolver::collectFeaturesTo(RuleFeatureSet& features, HashSet<co nst StyleSheetContents*>& visitedSharedStyleSheetContents) const 54 void ScopedStyleResolver::collectFeaturesTo(RuleFeatureSet& features, HashSet<co nst StyleSheetContents*>& visitedSharedStyleSheetContents) const
55 { 55 {
56 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) { 56 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) {
57 StyleSheetContents* contents = m_authorStyleSheets[i]->contents(); 57 StyleSheetContents* contents = m_authorStyleSheets[i]->contents();
58 if (contents->hasOneClient() || visitedSharedStyleSheetContents.add(cont ents).isNewEntry) 58 if (visitedSharedStyleSheetContents.add(contents).isNewEntry)
59 features.add(contents->ruleSet().features()); 59 features.add(contents->ruleSet().features());
60 } 60 }
61 } 61 }
62 62
63 void ScopedStyleResolver::resetAuthorStyle() 63 void ScopedStyleResolver::resetAuthorStyle()
64 { 64 {
65 m_authorStyleSheets.clear(); 65 m_authorStyleSheets.clear();
66 m_keyframesRuleMap.clear(); 66 m_keyframesRuleMap.clear();
67 } 67 }
68 68
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 contextFlags |= SelectorChecker::ScopeContainsLastMatchedElement; 100 contextFlags |= SelectorChecker::ScopeContainsLastMatchedElement;
101 101
102 RuleRange ruleRange = collector.matchedResult().ranges.authorRuleRange(); 102 RuleRange ruleRange = collector.matchedResult().ranges.authorRuleRange();
103 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) { 103 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) {
104 MatchRequest matchRequest(&m_authorStyleSheets[i]->contents()->ruleSet() , includeEmptyRules, &m_scope->rootNode(), m_authorStyleSheets[i], applyAuthorSt yles, i); 104 MatchRequest matchRequest(&m_authorStyleSheets[i]->contents()->ruleSet() , includeEmptyRules, &m_scope->rootNode(), m_authorStyleSheets[i], applyAuthorSt yles, i);
105 collector.collectMatchingRules(matchRequest, ruleRange, static_cast<Sele ctorChecker::ContextFlags>(contextFlags), cascadeScope, cascadeOrder); 105 collector.collectMatchingRules(matchRequest, ruleRange, static_cast<Sele ctorChecker::ContextFlags>(contextFlags), cascadeScope, cascadeOrder);
106 } 106 }
107 } 107 }
108 108
109 } // namespace blink 109 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698