OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 root->owner()->willAffectSelector(); | 75 root->owner()->willAffectSelector(); |
76 m_shouldParseSelect = true; | 76 m_shouldParseSelect = true; |
77 m_select = value; | 77 m_select = value; |
78 } else { | 78 } else { |
79 InsertionPoint::parseAttribute(name, value); | 79 InsertionPoint::parseAttribute(name, value); |
80 } | 80 } |
81 } | 81 } |
82 | 82 |
83 static inline bool includesDisallowedPseudoClass(const CSSSelector& selector) | 83 static inline bool includesDisallowedPseudoClass(const CSSSelector& selector) |
84 { | 84 { |
85 return selector.match() == CSSSelector::PseudoClass && selector.pseudoType()
!= CSSSelector::PseudoNot; | 85 if (selector.pseudoType() == CSSSelector::PseudoNot) { |
| 86 const CSSSelector* subSelector = selector.selectorList()->first(); |
| 87 return subSelector->match() == CSSSelector::PseudoClass; |
| 88 } |
| 89 return selector.match() == CSSSelector::PseudoClass; |
86 } | 90 } |
87 | 91 |
88 bool HTMLContentElement::validateSelect() const | 92 bool HTMLContentElement::validateSelect() const |
89 { | 93 { |
90 ASSERT(!m_shouldParseSelect); | 94 ASSERT(!m_shouldParseSelect); |
91 | 95 |
92 if (m_select.isNull() || m_select.isEmpty()) | 96 if (m_select.isNull() || m_select.isEmpty()) |
93 return true; | 97 return true; |
94 | 98 |
95 if (!m_selectorList.isValid()) | 99 if (!m_selectorList.isValid()) |
(...skipping 26 matching lines...) Expand all Loading... |
122 bool HTMLContentElement::matchSelector(const WillBeHeapVector<RawPtrWillBeMember
<Node>, 32>& siblings, int nth) const | 126 bool HTMLContentElement::matchSelector(const WillBeHeapVector<RawPtrWillBeMember
<Node>, 32>& siblings, int nth) const |
123 { | 127 { |
124 for (const CSSSelector* selector = selectorList().first(); selector; selecto
r = CSSSelectorList::next(*selector)) { | 128 for (const CSSSelector* selector = selectorList().first(); selector; selecto
r = CSSSelectorList::next(*selector)) { |
125 if (checkOneSelector(*selector, siblings, nth)) | 129 if (checkOneSelector(*selector, siblings, nth)) |
126 return true; | 130 return true; |
127 } | 131 } |
128 return false; | 132 return false; |
129 } | 133 } |
130 | 134 |
131 } | 135 } |
OLD | NEW |