| 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 case PseudoFullScreenAncestor: | 265 case PseudoFullScreenAncestor: |
| 266 case PseudoSpatialNavigationFocus: | 266 case PseudoSpatialNavigationFocus: |
| 267 case PseudoListBox: | 267 case PseudoListBox: |
| 268 return NOPSEUDO; | 268 return NOPSEUDO; |
| 269 } | 269 } |
| 270 | 270 |
| 271 ASSERT_NOT_REACHED(); | 271 ASSERT_NOT_REACHED(); |
| 272 return NOPSEUDO; | 272 return NOPSEUDO; |
| 273 } | 273 } |
| 274 | 274 |
| 275 // TODO(timloh): Unify with CSSSelectorParser, which also compares pseudo names
as strings | |
| 276 | |
| 277 // Could be made smaller and faster by replacing pointer with an | 275 // Could be made smaller and faster by replacing pointer with an |
| 278 // offset into a string buffer and making the bit fields smaller but | 276 // offset into a string buffer and making the bit fields smaller but |
| 279 // that could not be maintained by hand. | 277 // that could not be maintained by hand. |
| 280 struct NameToPseudoStruct { | 278 struct NameToPseudoStruct { |
| 281 const char* string; | 279 const char* string; |
| 282 unsigned type:8; | 280 unsigned type:8; |
| 283 }; | 281 }; |
| 284 | 282 |
| 285 // These tables should be kept sorted. | 283 // These tables should be kept sorted. |
| 286 const static NameToPseudoStruct pseudoTypeWithoutArgumentsMap[] = { | 284 const static NameToPseudoStruct pseudoTypeWithoutArgumentsMap[] = { |
| (...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 929 if (count < nthBValue()) | 927 if (count < nthBValue()) |
| 930 return false; | 928 return false; |
| 931 return (count - nthBValue()) % nthAValue() == 0; | 929 return (count - nthBValue()) % nthAValue() == 0; |
| 932 } | 930 } |
| 933 if (count > nthBValue()) | 931 if (count > nthBValue()) |
| 934 return false; | 932 return false; |
| 935 return (nthBValue() - count) % (-nthAValue()) == 0; | 933 return (nthBValue() - count) % (-nthAValue()) == 0; |
| 936 } | 934 } |
| 937 | 935 |
| 938 } // namespace blink | 936 } // namespace blink |
| OLD | NEW |