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

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

Issue 1803933002: Use correct cascading order for Shadow DOM v1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix enum Created 4 years, 9 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 { 157 {
158 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) { 158 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) {
159 ASSERT(m_authorStyleSheets[i]->ownerNode()); 159 ASSERT(m_authorStyleSheets[i]->ownerNode());
160 MatchRequest matchRequest(&m_authorStyleSheets[i]->contents()->ruleSet() , &m_scope->rootNode(), m_authorStyleSheets[i], i); 160 MatchRequest matchRequest(&m_authorStyleSheets[i]->contents()->ruleSet() , &m_scope->rootNode(), m_authorStyleSheets[i], i);
161 collector.collectMatchingShadowHostRules(matchRequest, cascadeOrder); 161 collector.collectMatchingShadowHostRules(matchRequest, cascadeOrder);
162 } 162 }
163 } 163 }
164 164
165 void ScopedStyleResolver::collectMatchingTreeBoundaryCrossingRules(ElementRuleCo llector& collector, CascadeOrder cascadeOrder) 165 void ScopedStyleResolver::collectMatchingTreeBoundaryCrossingRules(ElementRuleCo llector& collector, CascadeOrder cascadeOrder)
166 { 166 {
167 if (!m_treeBoundaryCrossingRuleSet)
168 return;
169
167 for (const auto& rules : *m_treeBoundaryCrossingRuleSet) { 170 for (const auto& rules : *m_treeBoundaryCrossingRuleSet) {
168 MatchRequest request(rules->m_ruleSet.get(), &treeScope().rootNode(), ru les->m_parentStyleSheet, rules->m_parentIndex); 171 MatchRequest request(rules->m_ruleSet.get(), &treeScope().rootNode(), ru les->m_parentStyleSheet, rules->m_parentIndex);
169 collector.collectMatchingRules(request, cascadeOrder, true); 172 collector.collectMatchingRules(request, cascadeOrder, true);
170 } 173 }
171 } 174 }
172 175
173 void ScopedStyleResolver::matchPageRules(PageRuleCollector& collector) 176 void ScopedStyleResolver::matchPageRules(PageRuleCollector& collector)
174 { 177 {
175 // Only consider the global author RuleSet for @page rules, as per the HTML5 spec. 178 // Only consider the global author RuleSet for @page rules, as per the HTML5 spec.
176 ASSERT(m_scope->rootNode().isDocumentNode()); 179 ASSERT(m_scope->rootNode().isDocumentNode());
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 m_treeBoundaryCrossingRuleSet->append(RuleSubSet::create(parentStyleSheet, s heetIndex, ruleSetForScope.release())); 233 m_treeBoundaryCrossingRuleSet->append(RuleSubSet::create(parentStyleSheet, s heetIndex, ruleSetForScope.release()));
231 } 234 }
232 235
233 DEFINE_TRACE(ScopedStyleResolver::RuleSubSet) 236 DEFINE_TRACE(ScopedStyleResolver::RuleSubSet)
234 { 237 {
235 visitor->trace(m_parentStyleSheet); 238 visitor->trace(m_parentStyleSheet);
236 visitor->trace(m_ruleSet); 239 visitor->trace(m_ruleSet);
237 } 240 }
238 241
239 } // namespace blink 242 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698