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 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 // :visited and :link matches are separated later when applying the
style. Here both classes match all links... | 757 // :visited and :link matches are separated later when applying the
style. Here both classes match all links... |
758 return element.isLink(); | 758 return element.isLink(); |
759 case CSSSelector::PseudoVisited: | 759 case CSSSelector::PseudoVisited: |
760 // ...except if :visited matching is disabled for ancestor/sibling m
atching. | 760 // ...except if :visited matching is disabled for ancestor/sibling m
atching. |
761 return element.isLink() && context.visitedMatchType == VisitedMatchE
nabled; | 761 return element.isLink() && context.visitedMatchType == VisitedMatchE
nabled; |
762 case CSSSelector::PseudoDrag: | 762 case CSSSelector::PseudoDrag: |
763 if (m_mode == ResolvingStyle) { | 763 if (m_mode == ResolvingStyle) { |
764 if (context.elementStyle) | 764 if (context.elementStyle) |
765 context.elementStyle->setAffectedByDrag(); | 765 context.elementStyle->setAffectedByDrag(); |
766 else | 766 else |
767 element.setChildrenAffectedByDrag(); | 767 element.setChildrenOrSiblingsAffectedByDrag(); |
768 } | 768 } |
769 if (element.renderer() && element.renderer()->isDragging()) | 769 if (element.renderer() && element.renderer()->isDragging()) |
770 return true; | 770 return true; |
771 break; | 771 break; |
772 case CSSSelector::PseudoFocus: | 772 case CSSSelector::PseudoFocus: |
773 if (m_mode == ResolvingStyle) { | 773 if (m_mode == ResolvingStyle) { |
774 if (context.elementStyle) | 774 if (context.elementStyle) |
775 context.elementStyle->setAffectedByFocus(); | 775 context.elementStyle->setAffectedByFocus(); |
776 else | 776 else |
777 element.setChildrenAffectedByFocus(); | 777 element.setChildrenOrSiblingsAffectedByFocus(); |
778 } | 778 } |
779 return matchesFocusPseudoClass(element); | 779 return matchesFocusPseudoClass(element); |
780 case CSSSelector::PseudoHover: | 780 case CSSSelector::PseudoHover: |
781 // If we're in quirks mode, then hover should never match anchors wi
th no | 781 // If we're in quirks mode, then hover should never match anchors wi
th no |
782 // href and *:hover should not match anything. This is important for
sites like wsj.com. | 782 // href and *:hover should not match anything. This is important for
sites like wsj.com. |
783 if (m_strictParsing || context.isSubSelector || (selector.m_match ==
CSSSelector::Tag && selector.tagQName() != anyQName() && !isHTMLAnchorElement(e
lement)) || element.isLink()) { | 783 if (m_strictParsing || context.isSubSelector || (selector.m_match ==
CSSSelector::Tag && selector.tagQName() != anyQName() && !isHTMLAnchorElement(e
lement)) || element.isLink()) { |
784 if (m_mode == ResolvingStyle) { | 784 if (m_mode == ResolvingStyle) { |
785 if (context.elementStyle) | 785 if (context.elementStyle) |
786 context.elementStyle->setAffectedByHover(); | 786 context.elementStyle->setAffectedByHover(); |
787 else | 787 else |
788 element.setChildrenAffectedByHover(); | 788 element.setChildrenOrSiblingsAffectedByHover(); |
789 } | 789 } |
790 if (element.hovered() || InspectorInstrumentation::forcePseudoSt
ate(&element, CSSSelector::PseudoHover)) | 790 if (element.hovered() || InspectorInstrumentation::forcePseudoSt
ate(&element, CSSSelector::PseudoHover)) |
791 return true; | 791 return true; |
792 } | 792 } |
793 break; | 793 break; |
794 case CSSSelector::PseudoActive: | 794 case CSSSelector::PseudoActive: |
795 // If we're in quirks mode, then :active should never match anchors
with no | 795 // If we're in quirks mode, then :active should never match anchors
with no |
796 // href and *:active should not match anything. | 796 // href and *:active should not match anything. |
797 if (m_strictParsing || context.isSubSelector || (selector.m_match ==
CSSSelector::Tag && selector.tagQName() != anyQName() && !isHTMLAnchorElement(e
lement)) || element.isLink()) { | 797 if (m_strictParsing || context.isSubSelector || (selector.m_match ==
CSSSelector::Tag && selector.tagQName() != anyQName() && !isHTMLAnchorElement(e
lement)) || element.isLink()) { |
798 if (m_mode == ResolvingStyle) { | 798 if (m_mode == ResolvingStyle) { |
799 if (context.elementStyle) | 799 if (context.elementStyle) |
800 context.elementStyle->setAffectedByActive(); | 800 context.elementStyle->setAffectedByActive(); |
801 else | 801 else |
802 element.setChildrenAffectedByActive(); | 802 element.setChildrenOrSiblingsAffectedByActive(); |
803 } | 803 } |
804 if (element.active() || InspectorInstrumentation::forcePseudoSta
te(&element, CSSSelector::PseudoActive)) | 804 if (element.active() || InspectorInstrumentation::forcePseudoSta
te(&element, CSSSelector::PseudoActive)) |
805 return true; | 805 return true; |
806 } | 806 } |
807 break; | 807 break; |
808 case CSSSelector::PseudoEnabled: | 808 case CSSSelector::PseudoEnabled: |
809 if (element.isFormControlElement() || isHTMLOptionElement(element) |
| isHTMLOptGroupElement(element)) | 809 if (element.isFormControlElement() || isHTMLOptionElement(element) |
| isHTMLOptGroupElement(element)) |
810 return !element.isDisabledFormControl(); | 810 return !element.isDisabledFormControl(); |
811 break; | 811 break; |
812 case CSSSelector::PseudoFullPageMedia: | 812 case CSSSelector::PseudoFullPageMedia: |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1142 return element.focused() && isFrameFocused(element); | 1142 return element.focused() && isFrameFocused(element); |
1143 } | 1143 } |
1144 | 1144 |
1145 template | 1145 template |
1146 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co
nst DOMSiblingTraversalStrategy&, MatchResult*) const; | 1146 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co
nst DOMSiblingTraversalStrategy&, MatchResult*) const; |
1147 | 1147 |
1148 template | 1148 template |
1149 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co
nst ShadowDOMSiblingTraversalStrategy&, MatchResult*) const; | 1149 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co
nst ShadowDOMSiblingTraversalStrategy&, MatchResult*) const; |
1150 | 1150 |
1151 } | 1151 } |
OLD | NEW |