| 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 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 #include "core/css/CSSSelector.h" | 27 #include "core/css/CSSSelector.h" |
| 28 | 28 |
| 29 #include "core/HTMLNames.h" | 29 #include "core/HTMLNames.h" |
| 30 #include "core/css/CSSMarkup.h" | 30 #include "core/css/CSSMarkup.h" |
| 31 #include "core/css/CSSSelectorList.h" | 31 #include "core/css/CSSSelectorList.h" |
| 32 #include "platform/RuntimeEnabledFeatures.h" | 32 #include "platform/RuntimeEnabledFeatures.h" |
| 33 #include "wtf/Assertions.h" | 33 #include "wtf/Assertions.h" |
| 34 #include "wtf/HashMap.h" | 34 #include "wtf/HashMap.h" |
| 35 #include "wtf/SizeAssertions.h" |
| 35 #include "wtf/StdLibExtras.h" | 36 #include "wtf/StdLibExtras.h" |
| 36 #include "wtf/text/StringBuilder.h" | 37 #include "wtf/text/StringBuilder.h" |
| 37 #include <algorithm> | 38 #include <algorithm> |
| 38 | 39 |
| 39 #ifndef NDEBUG | 40 #ifndef NDEBUG |
| 40 #include <stdio.h> | 41 #include <stdio.h> |
| 41 #endif | 42 #endif |
| 42 | 43 |
| 43 namespace blink { | 44 namespace blink { |
| 44 | 45 |
| 45 using namespace HTMLNames; | 46 using namespace HTMLNames; |
| 46 | 47 |
| 47 struct SameSizeAsCSSSelector { | 48 ASSERT_SIZE(CSSSelector, 8, 16); |
| 48 unsigned bitfields; | |
| 49 void* pointers[1]; | |
| 50 }; | |
| 51 | |
| 52 static_assert(sizeof(CSSSelector) == sizeof(SameSizeAsCSSSelector), "CSSSelector
should stay small"); | |
| 53 | 49 |
| 54 void CSSSelector::createRareData() | 50 void CSSSelector::createRareData() |
| 55 { | 51 { |
| 56 ASSERT(m_match != Tag); | 52 ASSERT(m_match != Tag); |
| 57 if (m_hasRareData) | 53 if (m_hasRareData) |
| 58 return; | 54 return; |
| 59 AtomicString value(m_data.m_value); | 55 AtomicString value(m_data.m_value); |
| 60 if (m_data.m_value) | 56 if (m_data.m_value) |
| 61 m_data.m_value->deref(); | 57 m_data.m_value->deref(); |
| 62 m_data.m_rareData = RareData::create(value).leakRef(); | 58 m_data.m_rareData = RareData::create(value).leakRef(); |
| (...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 924 if (count < nthBValue()) | 920 if (count < nthBValue()) |
| 925 return false; | 921 return false; |
| 926 return (count - nthBValue()) % nthAValue() == 0; | 922 return (count - nthBValue()) % nthAValue() == 0; |
| 927 } | 923 } |
| 928 if (count > nthBValue()) | 924 if (count > nthBValue()) |
| 929 return false; | 925 return false; |
| 930 return (nthBValue() - count) % (-nthAValue()) == 0; | 926 return (nthBValue() - count) % (-nthAValue()) == 0; |
| 931 } | 927 } |
| 932 | 928 |
| 933 } // namespace blink | 929 } // namespace blink |
| OLD | NEW |