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

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

Issue 328443003: Remove impossible conditions from SelectorChecker::checkOne() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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
« 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 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 case CSSSelector::PseudoFocus: 779 case CSSSelector::PseudoFocus:
780 if (m_mode == ResolvingStyle) { 780 if (m_mode == ResolvingStyle) {
781 if (context.elementStyle) 781 if (context.elementStyle)
782 context.elementStyle->setAffectedByFocus(); 782 context.elementStyle->setAffectedByFocus();
783 else 783 else
784 element.setChildrenOrSiblingsAffectedByFocus(); 784 element.setChildrenOrSiblingsAffectedByFocus();
785 } 785 }
786 return matchesFocusPseudoClass(element); 786 return matchesFocusPseudoClass(element);
787 case CSSSelector::PseudoHover: 787 case CSSSelector::PseudoHover:
788 // If we're in quirks mode, then hover should never match anchors wi th no 788 // If we're in quirks mode, then hover should never match anchors wi th no
789 // href and *:hover should not match anything. This is important for sites like wsj.com. 789 // href and *:hover should not match anything. This is important for sites like wsj.com.
esprehn 2014/06/09 21:41:35 I suspect the wjs.com website has long since chang
Inactive 2014/06/10 00:35:05 Unfortunately, based on my testing, out behavior i
790 if (m_strictParsing || context.isSubSelector || (selector.m_match == CSSSelector::Tag && selector.tagQName() != anyQName() && !isHTMLAnchorElement(e lement)) || element.isLink()) { 790 if (m_strictParsing || context.isSubSelector || element.isLink()) {
791 if (m_mode == ResolvingStyle) { 791 if (m_mode == ResolvingStyle) {
792 if (context.elementStyle) 792 if (context.elementStyle)
793 context.elementStyle->setAffectedByHover(); 793 context.elementStyle->setAffectedByHover();
794 else 794 else
795 element.setChildrenOrSiblingsAffectedByHover(); 795 element.setChildrenOrSiblingsAffectedByHover();
796 } 796 }
797 if (element.hovered() || InspectorInstrumentation::forcePseudoSt ate(&element, CSSSelector::PseudoHover)) 797 if (element.hovered() || InspectorInstrumentation::forcePseudoSt ate(&element, CSSSelector::PseudoHover))
798 return true; 798 return true;
799 } 799 }
800 break; 800 break;
801 case CSSSelector::PseudoActive: 801 case CSSSelector::PseudoActive:
802 // If we're in quirks mode, then :active should never match anchors with no 802 // If we're in quirks mode, then :active should never match anchors with no
803 // href and *:active should not match anything. 803 // href and *:active should not match anything.
804 if (m_strictParsing || context.isSubSelector || (selector.m_match == CSSSelector::Tag && selector.tagQName() != anyQName() && !isHTMLAnchorElement(e lement)) || element.isLink()) { 804 if (m_strictParsing || context.isSubSelector || element.isLink()) {
805 if (m_mode == ResolvingStyle) { 805 if (m_mode == ResolvingStyle) {
806 if (context.elementStyle) 806 if (context.elementStyle)
807 context.elementStyle->setAffectedByActive(); 807 context.elementStyle->setAffectedByActive();
808 else 808 else
809 element.setChildrenOrSiblingsAffectedByActive(); 809 element.setChildrenOrSiblingsAffectedByActive();
810 } 810 }
811 if (element.active() || InspectorInstrumentation::forcePseudoSta te(&element, CSSSelector::PseudoActive)) 811 if (element.active() || InspectorInstrumentation::forcePseudoSta te(&element, CSSSelector::PseudoActive))
812 return true; 812 return true;
813 } 813 }
814 break; 814 break;
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
1149 return element.focused() && isFrameFocused(element); 1149 return element.focused() && isFrameFocused(element);
1150 } 1150 }
1151 1151
1152 template 1152 template
1153 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co nst DOMSiblingTraversalStrategy&, MatchResult*) const; 1153 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co nst DOMSiblingTraversalStrategy&, MatchResult*) const;
1154 1154
1155 template 1155 template
1156 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co nst ShadowDOMSiblingTraversalStrategy&, MatchResult*) const; 1156 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co nst ShadowDOMSiblingTraversalStrategy&, MatchResult*) const;
1157 1157
1158 } 1158 }
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