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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 PseudoId ignoreDynamicPseudo = NOPSEUDO; | 549 PseudoId ignoreDynamicPseudo = NOPSEUDO; |
550 for (subContext.selector = selector->selectorList()->first(); su
bContext.selector; subContext.selector = CSSSelectorList::next(subContext.select
or)) { | 550 for (subContext.selector = selector->selectorList()->first(); su
bContext.selector; subContext.selector = CSSSelectorList::next(subContext.select
or)) { |
551 if (match(subContext, ignoreDynamicPseudo, siblingTraversalS
trategy) == SelectorMatches) | 551 if (match(subContext, ignoreDynamicPseudo, siblingTraversalS
trategy) == SelectorMatches) |
552 return true; | 552 return true; |
553 } | 553 } |
554 } | 554 } |
555 break; | 555 break; |
556 case CSSSelector::PseudoAutofill: | 556 case CSSSelector::PseudoAutofill: |
557 if (!element || !element->isFormControlElement()) | 557 if (!element || !element->isFormControlElement()) |
558 break; | 558 break; |
559 if (HTMLInputElement* inputElement = element->toInputElement()) | 559 if (Handle<HTMLInputElement> inputElement = element->toInputElement(
)) |
560 return inputElement->isAutofilled(); | 560 return inputElement->isAutofilled(); |
561 break; | 561 break; |
562 case CSSSelector::PseudoAnyLink: | 562 case CSSSelector::PseudoAnyLink: |
563 case CSSSelector::PseudoLink: | 563 case CSSSelector::PseudoLink: |
564 // :visited and :link matches are separated later when applying the
style. Here both classes match all links... | 564 // :visited and :link matches are separated later when applying the
style. Here both classes match all links... |
565 return element->isLink(); | 565 return element->isLink(); |
566 case CSSSelector::PseudoVisited: | 566 case CSSSelector::PseudoVisited: |
567 // ...except if :visited matching is disabled for ancestor/sibling m
atching. | 567 // ...except if :visited matching is disabled for ancestor/sibling m
atching. |
568 return element->isLink() && context.visitedMatchType == VisitedMatch
Enabled; | 568 return element->isLink() && context.visitedMatchType == VisitedMatch
Enabled; |
569 case CSSSelector::PseudoDrag: | 569 case CSSSelector::PseudoDrag: |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 return false; | 637 return false; |
638 element->document()->setContainsValidityStyleRules(); | 638 element->document()->setContainsValidityStyleRules(); |
639 return element->willValidate() && !element->isValidFormControlElemen
t(); | 639 return element->willValidate() && !element->isValidFormControlElemen
t(); |
640 case CSSSelector::PseudoChecked: | 640 case CSSSelector::PseudoChecked: |
641 { | 641 { |
642 if (!element) | 642 if (!element) |
643 break; | 643 break; |
644 // Even though WinIE allows checked and indeterminate to co-exis
t, the CSS selector spec says that | 644 // Even though WinIE allows checked and indeterminate to co-exis
t, the CSS selector spec says that |
645 // you can't be both checked and indeterminate. We will behave l
ike WinIE behind the scenes and just | 645 // you can't be both checked and indeterminate. We will behave l
ike WinIE behind the scenes and just |
646 // obey the CSS spec here in the test for matching the pseudo. | 646 // obey the CSS spec here in the test for matching the pseudo. |
647 HTMLInputElement* inputElement = element->toInputElement(); | 647 Handle<HTMLInputElement> inputElement = element->toInputElement(
); |
648 if (inputElement && inputElement->shouldAppearChecked() && !inpu
tElement->shouldAppearIndeterminate()) | 648 if (inputElement && inputElement->shouldAppearChecked() && !inpu
tElement->shouldAppearIndeterminate()) |
649 return true; | 649 return true; |
650 if (element->hasTagName(optionTag) && toHTMLOptionElement(elemen
t)->selected()) | 650 if (element->hasTagName(optionTag) && toHTMLOptionElement(elemen
t)->selected()) |
651 return true; | 651 return true; |
652 break; | 652 break; |
653 } | 653 } |
654 case CSSSelector::PseudoIndeterminate: | 654 case CSSSelector::PseudoIndeterminate: |
655 return element && element->shouldAppearIndeterminate(); | 655 return element && element->shouldAppearIndeterminate(); |
656 case CSSSelector::PseudoRoot: | 656 case CSSSelector::PseudoRoot: |
657 if (element == element->document()->documentElement()) | 657 if (element == element->document()->documentElement()) |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
894 return element->focused() && isFrameFocused(element); | 894 return element->focused() && isFrameFocused(element); |
895 } | 895 } |
896 | 896 |
897 template | 897 template |
898 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, Ps
eudoId&, const DOMSiblingTraversalStrategy&) const; | 898 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, Ps
eudoId&, const DOMSiblingTraversalStrategy&) const; |
899 | 899 |
900 template | 900 template |
901 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, Ps
eudoId&, const ShadowDOMSiblingTraversalStrategy&) const; | 901 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, Ps
eudoId&, const ShadowDOMSiblingTraversalStrategy&) const; |
902 | 902 |
903 } | 903 } |
OLD | NEW |