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

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

Issue 347773002: Implement select listbox using shadow DOM (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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/ElementRuleCollector.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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 case PseudoFutureCue: 250 case PseudoFutureCue:
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 return NOPSEUDO; 261 return NOPSEUDO;
261 case PseudoNotParsed: 262 case PseudoNotParsed:
262 ASSERT_NOT_REACHED(); 263 ASSERT_NOT_REACHED();
263 return NOPSEUDO; 264 return NOPSEUDO;
264 } 265 }
265 266
266 ASSERT_NOT_REACHED(); 267 ASSERT_NOT_REACHED();
267 return NOPSEUDO; 268 return NOPSEUDO;
268 } 269 }
269 270
270 // Could be made smaller and faster by replacing pointer with an 271 // Could be made smaller and faster by replacing pointer with an
271 // offset into a string buffer and making the bit fields smaller but 272 // offset into a string buffer and making the bit fields smaller but
272 // that could not be maintained by hand. 273 // that could not be maintained by hand.
273 struct NameToPseudoStruct { 274 struct NameToPseudoStruct {
274 const char* string; 275 const char* string;
275 unsigned type:8; 276 unsigned type:8;
276 }; 277 };
277 278
278 // This table should be kept sorted. 279 // This table should be kept sorted.
279 const static NameToPseudoStruct pseudoTypeMap[] = { 280 const static NameToPseudoStruct pseudoTypeMap[] = {
281 {"-internal-spatial-navigation-focus", CSSSelector::PseudoSpatialNavigationFocus },
280 {"-webkit-any(", CSSSelector::PseudoAny}, 282 {"-webkit-any(", CSSSelector::PseudoAny},
281 {"-webkit-any-link", CSSSelector::PseudoAnyLink}, 283 {"-webkit-any-link", CSSSelector::PseudoAnyLink},
282 {"-webkit-autofill", CSSSelector::PseudoAutofill}, 284 {"-webkit-autofill", CSSSelector::PseudoAutofill},
283 {"-webkit-drag", CSSSelector::PseudoDrag}, 285 {"-webkit-drag", CSSSelector::PseudoDrag},
284 {"-webkit-full-page-media", CSSSelector::PseudoFullPageMedia}, 286 {"-webkit-full-page-media", CSSSelector::PseudoFullPageMedia},
285 {"-webkit-full-screen", CSSSelector::PseudoFullScreen}, 287 {"-webkit-full-screen", CSSSelector::PseudoFullScreen},
286 {"-webkit-full-screen-ancestor", CSSSelector::PseudoFullScreenAncestor}, 288 {"-webkit-full-screen-ancestor", CSSSelector::PseudoFullScreenAncestor},
287 {"-webkit-full-screen-document", CSSSelector::PseudoFullScreenDocument}, 289 {"-webkit-full-screen-document", CSSSelector::PseudoFullScreenDocument},
288 {"-webkit-resizer", CSSSelector::PseudoResizer}, 290 {"-webkit-resizer", CSSSelector::PseudoResizer},
289 {"-webkit-scrollbar", CSSSelector::PseudoScrollbar}, 291 {"-webkit-scrollbar", CSSSelector::PseudoScrollbar},
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 case PseudoFullScreen: 524 case PseudoFullScreen:
523 case PseudoFullScreenDocument: 525 case PseudoFullScreenDocument:
524 case PseudoFullScreenAncestor: 526 case PseudoFullScreenAncestor:
525 case PseudoInRange: 527 case PseudoInRange:
526 case PseudoOutOfRange: 528 case PseudoOutOfRange:
527 case PseudoFutureCue: 529 case PseudoFutureCue:
528 case PseudoPastCue: 530 case PseudoPastCue:
529 case PseudoHost: 531 case PseudoHost:
530 case PseudoHostContext: 532 case PseudoHostContext:
531 case PseudoUnresolved: 533 case PseudoUnresolved:
534 case PseudoSpatialNavigationFocus:
532 break; 535 break;
533 case PseudoFirstPage: 536 case PseudoFirstPage:
534 case PseudoLeftPage: 537 case PseudoLeftPage:
535 case PseudoRightPage: 538 case PseudoRightPage:
536 isPagePseudoClass = true; 539 isPagePseudoClass = true;
537 break; 540 break;
538 } 541 }
539 542
540 bool matchPagePseudoClass = (m_match == PagePseudoClass); 543 bool matchPagePseudoClass = (m_match == PagePseudoClass);
541 if (matchPagePseudoClass != isPagePseudoClass) 544 if (matchPagePseudoClass != isPagePseudoClass)
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 case CSSSelector::PseudoNthOfType: 773 case CSSSelector::PseudoNthOfType:
771 case CSSSelector::PseudoNthLastOfType: 774 case CSSSelector::PseudoNthLastOfType:
772 case CSSSelector::PseudoFirstChild: 775 case CSSSelector::PseudoFirstChild:
773 case CSSSelector::PseudoLastChild: 776 case CSSSelector::PseudoLastChild:
774 case CSSSelector::PseudoFirstOfType: 777 case CSSSelector::PseudoFirstOfType:
775 case CSSSelector::PseudoLastOfType: 778 case CSSSelector::PseudoLastOfType:
776 case CSSSelector::PseudoOnlyOfType: 779 case CSSSelector::PseudoOnlyOfType:
777 case CSSSelector::PseudoHost: 780 case CSSSelector::PseudoHost:
778 case CSSSelector::PseudoHostContext: 781 case CSSSelector::PseudoHostContext:
779 case CSSSelector::PseudoNot: 782 case CSSSelector::PseudoNot:
783 case CSSSelector::PseudoSpatialNavigationFocus:
780 return true; 784 return true;
781 default: 785 default:
782 return false; 786 return false;
783 } 787 }
784 } 788 }
785 789
786 bool CSSSelector::isCompound() const 790 bool CSSSelector::isCompound() const
787 { 791 {
788 if (!validateSubSelector(this)) 792 if (!validateSubSelector(this))
789 return false; 793 return false;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 return false; 890 return false;
887 return (count - m_b) % m_a == 0; 891 return (count - m_b) % m_a == 0;
888 } else { 892 } else {
889 if (count > m_b) 893 if (count > m_b)
890 return false; 894 return false;
891 return (m_b - count) % (-m_a) == 0; 895 return (m_b - count) % (-m_a) == 0;
892 } 896 }
893 } 897 }
894 898
895 } // namespace WebCore 899 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/CSSSelector.h ('k') | Source/core/css/ElementRuleCollector.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698