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

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

Issue 581663003: Remove more stuff from applyAuthorStyles. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 | 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 KeyframesRuleMap::iterator it = m_keyframesRuleMap.find(rule->name().imp l()); 114 KeyframesRuleMap::iterator it = m_keyframesRuleMap.find(rule->name().imp l());
115 if (it == m_keyframesRuleMap.end()) 115 if (it == m_keyframesRuleMap.end())
116 m_keyframesRuleMap.set(s.impl(), rule); 116 m_keyframesRuleMap.set(s.impl(), rule);
117 else if (it->value->isVendorPrefixed()) 117 else if (it->value->isVendorPrefixed())
118 m_keyframesRuleMap.set(s.impl(), rule); 118 m_keyframesRuleMap.set(s.impl(), rule);
119 } else { 119 } else {
120 m_keyframesRuleMap.set(s.impl(), rule); 120 m_keyframesRuleMap.set(s.impl(), rule);
121 } 121 }
122 } 122 }
123 123
124 void ScopedStyleResolver::collectMatchingAuthorRules(ElementRuleCollector& colle ctor, bool includeEmptyRules, bool applyAuthorStyles, CascadeScope cascadeScope, CascadeOrder cascadeOrder) 124 void ScopedStyleResolver::collectMatchingAuthorRules(ElementRuleCollector& colle ctor, bool includeEmptyRules, CascadeScope cascadeScope, CascadeOrder cascadeOrd er)
125 { 125 {
126 unsigned contextFlags = SelectorChecker::DefaultBehavior; 126 unsigned contextFlags = SelectorChecker::DefaultBehavior;
127 127
128 if (!applyAuthorStyles) 128 // FIXME: This is always true now.
129 contextFlags |= SelectorChecker::ScopeContainsLastMatchedElement; 129 contextFlags |= SelectorChecker::ScopeContainsLastMatchedElement;
130 130
131 RuleRange ruleRange = collector.matchedResult().ranges.authorRuleRange(); 131 RuleRange ruleRange = collector.matchedResult().ranges.authorRuleRange();
132 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) { 132 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) {
133 MatchRequest matchRequest(&m_authorStyleSheets[i]->contents()->ruleSet() , includeEmptyRules, &m_scope->rootNode(), m_authorStyleSheets[i], applyAuthorSt yles, i); 133 MatchRequest matchRequest(&m_authorStyleSheets[i]->contents()->ruleSet() , includeEmptyRules, &m_scope->rootNode(), m_authorStyleSheets[i], i);
134 collector.collectMatchingRules(matchRequest, ruleRange, static_cast<Sele ctorChecker::ContextFlags>(contextFlags), cascadeScope, cascadeOrder); 134 collector.collectMatchingRules(matchRequest, ruleRange, static_cast<Sele ctorChecker::ContextFlags>(contextFlags), cascadeScope, cascadeOrder);
135 } 135 }
136 } 136 }
137 137
138 void ScopedStyleResolver::matchPageRules(PageRuleCollector& collector) 138 void ScopedStyleResolver::matchPageRules(PageRuleCollector& collector)
139 { 139 {
140 // Only consider the global author RuleSet for @page rules, as per the HTML5 spec. 140 // Only consider the global author RuleSet for @page rules, as per the HTML5 spec.
141 ASSERT(m_scope->rootNode().isDocumentNode()); 141 ASSERT(m_scope->rootNode().isDocumentNode());
142 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) 142 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i)
143 collector.matchPageRules(&m_authorStyleSheets[i]->contents()->ruleSet()) ; 143 collector.matchPageRules(&m_authorStyleSheets[i]->contents()->ruleSet()) ;
(...skipping 10 matching lines...) Expand all
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
« no previous file with comments | « Source/core/css/resolver/ScopedStyleResolver.h ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698