Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
| 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r ights reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r ights reserved. |
| 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
| 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) |
| 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
| 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 167 return false; | 167 return false; |
| 168 } | 168 } |
| 169 } | 169 } |
| 170 | 170 |
| 171 bool supportsInvalidationWithSelectorList(CSSSelector::PseudoType pseudo) | 171 bool supportsInvalidationWithSelectorList(CSSSelector::PseudoType pseudo) |
| 172 { | 172 { |
| 173 return pseudo == CSSSelector::PseudoAny | 173 return pseudo == CSSSelector::PseudoAny |
| 174 || pseudo == CSSSelector::PseudoCue | 174 || pseudo == CSSSelector::PseudoCue |
| 175 || pseudo == CSSSelector::PseudoHost | 175 || pseudo == CSSSelector::PseudoHost |
| 176 || pseudo == CSSSelector::PseudoHostContext | 176 || pseudo == CSSSelector::PseudoHostContext |
| 177 || pseudo == CSSSelector::PseudoNot; | 177 || pseudo == CSSSelector::PseudoNot |
| 178 || pseudo == CSSSelector::PseudoSlotted; | |
| 178 } | 179 } |
| 179 | 180 |
| 180 #endif // ENABLE(ASSERT) | 181 #endif // ENABLE(ASSERT) |
| 181 | 182 |
| 182 bool requiresSubtreeInvalidation(const CSSSelector& selector) | 183 bool requiresSubtreeInvalidation(const CSSSelector& selector) |
| 183 { | 184 { |
| 184 if (selector.match() != CSSSelector::PseudoElement && selector.match() != CS SSelector::PseudoClass) { | 185 if (selector.match() != CSSSelector::PseudoElement && selector.match() != CS SSelector::PseudoClass) { |
| 185 ASSERT(supportsInvalidation(selector.match())); | 186 ASSERT(supportsInvalidation(selector.match())); |
| 186 return false; | 187 return false; |
| 187 } | 188 } |
| 188 | 189 |
| 189 switch (selector.pseudoType()) { | 190 switch (selector.pseudoType()) { |
| 190 case CSSSelector::PseudoFirstLine: | 191 case CSSSelector::PseudoFirstLine: |
| 191 case CSSSelector::PseudoFirstLetter: | 192 case CSSSelector::PseudoFirstLetter: |
| 192 // FIXME: Most pseudo classes/elements above can be supported and moved | 193 // FIXME: Most pseudo classes/elements above can be supported and moved |
| 193 // to assertSupportedPseudo(). Move on a case-by-case basis. If they | 194 // to assertSupportedPseudo(). Move on a case-by-case basis. If they |
| 194 // require subtree invalidation, document why. | 195 // require subtree invalidation, document why. |
| 195 case CSSSelector::PseudoHostContext: | 196 case CSSSelector::PseudoHostContext: |
| 196 // :host-context matches a shadow host, yet the simple selectors inside | 197 // :host-context matches a shadow host, yet the simple selectors inside |
| 197 // :host-context matches an ancestor of the shadow host. | 198 // :host-context matches an ancestor of the shadow host. |
| 199 case CSSSelector::PseudoSlotted: | |
|
rune
2015/12/22 14:56:53
This recalculates a bit more than necessary. Shoul
| |
| 198 return true; | 200 return true; |
| 199 default: | 201 default: |
| 200 ASSERT(supportsInvalidation(selector.pseudoType())); | 202 ASSERT(supportsInvalidation(selector.pseudoType())); |
| 201 return false; | 203 return false; |
| 202 } | 204 } |
| 203 } | 205 } |
| 204 | 206 |
| 205 template<class Map> | 207 template<class Map> |
| 206 InvalidationData& ensureInvalidationData(Map& map, const typename Map::KeyType& key) | 208 InvalidationData& ensureInvalidationData(Map& map, const typename Map::KeyType& key) |
| 207 { | 209 { |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 671 | 673 |
| 672 DEFINE_TRACE(RuleFeatureSet) | 674 DEFINE_TRACE(RuleFeatureSet) |
| 673 { | 675 { |
| 674 #if ENABLE(OILPAN) | 676 #if ENABLE(OILPAN) |
| 675 visitor->trace(siblingRules); | 677 visitor->trace(siblingRules); |
| 676 visitor->trace(uncommonAttributeRules); | 678 visitor->trace(uncommonAttributeRules); |
| 677 #endif | 679 #endif |
| 678 } | 680 } |
| 679 | 681 |
| 680 } // namespace blink | 682 } // namespace blink |
| OLD | NEW |