Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Side by Side Diff: Source/core/css/SelectorChecker.cpp

Issue 347773002: Implement select listbox using shadow DOM (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: White background Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 nextElement = NodeRenderingTraversal::parentElement(next Element); 946 nextElement = NodeRenderingTraversal::parentElement(next Element);
947 } while (nextElement); 947 } while (nextElement);
948 } 948 }
949 if (matched) { 949 if (matched) {
950 if (specificity) 950 if (specificity)
951 *specificity = maxSpecificity; 951 *specificity = maxSpecificity;
952 return true; 952 return true;
953 } 953 }
954 } 954 }
955 break; 955 break;
956 case CSSSelector::PseudoSpatialNavigationFocus:
957 return context.isUARule && matchesSpatialNavigationFocusPseudoClass( element);
956 958
957 case CSSSelector::PseudoHorizontal: 959 case CSSSelector::PseudoHorizontal:
958 case CSSSelector::PseudoVertical: 960 case CSSSelector::PseudoVertical:
959 case CSSSelector::PseudoDecrement: 961 case CSSSelector::PseudoDecrement:
960 case CSSSelector::PseudoIncrement: 962 case CSSSelector::PseudoIncrement:
961 case CSSSelector::PseudoStart: 963 case CSSSelector::PseudoStart:
962 case CSSSelector::PseudoEnd: 964 case CSSSelector::PseudoEnd:
963 case CSSSelector::PseudoDoubleButton: 965 case CSSSelector::PseudoDoubleButton:
964 case CSSSelector::PseudoSingleButton: 966 case CSSSelector::PseudoSingleButton:
965 case CSSSelector::PseudoNoButton: 967 case CSSSelector::PseudoNoButton:
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 return element.document().frame() && element.document().frame()->selection() .isFocusedAndActive(); 1120 return element.document().frame() && element.document().frame()->selection() .isFocusedAndActive();
1119 } 1121 }
1120 1122
1121 bool SelectorChecker::matchesFocusPseudoClass(const Element& element) 1123 bool SelectorChecker::matchesFocusPseudoClass(const Element& element)
1122 { 1124 {
1123 if (InspectorInstrumentation::forcePseudoState(const_cast<Element*>(&element ), CSSSelector::PseudoFocus)) 1125 if (InspectorInstrumentation::forcePseudoState(const_cast<Element*>(&element ), CSSSelector::PseudoFocus))
1124 return true; 1126 return true;
1125 return element.focused() && isFrameFocused(element); 1127 return element.focused() && isFrameFocused(element);
1126 } 1128 }
1127 1129
1130 bool SelectorChecker::matchesSpatialNavigationFocusPseudoClass(const Element& el ement)
1131 {
1132 if (!isHTMLOptionElement(element))
tkent 2014/07/08 02:20:59 nit: you can write: return isHTMLOptionElement(ele
keishi 2014/07/10 09:48:03 Done.
1133 return false;
1134 return toHTMLOptionElement(element).spatialNavigationFocused() && isFrameFoc used(element);
1135 }
1136
1128 template 1137 template
1129 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co nst DOMSiblingTraversalStrategy&, MatchResult*) const; 1138 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co nst DOMSiblingTraversalStrategy&, MatchResult*) const;
1130 1139
1131 template 1140 template
1132 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co nst ShadowDOMSiblingTraversalStrategy&, MatchResult*) const; 1141 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co nst ShadowDOMSiblingTraversalStrategy&, MatchResult*) const;
1133 1142
1134 } 1143 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698