| 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 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 #include "core/HTMLNames.h" | 28 #include "core/HTMLNames.h" |
| 29 #include "core/css/CSSMarkup.h" | 29 #include "core/css/CSSMarkup.h" |
| 30 #include "core/css/CSSSelectorList.h" | 30 #include "core/css/CSSSelectorList.h" |
| 31 #include "platform/RuntimeEnabledFeatures.h" | 31 #include "platform/RuntimeEnabledFeatures.h" |
| 32 #include "wtf/Assertions.h" | 32 #include "wtf/Assertions.h" |
| 33 #include "wtf/HashMap.h" | 33 #include "wtf/HashMap.h" |
| 34 #include "wtf/StdLibExtras.h" | 34 #include "wtf/StdLibExtras.h" |
| 35 #include "wtf/text/StringBuilder.h" | 35 #include "wtf/text/StringBuilder.h" |
| 36 #include <algorithm> | 36 #include <algorithm> |
| 37 #include <memory> |
| 37 | 38 |
| 38 #ifndef NDEBUG | 39 #ifndef NDEBUG |
| 39 #include <stdio.h> | 40 #include <stdio.h> |
| 40 #endif | 41 #endif |
| 41 | 42 |
| 42 namespace blink { | 43 namespace blink { |
| 43 | 44 |
| 44 using namespace HTMLNames; | 45 using namespace HTMLNames; |
| 45 | 46 |
| 46 struct SameSizeAsCSSSelector { | 47 struct SameSizeAsCSSSelector { |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 m_data.m_rareData->m_attribute = value; | 760 m_data.m_rareData->m_attribute = value; |
| 760 m_data.m_rareData->m_bits.m_attributeMatch = matchType; | 761 m_data.m_rareData->m_bits.m_attributeMatch = matchType; |
| 761 } | 762 } |
| 762 | 763 |
| 763 void CSSSelector::setArgument(const AtomicString& value) | 764 void CSSSelector::setArgument(const AtomicString& value) |
| 764 { | 765 { |
| 765 createRareData(); | 766 createRareData(); |
| 766 m_data.m_rareData->m_argument = value; | 767 m_data.m_rareData->m_argument = value; |
| 767 } | 768 } |
| 768 | 769 |
| 769 void CSSSelector::setSelectorList(PassOwnPtr<CSSSelectorList> selectorList) | 770 void CSSSelector::setSelectorList(std::unique_ptr<CSSSelectorList> selectorList) |
| 770 { | 771 { |
| 771 createRareData(); | 772 createRareData(); |
| 772 m_data.m_rareData->m_selectorList = std::move(selectorList); | 773 m_data.m_rareData->m_selectorList = std::move(selectorList); |
| 773 } | 774 } |
| 774 | 775 |
| 775 static bool validateSubSelector(const CSSSelector* selector) | 776 static bool validateSubSelector(const CSSSelector* selector) |
| 776 { | 777 { |
| 777 switch (selector->match()) { | 778 switch (selector->match()) { |
| 778 case CSSSelector::Tag: | 779 case CSSSelector::Tag: |
| 779 case CSSSelector::Id: | 780 case CSSSelector::Id: |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 if (count < nthBValue()) | 934 if (count < nthBValue()) |
| 934 return false; | 935 return false; |
| 935 return (count - nthBValue()) % nthAValue() == 0; | 936 return (count - nthBValue()) % nthAValue() == 0; |
| 936 } | 937 } |
| 937 if (count > nthBValue()) | 938 if (count > nthBValue()) |
| 938 return false; | 939 return false; |
| 939 return (nthBValue() - count) % (-nthAValue()) == 0; | 940 return (nthBValue() - count) % (-nthAValue()) == 0; |
| 940 } | 941 } |
| 941 | 942 |
| 942 } // namespace blink | 943 } // namespace blink |
| OLD | NEW |