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

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

Issue 800483006: Remove CascadeScope. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « sky/engine/core/css/resolver/ScopedStyleResolver.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 222
223 StyleResolver::~StyleResolver() 223 StyleResolver::~StyleResolver()
224 { 224 {
225 } 225 }
226 226
227 void StyleResolver::matchAuthorRules(Element* element, ElementRuleCollector& col lector) 227 void StyleResolver::matchAuthorRules(Element* element, ElementRuleCollector& col lector)
228 { 228 {
229 collector.clearMatchedRules(); 229 collector.clearMatchedRules();
230 collector.matchedResult().ranges.lastAuthorRule = collector.matchedResult(). matchedProperties.size() - 1; 230 collector.matchedResult().ranges.lastAuthorRule = collector.matchedResult(). matchedProperties.size() - 1;
231 231
232 // TODO(esprehn): Eliminate CascadeScope and CascadeOrder. 232 // TODO(esprehn): Eliminate CascadeOrder.
233 CascadeScope cascadeScope = 0;
234 CascadeOrder cascadeOrder = 0; 233 CascadeOrder cascadeOrder = 0;
235 234
236 // TODO(esprehn): This can only match :host rules, we should just store 235 // TODO(esprehn): This can only match :host rules, we should just store
237 // them in a separate RuleSet. 236 // them in a separate RuleSet.
238 if (ShadowRoot* shadowRoot = element->shadowRoot()) 237 if (ShadowRoot* shadowRoot = element->shadowRoot())
239 shadowRoot->scopedStyleResolver().collectMatchingAuthorRules(collector, cascadeScope, cascadeOrder++); 238 shadowRoot->scopedStyleResolver().collectMatchingAuthorRules(collector, cascadeOrder++);
240 239
241 ScopedStyleResolver& resolver = element->treeScope().scopedStyleResolver(); 240 ScopedStyleResolver& resolver = element->treeScope().scopedStyleResolver();
242 resolver.collectMatchingAuthorRules(collector, cascadeScope, cascadeOrder); 241 resolver.collectMatchingAuthorRules(collector, cascadeOrder);
243 242
244 collector.sortAndTransferMatchedRules(); 243 collector.sortAndTransferMatchedRules();
245 } 244 }
246 245
247 void StyleResolver::matchUARules(ElementRuleCollector& collector) 246 void StyleResolver::matchUARules(ElementRuleCollector& collector)
248 { 247 {
249 collector.setMatchingUARules(true); 248 collector.setMatchingUARules(true);
250 249
251 collector.clearMatchedRules(); 250 collector.clearMatchedRules();
252 collector.matchedResult().ranges.lastUARule = collector.matchedResult().matc hedProperties.size() - 1; 251 collector.matchedResult().ranges.lastUARule = collector.matchedResult().matc hedProperties.size() - 1;
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 bool StyleResolver::mediaQueryAffectedByViewportChange() const 784 bool StyleResolver::mediaQueryAffectedByViewportChange() const
786 { 785 {
787 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) { 786 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) {
788 if (m_medium->eval(m_viewportDependentMediaQueryResults[i]->expression() ) != m_viewportDependentMediaQueryResults[i]->result()) 787 if (m_medium->eval(m_viewportDependentMediaQueryResults[i]->expression() ) != m_viewportDependentMediaQueryResults[i]->result())
789 return true; 788 return true;
790 } 789 }
791 return false; 790 return false;
792 } 791 }
793 792
794 } // namespace blink 793 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/css/resolver/ScopedStyleResolver.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698