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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 123 bool foundIdent = false; | 123 bool foundIdent = false; |
| 124 for (const CSSSelector* component = &selector; component; component = compon ent->tagHistory()) { | 124 for (const CSSSelector* component = &selector; component; component = compon ent->tagHistory()) { |
| 125 | 125 |
| 126 if (component->match() == CSSSelector::Class || component->match() == CS SSelector::Id | 126 if (component->match() == CSSSelector::Class || component->match() == CS SSelector::Id |
| 127 || (component->match() == CSSSelector::Tag && component->tagQName(). localName() != starAtom) | 127 || (component->match() == CSSSelector::Tag && component->tagQName(). localName() != starAtom) |
| 128 || component->isAttributeSelector() || component->isCustomPseudoElem ent()) { | 128 || component->isAttributeSelector() || component->isCustomPseudoElem ent()) { |
| 129 if (!foundCombinator) | 129 if (!foundCombinator) |
| 130 foundIdent = true; | 130 foundIdent = true; |
| 131 } else if (component->pseudoType() == CSSSelector::PseudoHost || compone nt->pseudoType() == CSSSelector::PseudoAny) { | 131 } else if (component->pseudoType() == CSSSelector::PseudoHost || compone nt->pseudoType() == CSSSelector::PseudoAny) { |
| 132 if (const CSSSelectorList* selectorList = component->selectorList()) { | 132 if (const CSSSelectorList* selectorList = component->selectorList()) { |
| 133 bool foundUniversal = false; | |
| 133 for (const CSSSelector* selector = selectorList->first(); select or; selector = CSSSelectorList::next(*selector)) { | 134 for (const CSSSelector* selector = selectorList->first(); select or; selector = CSSSelectorList::next(*selector)) { |
| 134 InvalidationSetMode hostMode = invalidationSetModeForSelecto r(*selector); | 135 InvalidationSetMode hostMode = invalidationSetModeForSelecto r(*selector); |
| 135 if (hostMode == UseSubtreeStyleChange) | 136 if (hostMode == UseSubtreeStyleChange) |
| 136 return foundCombinator ? UseLocalStyleChange : UseSubtre eStyleChange; | 137 return foundCombinator ? UseLocalStyleChange : UseSubtre eStyleChange; |
| 137 if (!foundCombinator && hostMode == AddFeatures) | 138 if (hostMode == UseLocalStyleChange || component->pseudoType () == CSSSelector::PseudoNot) |
|
rune
2014/07/10 21:49:20
The PseudoNot check sneaked its way in from anothe
rune
2014/07/10 21:50:46
Done.
| |
| 138 foundIdent = true; | 139 foundUniversal = true; |
| 139 } | 140 } |
| 141 if (!foundUniversal && !foundCombinator) | |
| 142 foundIdent = true; | |
| 140 } | 143 } |
| 141 } else if (!isSkippableComponentForInvalidation(*component)) { | 144 } else if (!isSkippableComponentForInvalidation(*component)) { |
| 142 return foundCombinator ? UseLocalStyleChange : UseSubtreeStyleChange ; | 145 return foundCombinator ? UseLocalStyleChange : UseSubtreeStyleChange ; |
| 143 } | 146 } |
| 144 if (component->relation() != CSSSelector::SubSelector) | 147 if (component->relation() != CSSSelector::SubSelector) |
| 145 foundCombinator = true; | 148 foundCombinator = true; |
| 146 } | 149 } |
| 147 return foundIdent ? AddFeatures : UseLocalStyleChange; | 150 return foundIdent ? AddFeatures : UseLocalStyleChange; |
| 148 } | 151 } |
| 149 | 152 |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 506 visitor->trace(siblingRules); | 509 visitor->trace(siblingRules); |
| 507 visitor->trace(uncommonAttributeRules); | 510 visitor->trace(uncommonAttributeRules); |
| 508 visitor->trace(m_classInvalidationSets); | 511 visitor->trace(m_classInvalidationSets); |
| 509 visitor->trace(m_attributeInvalidationSets); | 512 visitor->trace(m_attributeInvalidationSets); |
| 510 visitor->trace(m_idInvalidationSets); | 513 visitor->trace(m_idInvalidationSets); |
| 511 visitor->trace(m_pseudoInvalidationSets); | 514 visitor->trace(m_pseudoInvalidationSets); |
| 512 visitor->trace(m_styleInvalidator); | 515 visitor->trace(m_styleInvalidator); |
| 513 } | 516 } |
| 514 | 517 |
| 515 } // namespace WebCore | 518 } // namespace WebCore |
| OLD | NEW |