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

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

Issue 1605473002: Pseudo element ids != NOPSEUDO only in rightmost compound. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@complex-pseudoelm-20160118
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 return false; 1032 return false;
1033 } 1033 }
1034 case CSSSelector::PseudoContent: 1034 case CSSSelector::PseudoContent:
1035 return element.isInShadowTree() && element.isInsertionPoint(); 1035 return element.isInShadowTree() && element.isInsertionPoint();
1036 case CSSSelector::PseudoShadow: 1036 case CSSSelector::PseudoShadow:
1037 return element.isInShadowTree() && context.previousElement; 1037 return element.isInShadowTree() && context.previousElement;
1038 default: 1038 default:
1039 break; 1039 break;
1040 } 1040 }
1041 1041
1042 if (!context.inRightmostCompound && m_mode == ResolvingStyle)
1043 return false;
1044
1045 if (m_mode == QueryingRules) 1042 if (m_mode == QueryingRules)
1046 return false; 1043 return false;
1044 if (m_mode == SharingRules)
1045 return true;
1047 1046
1048 PseudoId pseudoId = CSSSelector::pseudoId(selector.pseudoType()); 1047 result.dynamicPseudo = CSSSelector::pseudoId(selector.pseudoType());
1049 if (pseudoId != NOPSEUDO && m_mode != SharingRules) 1048 ASSERT(result.dynamicPseudo != NOPSEUDO);
1050 result.dynamicPseudo = pseudoId;
1051
1052 // ::before, ::after, etc.
1053 return true; 1049 return true;
1054 } 1050 }
1055 1051
1056 bool SelectorChecker::checkPseudoHost(const SelectorCheckingContext& context, Ma tchResult& result) const 1052 bool SelectorChecker::checkPseudoHost(const SelectorCheckingContext& context, Ma tchResult& result) const
1057 { 1053 {
1058 const CSSSelector& selector = *context.selector; 1054 const CSSSelector& selector = *context.selector;
1059 Element& element = *context.element; 1055 Element& element = *context.element;
1060 1056
1061 if (m_mode == SharingRules) 1057 if (m_mode == SharingRules)
1062 return true; 1058 return true;
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 } 1194 }
1199 1195
1200 bool SelectorChecker::matchesFocusPseudoClass(const Element& element) 1196 bool SelectorChecker::matchesFocusPseudoClass(const Element& element)
1201 { 1197 {
1202 if (InspectorInstrumentation::forcePseudoState(const_cast<Element*>(&element ), CSSSelector::PseudoFocus)) 1198 if (InspectorInstrumentation::forcePseudoState(const_cast<Element*>(&element ), CSSSelector::PseudoFocus))
1203 return true; 1199 return true;
1204 return element.focused() && isFrameFocused(element); 1200 return element.focused() && isFrameFocused(element);
1205 } 1201 }
1206 1202
1207 } 1203 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698