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