| 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 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 break; | 827 break; |
| 828 case CSSSelector::PseudoAutofill: | 828 case CSSSelector::PseudoAutofill: |
| 829 return element.isFormControlElement() && toHTMLFormControlElement(elemen
t).isAutofilled(); | 829 return element.isFormControlElement() && toHTMLFormControlElement(elemen
t).isAutofilled(); |
| 830 case CSSSelector::PseudoAnyLink: | 830 case CSSSelector::PseudoAnyLink: |
| 831 case CSSSelector::PseudoLink: | 831 case CSSSelector::PseudoLink: |
| 832 return element.isLink(); | 832 return element.isLink(); |
| 833 case CSSSelector::PseudoVisited: | 833 case CSSSelector::PseudoVisited: |
| 834 return element.isLink() && context.visitedMatchType == VisitedMatchEnabl
ed; | 834 return element.isLink() && context.visitedMatchType == VisitedMatchEnabl
ed; |
| 835 case CSSSelector::PseudoDrag: | 835 case CSSSelector::PseudoDrag: |
| 836 if (m_mode == ResolvingStyle) { | 836 if (m_mode == ResolvingStyle) { |
| 837 if (context.inRightmostCompound) | 837 if (context.inRightmostCompound) { |
| 838 context.elementStyle->setAffectedByDrag(); | 838 context.elementStyle->setAffectedByDrag(); |
| 839 else | 839 } else { |
| 840 context.elementStyle->setUnique(); |
| 840 element.setChildrenOrSiblingsAffectedByDrag(); | 841 element.setChildrenOrSiblingsAffectedByDrag(); |
| 842 } |
| 841 } | 843 } |
| 842 return element.layoutObject() && element.layoutObject()->isDragging(); | 844 return element.layoutObject() && element.layoutObject()->isDragging(); |
| 843 case CSSSelector::PseudoFocus: | 845 case CSSSelector::PseudoFocus: |
| 844 if (m_mode == ResolvingStyle) { | 846 if (m_mode == ResolvingStyle) { |
| 845 if (context.inRightmostCompound) | 847 if (context.inRightmostCompound) { |
| 846 context.elementStyle->setAffectedByFocus(); | 848 context.elementStyle->setAffectedByFocus(); |
| 847 else | 849 } else { |
| 850 context.elementStyle->setUnique(); |
| 848 element.setChildrenOrSiblingsAffectedByFocus(); | 851 element.setChildrenOrSiblingsAffectedByFocus(); |
| 852 } |
| 849 } | 853 } |
| 850 return matchesFocusPseudoClass(element); | 854 return matchesFocusPseudoClass(element); |
| 851 case CSSSelector::PseudoHover: | 855 case CSSSelector::PseudoHover: |
| 852 if (m_mode == ResolvingStyle) { | 856 if (m_mode == ResolvingStyle) { |
| 853 if (context.inRightmostCompound) | 857 if (context.inRightmostCompound) { |
| 854 context.elementStyle->setAffectedByHover(); | 858 context.elementStyle->setAffectedByHover(); |
| 855 else | 859 } else { |
| 860 context.elementStyle->setUnique(); |
| 856 element.setChildrenOrSiblingsAffectedByHover(); | 861 element.setChildrenOrSiblingsAffectedByHover(); |
| 862 } |
| 857 } | 863 } |
| 858 if (!shouldMatchHoverOrActive(context)) | 864 if (!shouldMatchHoverOrActive(context)) |
| 859 return false; | 865 return false; |
| 860 if (InspectorInstrumentation::forcePseudoState(&element, CSSSelector::Ps
eudoHover)) | 866 if (InspectorInstrumentation::forcePseudoState(&element, CSSSelector::Ps
eudoHover)) |
| 861 return true; | 867 return true; |
| 862 return element.hovered(); | 868 return element.hovered(); |
| 863 case CSSSelector::PseudoActive: | 869 case CSSSelector::PseudoActive: |
| 864 if (m_mode == ResolvingStyle) { | 870 if (m_mode == ResolvingStyle) { |
| 865 if (context.inRightmostCompound) | 871 if (context.inRightmostCompound) { |
| 866 context.elementStyle->setAffectedByActive(); | 872 context.elementStyle->setAffectedByActive(); |
| 867 else | 873 } else { |
| 874 context.elementStyle->setUnique(); |
| 868 element.setChildrenOrSiblingsAffectedByActive(); | 875 element.setChildrenOrSiblingsAffectedByActive(); |
| 876 } |
| 869 } | 877 } |
| 870 if (!shouldMatchHoverOrActive(context)) | 878 if (!shouldMatchHoverOrActive(context)) |
| 871 return false; | 879 return false; |
| 872 if (InspectorInstrumentation::forcePseudoState(&element, CSSSelector::Ps
eudoActive)) | 880 if (InspectorInstrumentation::forcePseudoState(&element, CSSSelector::Ps
eudoActive)) |
| 873 return true; | 881 return true; |
| 874 return element.active(); | 882 return element.active(); |
| 875 case CSSSelector::PseudoEnabled: | 883 case CSSSelector::PseudoEnabled: |
| 876 if (element.isFormControlElement() || isHTMLOptionElement(element) || is
HTMLOptGroupElement(element)) | 884 if (element.isFormControlElement() || isHTMLOptionElement(element) || is
HTMLOptGroupElement(element)) |
| 877 return !element.isDisabledFormControl(); | 885 return !element.isDisabledFormControl(); |
| 878 if (isHTMLAnchorElement(element) || isHTMLAreaElement(element)) | 886 if (isHTMLAnchorElement(element) || isHTMLAreaElement(element)) |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1190 } | 1198 } |
| 1191 | 1199 |
| 1192 bool SelectorChecker::matchesFocusPseudoClass(const Element& element) | 1200 bool SelectorChecker::matchesFocusPseudoClass(const Element& element) |
| 1193 { | 1201 { |
| 1194 if (InspectorInstrumentation::forcePseudoState(const_cast<Element*>(&element
), CSSSelector::PseudoFocus)) | 1202 if (InspectorInstrumentation::forcePseudoState(const_cast<Element*>(&element
), CSSSelector::PseudoFocus)) |
| 1195 return true; | 1203 return true; |
| 1196 return element.focused() && isFrameFocused(element); | 1204 return element.focused() && isFrameFocused(element); |
| 1197 } | 1205 } |
| 1198 | 1206 |
| 1199 } | 1207 } |
| OLD | NEW |