OLD | NEW |
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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 static bool shouldCheckScope(const Element& element, const Node& scopingNode, bo
ol isInnerTreeScope) | 473 static bool shouldCheckScope(const Element& element, const Node& scopingNode, bo
ol isInnerTreeScope) |
474 { | 474 { |
475 if (isInnerTreeScope && element.treeScope() != scopingNode.treeScope()) { | 475 if (isInnerTreeScope && element.treeScope() != scopingNode.treeScope()) { |
476 // Check if |element| may be affected by a ::content rule in |scopingNod
e|'s style. | 476 // Check if |element| may be affected by a ::content rule in |scopingNod
e|'s style. |
477 // If |element| is a descendant of a shadow host which is ancestral to |
scopingNode|, | 477 // If |element| is a descendant of a shadow host which is ancestral to |
scopingNode|, |
478 // the |element| should be included for rule collection. | 478 // the |element| should be included for rule collection. |
479 // Skip otherwise. | 479 // Skip otherwise. |
480 const TreeScope* scope = &scopingNode.treeScope(); | 480 const TreeScope* scope = &scopingNode.treeScope(); |
481 while (scope && scope->parentTreeScope() != &element.treeScope()) | 481 while (scope && scope->parentTreeScope() != &element.treeScope()) |
482 scope = scope->parentTreeScope(); | 482 scope = scope->parentTreeScope(); |
483 Element* shadowHost = scope ? scope->rootNode().shadowHost() : nullptr; | 483 Element* shadowHost = scope ? scope->rootNode().ownerShadowHost() : null
ptr; |
484 return shadowHost && element.isDescendantOf(shadowHost); | 484 return shadowHost && element.isDescendantOf(shadowHost); |
485 } | 485 } |
486 | 486 |
487 // When |element| can be distributed to |scopingNode| via <shadow>, ::conten
t rule can match, | 487 // When |element| can be distributed to |scopingNode| via <shadow>, ::conten
t rule can match, |
488 // thus the case should be included. | 488 // thus the case should be included. |
489 if (!isInnerTreeScope && scopingNode.parentOrShadowHostNode() == element.tre
eScope().rootNode().parentOrShadowHostNode()) | 489 if (!isInnerTreeScope && scopingNode.parentOrShadowHostNode() == element.tre
eScope().rootNode().parentOrShadowHostNode()) |
490 return true; | 490 return true; |
491 | 491 |
492 // Obviously cases when ancestor scope has /deep/ or ::shadow rule should be
included. | 492 // Obviously cases when ancestor scope has /deep/ or ::shadow rule should be
included. |
493 // Skip otherwise. | 493 // Skip otherwise. |
(...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1744 visitor->trace(m_siblingRuleSet); | 1744 visitor->trace(m_siblingRuleSet); |
1745 visitor->trace(m_uncommonAttributeRuleSet); | 1745 visitor->trace(m_uncommonAttributeRuleSet); |
1746 visitor->trace(m_watchedSelectorsRules); | 1746 visitor->trace(m_watchedSelectorsRules); |
1747 visitor->trace(m_treeBoundaryCrossingScopes); | 1747 visitor->trace(m_treeBoundaryCrossingScopes); |
1748 visitor->trace(m_styleSharingLists); | 1748 visitor->trace(m_styleSharingLists); |
1749 visitor->trace(m_pendingStyleSheets); | 1749 visitor->trace(m_pendingStyleSheets); |
1750 visitor->trace(m_document); | 1750 visitor->trace(m_document); |
1751 } | 1751 } |
1752 | 1752 |
1753 } // namespace blink | 1753 } // namespace blink |
OLD | NEW |