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

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

Issue 660273002: Use style invalidation sets for :-webkit-autofill. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git/+/master
Patch Set: Created 6 years, 2 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 Apple Inc. All r ights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r ights 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 case CSSSelector::PseudoOnlyChild: 80 case CSSSelector::PseudoOnlyChild:
81 case CSSSelector::PseudoOnlyOfType: 81 case CSSSelector::PseudoOnlyOfType:
82 case CSSSelector::PseudoNthChild: 82 case CSSSelector::PseudoNthChild:
83 case CSSSelector::PseudoNthOfType: 83 case CSSSelector::PseudoNthOfType:
84 case CSSSelector::PseudoNthLastChild: 84 case CSSSelector::PseudoNthLastChild:
85 case CSSSelector::PseudoNthLastOfType: 85 case CSSSelector::PseudoNthLastOfType:
86 case CSSSelector::PseudoLink: 86 case CSSSelector::PseudoLink:
87 case CSSSelector::PseudoVisited: 87 case CSSSelector::PseudoVisited:
88 case CSSSelector::PseudoAny: 88 case CSSSelector::PseudoAny:
89 case CSSSelector::PseudoAnyLink: 89 case CSSSelector::PseudoAnyLink:
90 case CSSSelector::PseudoAutofill:
90 case CSSSelector::PseudoHover: 91 case CSSSelector::PseudoHover:
91 case CSSSelector::PseudoDrag: 92 case CSSSelector::PseudoDrag:
92 case CSSSelector::PseudoFocus: 93 case CSSSelector::PseudoFocus:
93 case CSSSelector::PseudoActive: 94 case CSSSelector::PseudoActive:
94 case CSSSelector::PseudoChecked: 95 case CSSSelector::PseudoChecked:
95 case CSSSelector::PseudoEnabled: 96 case CSSSelector::PseudoEnabled:
96 case CSSSelector::PseudoDefault: 97 case CSSSelector::PseudoDefault:
97 case CSSSelector::PseudoDisabled: 98 case CSSSelector::PseudoDisabled:
98 case CSSSelector::PseudoOptional: 99 case CSSSelector::PseudoOptional:
99 case CSSSelector::PseudoRequired: 100 case CSSSelector::PseudoRequired:
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 static bool requiresSubtreeInvalidation(const CSSSelector& selector) 139 static bool requiresSubtreeInvalidation(const CSSSelector& selector)
139 { 140 {
140 if (!selector.matchesPseudoElement() && selector.match() != CSSSelector::Pse udoClass) { 141 if (!selector.matchesPseudoElement() && selector.match() != CSSSelector::Pse udoClass) {
141 ASSERT(supportsInvalidation(selector.match())); 142 ASSERT(supportsInvalidation(selector.match()));
142 return false; 143 return false;
143 } 144 }
144 145
145 switch (selector.pseudoType()) { 146 switch (selector.pseudoType()) {
146 case CSSSelector::PseudoFirstLine: 147 case CSSSelector::PseudoFirstLine:
147 case CSSSelector::PseudoFirstLetter: 148 case CSSSelector::PseudoFirstLetter:
148 case CSSSelector::PseudoAutofill:
149 case CSSSelector::PseudoFullPageMedia: 149 case CSSSelector::PseudoFullPageMedia:
150 case CSSSelector::PseudoResizer: 150 case CSSSelector::PseudoResizer:
151 case CSSSelector::PseudoScrollbar: 151 case CSSSelector::PseudoScrollbar:
152 case CSSSelector::PseudoScrollbarButton: 152 case CSSSelector::PseudoScrollbarButton:
153 case CSSSelector::PseudoScrollbarCorner: 153 case CSSSelector::PseudoScrollbarCorner:
154 case CSSSelector::PseudoScrollbarThumb: 154 case CSSSelector::PseudoScrollbarThumb:
155 case CSSSelector::PseudoScrollbarTrack: 155 case CSSSelector::PseudoScrollbarTrack:
156 case CSSSelector::PseudoScrollbarTrackPiece: 156 case CSSSelector::PseudoScrollbarTrackPiece:
157 case CSSSelector::PseudoWindowInactive: 157 case CSSSelector::PseudoWindowInactive:
158 case CSSSelector::PseudoCornerPresent: 158 case CSSSelector::PseudoCornerPresent:
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 { 288 {
289 if (selector.match() == CSSSelector::Class) 289 if (selector.match() == CSSSelector::Class)
290 return &ensureClassInvalidationSet(selector.value()); 290 return &ensureClassInvalidationSet(selector.value());
291 if (selector.isAttributeSelector()) 291 if (selector.isAttributeSelector())
292 return &ensureAttributeInvalidationSet(selector.attribute().localName()) ; 292 return &ensureAttributeInvalidationSet(selector.attribute().localName()) ;
293 if (selector.match() == CSSSelector::Id) 293 if (selector.match() == CSSSelector::Id)
294 return &ensureIdInvalidationSet(selector.value()); 294 return &ensureIdInvalidationSet(selector.value());
295 if (selector.match() == CSSSelector::PseudoClass) { 295 if (selector.match() == CSSSelector::PseudoClass) {
296 switch (selector.pseudoType()) { 296 switch (selector.pseudoType()) {
297 case CSSSelector::PseudoEmpty: 297 case CSSSelector::PseudoEmpty:
298 case CSSSelector::PseudoLink:
299 case CSSSelector::PseudoVisited:
300 case CSSSelector::PseudoAutofill:
298 case CSSSelector::PseudoHover: 301 case CSSSelector::PseudoHover:
302 case CSSSelector::PseudoFocus:
299 case CSSSelector::PseudoActive: 303 case CSSSelector::PseudoActive:
chrishtr 2014/10/17 18:47:28 Why did you make these not alphabetical?
rune 2014/10/19 20:11:02 Because I didn't know/think that was the style. I
chrishtr 2014/10/19 22:55:55 Ok.
300 case CSSSelector::PseudoFocus:
301 case CSSSelector::PseudoChecked: 304 case CSSSelector::PseudoChecked:
302 case CSSSelector::PseudoEnabled: 305 case CSSSelector::PseudoEnabled:
303 case CSSSelector::PseudoDisabled: 306 case CSSSelector::PseudoDisabled:
304 case CSSSelector::PseudoIndeterminate: 307 case CSSSelector::PseudoIndeterminate:
305 case CSSSelector::PseudoLink:
306 case CSSSelector::PseudoTarget: 308 case CSSSelector::PseudoTarget:
307 case CSSSelector::PseudoVisited:
308 return &ensurePseudoInvalidationSet(selector.pseudoType()); 309 return &ensurePseudoInvalidationSet(selector.pseudoType());
309 default: 310 default:
310 break; 311 break;
311 } 312 }
312 } 313 }
313 return 0; 314 return 0;
314 } 315 }
315 316
316 // Given a selector, update the descendant invalidation sets for the features fo und 317 // Given a selector, update the descendant invalidation sets for the features fo und
317 // in the selector. The first step is to extract the features from the rightmost 318 // in the selector. The first step is to extract the features from the rightmost
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 visitor->trace(uncommonAttributeRules); 639 visitor->trace(uncommonAttributeRules);
639 visitor->trace(m_classInvalidationSets); 640 visitor->trace(m_classInvalidationSets);
640 visitor->trace(m_attributeInvalidationSets); 641 visitor->trace(m_attributeInvalidationSets);
641 visitor->trace(m_idInvalidationSets); 642 visitor->trace(m_idInvalidationSets);
642 visitor->trace(m_pseudoInvalidationSets); 643 visitor->trace(m_pseudoInvalidationSets);
643 visitor->trace(m_styleInvalidator); 644 visitor->trace(m_styleInvalidator);
644 #endif 645 #endif
645 } 646 }
646 647
647 } // namespace blink 648 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/invalidation/autofill-pseudo-expected.txt ('k') | Source/core/html/HTMLFormControlElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698