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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 nextContext.isSubSelector = false; | 283 nextContext.isSubSelector = false; |
284 nextContext.elementStyle = 0; | 284 nextContext.elementStyle = 0; |
285 for (; nextContext.element; nextContext.element = ElementTraversal::prev
iousSibling(*nextContext.element)) { | 285 for (; nextContext.element; nextContext.element = ElementTraversal::prev
iousSibling(*nextContext.element)) { |
286 Match match = this->match(nextContext, siblingTraversalStrategy, res
ult); | 286 Match match = this->match(nextContext, siblingTraversalStrategy, res
ult); |
287 if (match == SelectorMatches || match == SelectorFailsAllSiblings ||
match == SelectorFailsCompletely) | 287 if (match == SelectorMatches || match == SelectorFailsAllSiblings ||
match == SelectorFailsCompletely) |
288 return match; | 288 return match; |
289 }; | 289 }; |
290 return SelectorFailsAllSiblings; | 290 return SelectorFailsAllSiblings; |
291 | 291 |
292 case CSSSelector::ShadowPseudo: | 292 case CSSSelector::ShadowPseudo: |
293 case CSSSelector::ChildTree: | 293 case CSSSelector::ShadowAll: |
294 { | 294 { |
295 // If we're in the same tree-scope as the scoping element, then foll
owing a shadow descendant combinator would escape that and thus the scope. | 295 // If we're in the same tree-scope as the scoping element, then foll
owing a shadow descendant combinator would escape that and thus the scope. |
296 if (context.scope && context.scope->treeScope() == context.element->
treeScope() && (context.behaviorAtBoundary & BoundaryBehaviorMask) != StaysWithi
nTreeScope) | 296 if (context.scope && context.scope->treeScope() == context.element->
treeScope() && (context.behaviorAtBoundary & BoundaryBehaviorMask) != StaysWithi
nTreeScope) |
297 return SelectorFailsCompletely; | 297 return SelectorFailsCompletely; |
298 | 298 |
299 Element* shadowHost = context.element->shadowHost(); | 299 Element* shadowHost = context.element->shadowHost(); |
300 if (!shadowHost) | 300 if (!shadowHost) |
301 return SelectorFailsCompletely; | 301 return SelectorFailsCompletely; |
302 nextContext.element = shadowHost; | 302 nextContext.element = shadowHost; |
303 nextContext.isSubSelector = false; | 303 nextContext.isSubSelector = false; |
304 nextContext.elementStyle = 0; | 304 nextContext.elementStyle = 0; |
305 return this->match(nextContext, siblingTraversalStrategy, result); | 305 return this->match(nextContext, siblingTraversalStrategy, result); |
306 } | 306 } |
307 | 307 |
308 case CSSSelector::DescendantTree: | 308 case CSSSelector::ShadowDeep: |
309 { | 309 { |
310 nextContext.isSubSelector = false; | 310 nextContext.isSubSelector = false; |
311 nextContext.elementStyle = 0; | 311 nextContext.elementStyle = 0; |
312 for (nextContext.element = parentElement(context, true); nextContext
.element; nextContext.element = parentElement(nextContext, true)) { | 312 for (nextContext.element = parentElement(context, true); nextContext
.element; nextContext.element = parentElement(nextContext, true)) { |
313 Match match = this->match(nextContext, siblingTraversalStrategy,
result); | 313 Match match = this->match(nextContext, siblingTraversalStrategy,
result); |
314 if (match == SelectorMatches || match == SelectorFailsCompletely
) | 314 if (match == SelectorMatches || match == SelectorFailsCompletely
) |
315 return match; | 315 return match; |
316 if (nextSelectorExceedsScope(nextContext)) | 316 if (nextSelectorExceedsScope(nextContext)) |
317 return SelectorFailsCompletely; | 317 return SelectorFailsCompletely; |
318 } | 318 } |
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1082 return element.focused() && isFrameFocused(element); | 1082 return element.focused() && isFrameFocused(element); |
1083 } | 1083 } |
1084 | 1084 |
1085 template | 1085 template |
1086 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co
nst DOMSiblingTraversalStrategy&, MatchResult*) const; | 1086 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co
nst DOMSiblingTraversalStrategy&, MatchResult*) const; |
1087 | 1087 |
1088 template | 1088 template |
1089 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co
nst ShadowDOMSiblingTraversalStrategy&, MatchResult*) const; | 1089 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co
nst ShadowDOMSiblingTraversalStrategy&, MatchResult*) const; |
1090 | 1090 |
1091 } | 1091 } |
OLD | NEW |