| OLD | NEW |
| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 case PseudoStart: | 235 case PseudoStart: |
| 236 case PseudoEnd: | 236 case PseudoEnd: |
| 237 case PseudoDoubleButton: | 237 case PseudoDoubleButton: |
| 238 case PseudoSingleButton: | 238 case PseudoSingleButton: |
| 239 case PseudoNoButton: | 239 case PseudoNoButton: |
| 240 case PseudoFirstPage: | 240 case PseudoFirstPage: |
| 241 case PseudoLeftPage: | 241 case PseudoLeftPage: |
| 242 case PseudoRightPage: | 242 case PseudoRightPage: |
| 243 case PseudoInRange: | 243 case PseudoInRange: |
| 244 case PseudoOutOfRange: | 244 case PseudoOutOfRange: |
| 245 case PseudoInternalCustomElement: |
| 245 case PseudoUserAgentCustomElement: | 246 case PseudoUserAgentCustomElement: |
| 246 case PseudoWebKitCustomElement: | 247 case PseudoWebKitCustomElement: |
| 247 case PseudoCue: | 248 case PseudoCue: |
| 248 case PseudoFutureCue: | 249 case PseudoFutureCue: |
| 249 case PseudoPastCue: | 250 case PseudoPastCue: |
| 250 case PseudoUnresolved: | 251 case PseudoUnresolved: |
| 251 case PseudoContent: | 252 case PseudoContent: |
| 252 case PseudoHost: | 253 case PseudoHost: |
| 253 case PseudoHostContext: | 254 case PseudoHostContext: |
| 254 case PseudoShadow: | 255 case PseudoShadow: |
| (...skipping 16 matching lines...) Expand all Loading... |
| 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 // These tables should be kept sorted. | 279 // These tables should be kept sorted. |
| 279 const static NameToPseudoStruct pseudoTypeWithoutArgumentsMap[] = { | 280 const static NameToPseudoStruct pseudoTypeWithoutArgumentsMap[] = { |
| 280 {"-internal-list-box", CSSSelector::PseudoListBox}, | 281 {"-internal-list-box", CSSSelector::PseudoListBox}, |
| 281 {"-internal-media-controls-cast-button", CSSSelector::PseudoWebKitCustomElement}
, | |
| 282 {"-internal-media-controls-overlay-cast-button", CSSSelector::PseudoWebKitCustom
Element}, | |
| 283 {"-internal-spatial-navigation-focus", CSSSelector::PseudoSpatialNavigationFocus
}, | 282 {"-internal-spatial-navigation-focus", CSSSelector::PseudoSpatialNavigationFocus
}, |
| 284 {"-webkit-any-link", CSSSelector::PseudoAnyLink}, | 283 {"-webkit-any-link", CSSSelector::PseudoAnyLink}, |
| 285 {"-webkit-autofill", CSSSelector::PseudoAutofill}, | 284 {"-webkit-autofill", CSSSelector::PseudoAutofill}, |
| 286 {"-webkit-drag", CSSSelector::PseudoDrag}, | 285 {"-webkit-drag", CSSSelector::PseudoDrag}, |
| 287 {"-webkit-full-page-media", CSSSelector::PseudoFullPageMedia}, | 286 {"-webkit-full-page-media", CSSSelector::PseudoFullPageMedia}, |
| 288 {"-webkit-full-screen", CSSSelector::PseudoFullScreen}, | 287 {"-webkit-full-screen", CSSSelector::PseudoFullScreen}, |
| 289 {"-webkit-full-screen-ancestor", CSSSelector::PseudoFullScreenAncestor}, | 288 {"-webkit-full-screen-ancestor", CSSSelector::PseudoFullScreenAncestor}, |
| 290 {"-webkit-full-screen-document", CSSSelector::PseudoFullScreenDocument}, | 289 {"-webkit-full-screen-document", CSSSelector::PseudoFullScreenDocument}, |
| 291 {"-webkit-resizer", CSSSelector::PseudoResizer}, | 290 {"-webkit-resizer", CSSSelector::PseudoResizer}, |
| 292 {"-webkit-scrollbar", CSSSelector::PseudoScrollbar}, | 291 {"-webkit-scrollbar", CSSSelector::PseudoScrollbar}, |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 printf("******* end *******\n"); | 433 printf("******* end *******\n"); |
| 435 } | 434 } |
| 436 #endif | 435 #endif |
| 437 | 436 |
| 438 CSSSelector::PseudoType CSSSelector::parsePseudoType(const AtomicString& name, b
ool hasArguments) | 437 CSSSelector::PseudoType CSSSelector::parsePseudoType(const AtomicString& name, b
ool hasArguments) |
| 439 { | 438 { |
| 440 CSSSelector::PseudoType pseudoType = nameToPseudoType(name, hasArguments); | 439 CSSSelector::PseudoType pseudoType = nameToPseudoType(name, hasArguments); |
| 441 if (pseudoType != PseudoUnknown) | 440 if (pseudoType != PseudoUnknown) |
| 442 return pseudoType; | 441 return pseudoType; |
| 443 | 442 |
| 443 if (name.startsWith("-internal-")) |
| 444 return PseudoInternalCustomElement; |
| 444 if (name.startsWith("-webkit-")) | 445 if (name.startsWith("-webkit-")) |
| 445 return PseudoWebKitCustomElement; | 446 return PseudoWebKitCustomElement; |
| 446 if (name.startsWith("cue")) | 447 if (name.startsWith("cue")) |
| 447 return PseudoUserAgentCustomElement; | 448 return PseudoUserAgentCustomElement; |
| 448 | 449 |
| 449 return PseudoUnknown; | 450 return PseudoUnknown; |
| 450 } | 451 } |
| 451 | 452 |
| 452 void CSSSelector::extractPseudoType() const | 453 void CSSSelector::extractPseudoType() const |
| 453 { | 454 { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 469 compat = true; | 470 compat = true; |
| 470 case PseudoBackdrop: | 471 case PseudoBackdrop: |
| 471 case PseudoResizer: | 472 case PseudoResizer: |
| 472 case PseudoScrollbar: | 473 case PseudoScrollbar: |
| 473 case PseudoScrollbarCorner: | 474 case PseudoScrollbarCorner: |
| 474 case PseudoScrollbarButton: | 475 case PseudoScrollbarButton: |
| 475 case PseudoScrollbarThumb: | 476 case PseudoScrollbarThumb: |
| 476 case PseudoScrollbarTrack: | 477 case PseudoScrollbarTrack: |
| 477 case PseudoScrollbarTrackPiece: | 478 case PseudoScrollbarTrackPiece: |
| 478 case PseudoSelection: | 479 case PseudoSelection: |
| 480 case PseudoInternalCustomElement: |
| 479 case PseudoUserAgentCustomElement: | 481 case PseudoUserAgentCustomElement: |
| 480 case PseudoWebKitCustomElement: | 482 case PseudoWebKitCustomElement: |
| 481 case PseudoContent: | 483 case PseudoContent: |
| 482 case PseudoShadow: | 484 case PseudoShadow: |
| 483 element = true; | 485 element = true; |
| 484 break; | 486 break; |
| 485 case PseudoUnknown: | 487 case PseudoUnknown: |
| 486 case PseudoEmpty: | 488 case PseudoEmpty: |
| 487 case PseudoFirstChild: | 489 case PseudoFirstChild: |
| 488 case PseudoFirstOfType: | 490 case PseudoFirstOfType: |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 912 if (count < nthBValue()) | 914 if (count < nthBValue()) |
| 913 return false; | 915 return false; |
| 914 return (count - nthBValue()) % nthAValue() == 0; | 916 return (count - nthBValue()) % nthAValue() == 0; |
| 915 } | 917 } |
| 916 if (count > nthBValue()) | 918 if (count > nthBValue()) |
| 917 return false; | 919 return false; |
| 918 return (nthBValue() - count) % (-nthAValue()) == 0; | 920 return (nthBValue() - count) % (-nthAValue()) == 0; |
| 919 } | 921 } |
| 920 | 922 |
| 921 } // namespace blink | 923 } // namespace blink |
| OLD | NEW |