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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 , m_mode(mode) | 67 , m_mode(mode) |
68 { | 68 { |
69 } | 69 } |
70 | 70 |
71 static bool matchesCustomPseudoElement(const Element* element, const CSSSelector
* selector) | 71 static bool matchesCustomPseudoElement(const Element* element, const CSSSelector
* selector) |
72 { | 72 { |
73 ShadowRoot* root = element->containingShadowRoot(); | 73 ShadowRoot* root = element->containingShadowRoot(); |
74 if (!root) | 74 if (!root) |
75 return false; | 75 return false; |
76 | 76 |
77 if (selector->pseudoType() != CSSSelector::PseudoPart) { | 77 const AtomicString& pseudoId = selector->pseudoType() == CSSSelector::Pseudo
WebKitCustomElement ? element->shadowPseudoId() : element->pseudo(); |
78 const AtomicString& pseudoId = selector->pseudoType() == CSSSelector::Ps
eudoWebKitCustomElement ? element->shadowPseudoId() : element->pseudo(); | 78 if (pseudoId != selector->value()) |
79 if (pseudoId != selector->value()) | |
80 return false; | |
81 if (selector->pseudoType() == CSSSelector::PseudoWebKitCustomElement &&
root->type() != ShadowRoot::UserAgentShadowRoot) | |
82 return false; | |
83 return true; | |
84 } | |
85 | |
86 if (element->part() != selector->argument()) | |
87 return false; | 79 return false; |
88 if (selector->isMatchUserAgentOnly() && root->type() != ShadowRoot::UserAgen
tShadowRoot) | 80 if (selector->pseudoType() == CSSSelector::PseudoWebKitCustomElement && root
->type() != ShadowRoot::UserAgentShadowRoot) |
89 return false; | 81 return false; |
90 return true; | 82 return true; |
91 } | 83 } |
92 | 84 |
93 Element* SelectorChecker::parentElement(const SelectorCheckingContext& context)
const | 85 Element* SelectorChecker::parentElement(const SelectorCheckingContext& context)
const |
94 { | 86 { |
95 // CrossesBoundary means we don't care any context.scope. So we can walk up
from a shadow root to its shadow host. | 87 // CrossesBoundary means we don't care any context.scope. So we can walk up
from a shadow root to its shadow host. |
96 if ((context.behaviorAtBoundary & SelectorChecker::BoundaryBehaviorMask) ==
SelectorChecker::CrossesBoundary) | 88 if ((context.behaviorAtBoundary & SelectorChecker::BoundaryBehaviorMask) ==
SelectorChecker::CrossesBoundary) |
97 return context.element->parentOrShadowHostElement(); | 89 return context.element->parentOrShadowHostElement(); |
98 | 90 |
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 return element.focused() && isFrameFocused(element); | 1001 return element.focused() && isFrameFocused(element); |
1010 } | 1002 } |
1011 | 1003 |
1012 template | 1004 template |
1013 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, Ps
eudoId&, const DOMSiblingTraversalStrategy&) const; | 1005 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, Ps
eudoId&, const DOMSiblingTraversalStrategy&) const; |
1014 | 1006 |
1015 template | 1007 template |
1016 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, Ps
eudoId&, const ShadowDOMSiblingTraversalStrategy&) const; | 1008 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, Ps
eudoId&, const ShadowDOMSiblingTraversalStrategy&) const; |
1017 | 1009 |
1018 } | 1010 } |
OLD | NEW |