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

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

Issue 1602833002: No pseudo elements in SelectorChecker::Mode QueryingRules. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-pseudoelm-check-2-20160118
Patch Set: Another review issue Created 4 years, 10 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
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 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 ASSERT(selector.selectorList()->first()); 1059 ASSERT(selector.selectorList()->first());
1060 ASSERT(!CSSSelectorList::next(*selector.selectorList()->first())); 1060 ASSERT(!CSSSelectorList::next(*selector.selectorList()->first()));
1061 subContext.selector = selector.selectorList()->first(); 1061 subContext.selector = selector.selectorList()->first();
1062 return match(subContext); 1062 return match(subContext);
1063 } 1063 }
1064 case CSSSelector::PseudoContent: 1064 case CSSSelector::PseudoContent:
1065 return element.isInShadowTree() && element.isInsertionPoint(); 1065 return element.isInShadowTree() && element.isInsertionPoint();
1066 case CSSSelector::PseudoShadow: 1066 case CSSSelector::PseudoShadow:
1067 return element.isInShadowTree() && context.previousElement; 1067 return element.isInShadowTree() && context.previousElement;
1068 default: 1068 default:
1069 break; 1069 if (m_mode == SharingRules)
1070 return true;
1071 ASSERT(m_mode != QueryingRules);
1072 result.dynamicPseudo = CSSSelector::pseudoId(selector.pseudoType());
1073 ASSERT(result.dynamicPseudo != NOPSEUDO);
1074 return true;
1070 } 1075 }
1071
1072 if (m_mode == QueryingRules)
1073 return false;
1074 if (m_mode == SharingRules)
1075 return true;
1076
1077 result.dynamicPseudo = CSSSelector::pseudoId(selector.pseudoType());
1078 ASSERT(result.dynamicPseudo != NOPSEUDO);
1079 return true;
1080 } 1076 }
1081 1077
1082 bool SelectorChecker::checkPseudoHost(const SelectorCheckingContext& context, Ma tchResult& result) const 1078 bool SelectorChecker::checkPseudoHost(const SelectorCheckingContext& context, Ma tchResult& result) const
1083 { 1079 {
1084 const CSSSelector& selector = *context.selector; 1080 const CSSSelector& selector = *context.selector;
1085 Element& element = *context.element; 1081 Element& element = *context.element;
1086 1082
1087 if (m_mode == SharingRules) 1083 if (m_mode == SharingRules)
1088 return true; 1084 return true;
1089 // :host only matches a shadow host when :host is in a shadow tree of the sh adow host. 1085 // :host only matches a shadow host when :host is in a shadow tree of the sh adow host.
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1224 } 1220 }
1225 1221
1226 bool SelectorChecker::matchesFocusPseudoClass(const Element& element) 1222 bool SelectorChecker::matchesFocusPseudoClass(const Element& element)
1227 { 1223 {
1228 if (InspectorInstrumentation::forcePseudoState(const_cast<Element*>(&element ), CSSSelector::PseudoFocus)) 1224 if (InspectorInstrumentation::forcePseudoState(const_cast<Element*>(&element ), CSSSelector::PseudoFocus))
1229 return true; 1225 return true;
1230 return element.focused() && isFrameFocused(element); 1226 return element.focused() && isFrameFocused(element);
1231 } 1227 }
1232 1228
1233 } // namespace blink 1229 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/SelectorChecker.h ('k') | third_party/WebKit/Source/core/dom/SelectorQuery.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698