| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 } | 56 } |
| 57 | 57 |
| 58 DEFINE_TRACE(HTMLContentElement) | 58 DEFINE_TRACE(HTMLContentElement) |
| 59 { | 59 { |
| 60 visitor->trace(m_filter); | 60 visitor->trace(m_filter); |
| 61 InsertionPoint::trace(visitor); | 61 InsertionPoint::trace(visitor); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void HTMLContentElement::parseSelect() | 64 void HTMLContentElement::parseSelect() |
| 65 { | 65 { |
| 66 ASSERT(m_shouldParseSelect); | 66 DCHECK(m_shouldParseSelect); |
| 67 | 67 |
| 68 m_selectorList = CSSParser::parseSelector(CSSParserContext(document(), nullp
tr), nullptr, m_select); | 68 m_selectorList = CSSParser::parseSelector(CSSParserContext(document(), nullp
tr), nullptr, m_select); |
| 69 m_shouldParseSelect = false; | 69 m_shouldParseSelect = false; |
| 70 m_isValidSelector = validateSelect(); | 70 m_isValidSelector = validateSelect(); |
| 71 if (!m_isValidSelector) | 71 if (!m_isValidSelector) |
| 72 m_selectorList = CSSSelectorList(); | 72 m_selectorList = CSSSelectorList(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void HTMLContentElement::parseAttribute(const QualifiedName& name, const AtomicS
tring& oldValue, const AtomicString& value) | 75 void HTMLContentElement::parseAttribute(const QualifiedName& name, const AtomicS
tring& oldValue, const AtomicString& value) |
| 76 { | 76 { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 90 { | 90 { |
| 91 if (selector.getPseudoType() == CSSSelector::PseudoNot) { | 91 if (selector.getPseudoType() == CSSSelector::PseudoNot) { |
| 92 const CSSSelector* subSelector = selector.selectorList()->first(); | 92 const CSSSelector* subSelector = selector.selectorList()->first(); |
| 93 return subSelector->match() == CSSSelector::PseudoClass; | 93 return subSelector->match() == CSSSelector::PseudoClass; |
| 94 } | 94 } |
| 95 return selector.match() == CSSSelector::PseudoClass; | 95 return selector.match() == CSSSelector::PseudoClass; |
| 96 } | 96 } |
| 97 | 97 |
| 98 bool HTMLContentElement::validateSelect() const | 98 bool HTMLContentElement::validateSelect() const |
| 99 { | 99 { |
| 100 ASSERT(!m_shouldParseSelect); | 100 DCHECK(!m_shouldParseSelect); |
| 101 | 101 |
| 102 if (m_select.isNull() || m_select.isEmpty()) | 102 if (m_select.isNull() || m_select.isEmpty()) |
| 103 return true; | 103 return true; |
| 104 | 104 |
| 105 if (!m_selectorList.isValid()) | 105 if (!m_selectorList.isValid()) |
| 106 return false; | 106 return false; |
| 107 | 107 |
| 108 for (const CSSSelector* selector = m_selectorList.first(); selector; selecto
r = m_selectorList.next(*selector)) { | 108 for (const CSSSelector* selector = m_selectorList.first(); selector; selecto
r = m_selectorList.next(*selector)) { |
| 109 if (!selector->isCompound()) | 109 if (!selector->isCompound()) |
| 110 return false; | 110 return false; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 127 SelectorChecker::SelectorCheckingContext context(&element, SelectorChecker::
VisitedMatchDisabled); | 127 SelectorChecker::SelectorCheckingContext context(&element, SelectorChecker::
VisitedMatchDisabled); |
| 128 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)) { |
| 129 context.selector = selector; | 129 context.selector = selector; |
| 130 if (checker.match(context)) | 130 if (checker.match(context)) |
| 131 return true; | 131 return true; |
| 132 } | 132 } |
| 133 return false; | 133 return false; |
| 134 } | 134 } |
| 135 | 135 |
| 136 } // namespace blink | 136 } // namespace blink |
| OLD | NEW |