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

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

Issue 450623002: Styling option should not override option:checked UA style (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added to isSkippableComponentForInvalidation Created 6 years, 4 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 | « Source/core/css/CSSSelector.h ('k') | Source/core/css/RuleFeature.cpp » ('j') | 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-2003 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * 1999 Waldo Bastian (bastian@kde.org) 3 * 1999 Waldo Bastian (bastian@kde.org)
4 * 2001 Andreas Schlapbach (schlpbch@iam.unibe.ch) 4 * 2001 Andreas Schlapbach (schlpbch@iam.unibe.ch)
5 * 2001-2003 Dirk Mueller (mueller@kde.org) 5 * 2001-2003 Dirk Mueller (mueller@kde.org)
6 * Copyright (C) 2002, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2002, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2008 David Smith (catfish.man@gmail.com) 7 * Copyright (C) 2008 David Smith (catfish.man@gmail.com)
8 * Copyright (C) 2010 Google Inc. All rights reserved. 8 * Copyright (C) 2010 Google Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 case PseudoPastCue: 251 case PseudoPastCue:
252 case PseudoUnresolved: 252 case PseudoUnresolved:
253 case PseudoContent: 253 case PseudoContent:
254 case PseudoHost: 254 case PseudoHost:
255 case PseudoHostContext: 255 case PseudoHostContext:
256 case PseudoShadow: 256 case PseudoShadow:
257 case PseudoFullScreen: 257 case PseudoFullScreen:
258 case PseudoFullScreenDocument: 258 case PseudoFullScreenDocument:
259 case PseudoFullScreenAncestor: 259 case PseudoFullScreenAncestor:
260 case PseudoSpatialNavigationFocus: 260 case PseudoSpatialNavigationFocus:
261 case PseudoListBox:
261 return NOPSEUDO; 262 return NOPSEUDO;
262 case PseudoNotParsed: 263 case PseudoNotParsed:
263 ASSERT_NOT_REACHED(); 264 ASSERT_NOT_REACHED();
264 return NOPSEUDO; 265 return NOPSEUDO;
265 } 266 }
266 267
267 ASSERT_NOT_REACHED(); 268 ASSERT_NOT_REACHED();
268 return NOPSEUDO; 269 return NOPSEUDO;
269 } 270 }
270 271
271 // Could be made smaller and faster by replacing pointer with an 272 // Could be made smaller and faster by replacing pointer with an
272 // offset into a string buffer and making the bit fields smaller but 273 // offset into a string buffer and making the bit fields smaller but
273 // that could not be maintained by hand. 274 // that could not be maintained by hand.
274 struct NameToPseudoStruct { 275 struct NameToPseudoStruct {
275 const char* string; 276 const char* string;
276 unsigned type:8; 277 unsigned type:8;
277 }; 278 };
278 279
279 // This table should be kept sorted. 280 // This table should be kept sorted.
280 const static NameToPseudoStruct pseudoTypeMap[] = { 281 const static NameToPseudoStruct pseudoTypeMap[] = {
282 {"-internal-list-box", CSSSelector::PseudoListBox},
281 {"-internal-spatial-navigation-focus", CSSSelector::PseudoSpatialNavigationFocus }, 283 {"-internal-spatial-navigation-focus", CSSSelector::PseudoSpatialNavigationFocus },
282 {"-webkit-any(", CSSSelector::PseudoAny}, 284 {"-webkit-any(", CSSSelector::PseudoAny},
283 {"-webkit-any-link", CSSSelector::PseudoAnyLink}, 285 {"-webkit-any-link", CSSSelector::PseudoAnyLink},
284 {"-webkit-autofill", CSSSelector::PseudoAutofill}, 286 {"-webkit-autofill", CSSSelector::PseudoAutofill},
285 {"-webkit-drag", CSSSelector::PseudoDrag}, 287 {"-webkit-drag", CSSSelector::PseudoDrag},
286 {"-webkit-full-page-media", CSSSelector::PseudoFullPageMedia}, 288 {"-webkit-full-page-media", CSSSelector::PseudoFullPageMedia},
287 {"-webkit-full-screen", CSSSelector::PseudoFullScreen}, 289 {"-webkit-full-screen", CSSSelector::PseudoFullScreen},
288 {"-webkit-full-screen-ancestor", CSSSelector::PseudoFullScreenAncestor}, 290 {"-webkit-full-screen-ancestor", CSSSelector::PseudoFullScreenAncestor},
289 {"-webkit-full-screen-document", CSSSelector::PseudoFullScreenDocument}, 291 {"-webkit-full-screen-document", CSSSelector::PseudoFullScreenDocument},
290 {"-webkit-resizer", CSSSelector::PseudoResizer}, 292 {"-webkit-resizer", CSSSelector::PseudoResizer},
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 case PseudoFullScreenDocument: 527 case PseudoFullScreenDocument:
526 case PseudoFullScreenAncestor: 528 case PseudoFullScreenAncestor:
527 case PseudoInRange: 529 case PseudoInRange:
528 case PseudoOutOfRange: 530 case PseudoOutOfRange:
529 case PseudoFutureCue: 531 case PseudoFutureCue:
530 case PseudoPastCue: 532 case PseudoPastCue:
531 case PseudoHost: 533 case PseudoHost:
532 case PseudoHostContext: 534 case PseudoHostContext:
533 case PseudoUnresolved: 535 case PseudoUnresolved:
534 case PseudoSpatialNavigationFocus: 536 case PseudoSpatialNavigationFocus:
537 case PseudoListBox:
535 break; 538 break;
536 case PseudoFirstPage: 539 case PseudoFirstPage:
537 case PseudoLeftPage: 540 case PseudoLeftPage:
538 case PseudoRightPage: 541 case PseudoRightPage:
539 isPagePseudoClass = true; 542 isPagePseudoClass = true;
540 break; 543 break;
541 } 544 }
542 545
543 bool matchPagePseudoClass = (m_match == PagePseudoClass); 546 bool matchPagePseudoClass = (m_match == PagePseudoClass);
544 if (matchPagePseudoClass != isPagePseudoClass) 547 if (matchPagePseudoClass != isPagePseudoClass)
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 case CSSSelector::PseudoNthLastOfType: 780 case CSSSelector::PseudoNthLastOfType:
778 case CSSSelector::PseudoFirstChild: 781 case CSSSelector::PseudoFirstChild:
779 case CSSSelector::PseudoLastChild: 782 case CSSSelector::PseudoLastChild:
780 case CSSSelector::PseudoFirstOfType: 783 case CSSSelector::PseudoFirstOfType:
781 case CSSSelector::PseudoLastOfType: 784 case CSSSelector::PseudoLastOfType:
782 case CSSSelector::PseudoOnlyOfType: 785 case CSSSelector::PseudoOnlyOfType:
783 case CSSSelector::PseudoHost: 786 case CSSSelector::PseudoHost:
784 case CSSSelector::PseudoHostContext: 787 case CSSSelector::PseudoHostContext:
785 case CSSSelector::PseudoNot: 788 case CSSSelector::PseudoNot:
786 case CSSSelector::PseudoSpatialNavigationFocus: 789 case CSSSelector::PseudoSpatialNavigationFocus:
790 case CSSSelector::PseudoListBox:
787 return true; 791 return true;
788 default: 792 default:
789 return false; 793 return false;
790 } 794 }
791 } 795 }
792 796
793 bool CSSSelector::isCompound() const 797 bool CSSSelector::isCompound() const
794 { 798 {
795 if (!validateSubSelector(this)) 799 if (!validateSubSelector(this))
796 return false; 800 return false;
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 if (count < nthBValue()) 899 if (count < nthBValue())
896 return false; 900 return false;
897 return (count - nthBValue()) % nthAValue() == 0; 901 return (count - nthBValue()) % nthAValue() == 0;
898 } 902 }
899 if (count > nthBValue()) 903 if (count > nthBValue())
900 return false; 904 return false;
901 return (nthBValue() - count) % (-nthAValue()) == 0; 905 return (nthBValue() - count) % (-nthAValue()) == 0;
902 } 906 }
903 907
904 } // namespace blink 908 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/CSSSelector.h ('k') | Source/core/css/RuleFeature.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698