| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011, 2013 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2014 Samsung Electronics. All rights reserved. | 3 * Copyright (C) 2014 Samsung Electronics. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 { | 106 { |
| 107 DCHECK(m_selectors.isEmpty()); | 107 DCHECK(m_selectors.isEmpty()); |
| 108 | 108 |
| 109 unsigned selectorCount = 0; | 109 unsigned selectorCount = 0; |
| 110 for (const CSSSelector* selector = selectorList.first(); selector; selector
= CSSSelectorList::next(*selector)) | 110 for (const CSSSelector* selector = selectorList.first(); selector; selector
= CSSSelectorList::next(*selector)) |
| 111 selectorCount++; | 111 selectorCount++; |
| 112 | 112 |
| 113 m_usesDeepCombinatorOrShadowPseudo = false; | 113 m_usesDeepCombinatorOrShadowPseudo = false; |
| 114 m_needsUpdatedDistribution = false; | 114 m_needsUpdatedDistribution = false; |
| 115 m_selectors.reserveInitialCapacity(selectorCount); | 115 m_selectors.reserveInitialCapacity(selectorCount); |
| 116 unsigned index = 0; | 116 for (const CSSSelector* selector = selectorList.first(); selector; selector
= CSSSelectorList::next(*selector)) { |
| 117 for (const CSSSelector* selector = selectorList.first(); selector; selector
= CSSSelectorList::next(*selector), ++index) { | |
| 118 if (selector->matchesPseudoElement()) | 117 if (selector->matchesPseudoElement()) |
| 119 continue; | 118 continue; |
| 120 m_selectors.uncheckedAppend(selector); | 119 m_selectors.uncheckedAppend(selector); |
| 121 m_usesDeepCombinatorOrShadowPseudo |= selectorList.selectorUsesDeepCombi
natorOrShadowPseudo(index); | 120 m_usesDeepCombinatorOrShadowPseudo |= selector->hasDeepCombinatorOrShado
wPseudo(); |
| 122 m_needsUpdatedDistribution |= selectorList.selectorNeedsUpdatedDistribut
ion(index); | 121 m_needsUpdatedDistribution |= selector->needsUpdatedDistribution(); |
| 123 } | 122 } |
| 124 } | 123 } |
| 125 | 124 |
| 126 inline bool SelectorDataList::selectorMatches(const CSSSelector& selector, Eleme
nt& element, const ContainerNode& rootNode) const | 125 inline bool SelectorDataList::selectorMatches(const CSSSelector& selector, Eleme
nt& element, const ContainerNode& rootNode) const |
| 127 { | 126 { |
| 128 SelectorChecker::Init init; | 127 SelectorChecker::Init init; |
| 129 init.mode = SelectorChecker::QueryingRules; | 128 init.mode = SelectorChecker::QueryingRules; |
| 130 init.isQuerySelector = true; | 129 init.isQuerySelector = true; |
| 131 SelectorChecker checker(init); | 130 SelectorChecker checker(init); |
| 132 SelectorChecker::SelectorCheckingContext context(&element, SelectorChecker::
VisitedMatchDisabled); | 131 SelectorChecker::SelectorCheckingContext context(&element, SelectorChecker::
VisitedMatchDisabled); |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 | 586 |
| 588 return m_entries.add(selectors, SelectorQuery::adopt(std::move(selectorList)
)).storedValue->value.get(); | 587 return m_entries.add(selectors, SelectorQuery::adopt(std::move(selectorList)
)).storedValue->value.get(); |
| 589 } | 588 } |
| 590 | 589 |
| 591 void SelectorQueryCache::invalidate() | 590 void SelectorQueryCache::invalidate() |
| 592 { | 591 { |
| 593 m_entries.clear(); | 592 m_entries.clear(); |
| 594 } | 593 } |
| 595 | 594 |
| 596 } // namespace blink | 595 } // namespace blink |
| OLD | NEW |