| 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. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. |
| 6 * All rights reserved. | 6 * All rights reserved. |
| 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
| 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
| 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 10 * (http://www.torchmobile.com/) | 10 * (http://www.torchmobile.com/) |
| (...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 case CSSSelector::PseudoVisited: | 877 case CSSSelector::PseudoVisited: |
| 878 return element.isLink() && | 878 return element.isLink() && |
| 879 context.visitedMatchType == VisitedMatchEnabled; | 879 context.visitedMatchType == VisitedMatchEnabled; |
| 880 case CSSSelector::PseudoDrag: | 880 case CSSSelector::PseudoDrag: |
| 881 if (m_mode == SharingRules) | 881 if (m_mode == SharingRules) |
| 882 return true; | 882 return true; |
| 883 if (m_mode == ResolvingStyle) { | 883 if (m_mode == ResolvingStyle) { |
| 884 if (context.inRightmostCompound) { | 884 if (context.inRightmostCompound) { |
| 885 m_elementStyle->setAffectedByDrag(); | 885 m_elementStyle->setAffectedByDrag(); |
| 886 } else { | 886 } else { |
| 887 m_elementStyle->setUnique(true); | 887 m_elementStyle->setUnique(); |
| 888 element.setChildrenOrSiblingsAffectedByDrag(); | 888 element.setChildrenOrSiblingsAffectedByDrag(); |
| 889 } | 889 } |
| 890 } | 890 } |
| 891 return element.isDragged(); | 891 return element.isDragged(); |
| 892 case CSSSelector::PseudoFocus: | 892 case CSSSelector::PseudoFocus: |
| 893 if (m_mode == SharingRules) | 893 if (m_mode == SharingRules) |
| 894 return true; | 894 return true; |
| 895 if (m_mode == ResolvingStyle) { | 895 if (m_mode == ResolvingStyle) { |
| 896 if (context.inRightmostCompound) { | 896 if (context.inRightmostCompound) { |
| 897 m_elementStyle->setAffectedByFocus(); | 897 m_elementStyle->setAffectedByFocus(); |
| 898 } else { | 898 } else { |
| 899 m_elementStyle->setUnique(true); | 899 m_elementStyle->setUnique(); |
| 900 element.setChildrenOrSiblingsAffectedByFocus(); | 900 element.setChildrenOrSiblingsAffectedByFocus(); |
| 901 } | 901 } |
| 902 } | 902 } |
| 903 return matchesFocusPseudoClass(element); | 903 return matchesFocusPseudoClass(element); |
| 904 case CSSSelector::PseudoHover: | 904 case CSSSelector::PseudoHover: |
| 905 if (m_mode == SharingRules) | 905 if (m_mode == SharingRules) |
| 906 return true; | 906 return true; |
| 907 if (m_mode == ResolvingStyle) { | 907 if (m_mode == ResolvingStyle) { |
| 908 if (context.inRightmostCompound) { | 908 if (context.inRightmostCompound) { |
| 909 m_elementStyle->setAffectedByHover(); | 909 m_elementStyle->setAffectedByHover(); |
| 910 } else { | 910 } else { |
| 911 m_elementStyle->setUnique(true); | 911 m_elementStyle->setUnique(); |
| 912 element.setChildrenOrSiblingsAffectedByHover(); | 912 element.setChildrenOrSiblingsAffectedByHover(); |
| 913 } | 913 } |
| 914 } | 914 } |
| 915 if (!shouldMatchHoverOrActive(context)) | 915 if (!shouldMatchHoverOrActive(context)) |
| 916 return false; | 916 return false; |
| 917 if (InspectorInstrumentation::forcePseudoState(&element, | 917 if (InspectorInstrumentation::forcePseudoState(&element, |
| 918 CSSSelector::PseudoHover)) | 918 CSSSelector::PseudoHover)) |
| 919 return true; | 919 return true; |
| 920 return element.isHovered(); | 920 return element.isHovered(); |
| 921 case CSSSelector::PseudoActive: | 921 case CSSSelector::PseudoActive: |
| 922 if (m_mode == SharingRules) | 922 if (m_mode == SharingRules) |
| 923 return true; | 923 return true; |
| 924 if (m_mode == ResolvingStyle) { | 924 if (m_mode == ResolvingStyle) { |
| 925 if (context.inRightmostCompound) { | 925 if (context.inRightmostCompound) { |
| 926 m_elementStyle->setAffectedByActive(); | 926 m_elementStyle->setAffectedByActive(); |
| 927 } else { | 927 } else { |
| 928 m_elementStyle->setUnique(true); | 928 m_elementStyle->setUnique(); |
| 929 element.setChildrenOrSiblingsAffectedByActive(); | 929 element.setChildrenOrSiblingsAffectedByActive(); |
| 930 } | 930 } |
| 931 } | 931 } |
| 932 if (!shouldMatchHoverOrActive(context)) | 932 if (!shouldMatchHoverOrActive(context)) |
| 933 return false; | 933 return false; |
| 934 if (InspectorInstrumentation::forcePseudoState(&element, | 934 if (InspectorInstrumentation::forcePseudoState(&element, |
| 935 CSSSelector::PseudoActive)) | 935 CSSSelector::PseudoActive)) |
| 936 return true; | 936 return true; |
| 937 return element.isActive(); | 937 return element.isActive(); |
| 938 case CSSSelector::PseudoEnabled: | 938 case CSSSelector::PseudoEnabled: |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1308 } | 1308 } |
| 1309 | 1309 |
| 1310 bool SelectorChecker::matchesFocusPseudoClass(const Element& element) { | 1310 bool SelectorChecker::matchesFocusPseudoClass(const Element& element) { |
| 1311 if (InspectorInstrumentation::forcePseudoState(const_cast<Element*>(&element), | 1311 if (InspectorInstrumentation::forcePseudoState(const_cast<Element*>(&element), |
| 1312 CSSSelector::PseudoFocus)) | 1312 CSSSelector::PseudoFocus)) |
| 1313 return true; | 1313 return true; |
| 1314 return element.isFocused() && isFrameFocused(element); | 1314 return element.isFocused() && isFrameFocused(element); |
| 1315 } | 1315 } |
| 1316 | 1316 |
| 1317 } // namespace blink | 1317 } // namespace blink |
| OLD | NEW |