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

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

Issue 210953003: Make style independent of the presence of the <shadow> element. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/resolver/ScopedStyleTree.cpp ('k') | Source/core/dom/shadow/ShadowRoot.h » ('j') | 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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 406
407 RuleRange ruleRange = collector.matchedResult().ranges.authorRuleRange(); 407 RuleRange ruleRange = collector.matchedResult().ranges.authorRuleRange();
408 408
409 // When comparing rules declared in outer treescopes, outer's rules win. 409 // When comparing rules declared in outer treescopes, outer's rules win.
410 CascadeOrder outerCascadeOrder = m_treeBoundaryCrossingRules.size() + m_tree BoundaryCrossingRules.size(); 410 CascadeOrder outerCascadeOrder = m_treeBoundaryCrossingRules.size() + m_tree BoundaryCrossingRules.size();
411 // When comparing rules declared in inner treescopes, inner's rules win. 411 // When comparing rules declared in inner treescopes, inner's rules win.
412 CascadeOrder innerCascadeOrder = m_treeBoundaryCrossingRules.size(); 412 CascadeOrder innerCascadeOrder = m_treeBoundaryCrossingRules.size();
413 413
414 for (DocumentOrderedList::iterator it = m_treeBoundaryCrossingRules.begin(); it != m_treeBoundaryCrossingRules.end(); ++it) { 414 for (DocumentOrderedList::iterator it = m_treeBoundaryCrossingRules.begin(); it != m_treeBoundaryCrossingRules.end(); ++it) {
415 const ContainerNode* scopingNode = toContainerNode(*it); 415 const ContainerNode* scopingNode = toContainerNode(*it);
416
417 if (ShadowRoot* shadowRoot = scopingNode->containingShadowRoot()) {
418 if (!shadowRoot->isActiveForStyling())
419 continue;
420 }
421
422 RuleSet* ruleSet = m_treeBoundaryCrossingRules.ruleSetScopedBy(scopingNo de); 416 RuleSet* ruleSet = m_treeBoundaryCrossingRules.ruleSetScopedBy(scopingNo de);
423 unsigned boundaryBehavior = SelectorChecker::ScopeContainsLastMatchedEle ment; 417 unsigned boundaryBehavior = SelectorChecker::ScopeContainsLastMatchedEle ment;
424 bool isInnerTreeScope = element->treeScope().isInclusiveAncestorOf(scopi ngNode->treeScope()); 418 bool isInnerTreeScope = element->treeScope().isInclusiveAncestorOf(scopi ngNode->treeScope());
425 419
426 // If a given scoping node is a shadow root and a given element is in a descendant tree of tree hosted by 420 // If a given scoping node is a shadow root and a given element is in a descendant tree of tree hosted by
427 // the scoping node's shadow host, we should use ScopeIsShadowHost. 421 // the scoping node's shadow host, we should use ScopeIsShadowHost.
428 if (scopingNode && scopingNode->isShadowRoot()) { 422 if (scopingNode && scopingNode->isShadowRoot()) {
429 if (element->isInDescendantTreeOf(toShadowRoot(scopingNode)->host()) ) 423 if (element->isInDescendantTreeOf(toShadowRoot(scopingNode)->host()) )
430 boundaryBehavior |= SelectorChecker::ScopeIsShadowHost; 424 boundaryBehavior |= SelectorChecker::ScopeIsShadowHost;
431 scopingNode = toShadowRoot(scopingNode)->host(); 425 scopingNode = toShadowRoot(scopingNode)->host();
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after
1429 visitor->trace(m_keyframesRuleMap); 1423 visitor->trace(m_keyframesRuleMap);
1430 visitor->trace(m_viewportDependentMediaQueryResults); 1424 visitor->trace(m_viewportDependentMediaQueryResults);
1431 visitor->trace(m_viewportStyleResolver); 1425 visitor->trace(m_viewportStyleResolver);
1432 visitor->trace(m_siblingRuleSet); 1426 visitor->trace(m_siblingRuleSet);
1433 visitor->trace(m_uncommonAttributeRuleSet); 1427 visitor->trace(m_uncommonAttributeRuleSet);
1434 visitor->trace(m_watchedSelectorsRules); 1428 visitor->trace(m_watchedSelectorsRules);
1435 visitor->trace(m_treeBoundaryCrossingRules); 1429 visitor->trace(m_treeBoundaryCrossingRules);
1436 } 1430 }
1437 1431
1438 } // namespace WebCore 1432 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/resolver/ScopedStyleTree.cpp ('k') | Source/core/dom/shadow/ShadowRoot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698