| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 case CSSSelector::PseudoInRange: | 138 case CSSSelector::PseudoInRange: |
| 139 case CSSSelector::PseudoOutOfRange: | 139 case CSSSelector::PseudoOutOfRange: |
| 140 case CSSSelector::PseudoWebKitCustomElement: | 140 case CSSSelector::PseudoWebKitCustomElement: |
| 141 case CSSSelector::PseudoCue: | 141 case CSSSelector::PseudoCue: |
| 142 case CSSSelector::PseudoFutureCue: | 142 case CSSSelector::PseudoFutureCue: |
| 143 case CSSSelector::PseudoPastCue: | 143 case CSSSelector::PseudoPastCue: |
| 144 case CSSSelector::PseudoUnresolved: | 144 case CSSSelector::PseudoUnresolved: |
| 145 case CSSSelector::PseudoContent: | 145 case CSSSelector::PseudoContent: |
| 146 case CSSSelector::PseudoHost: | 146 case CSSSelector::PseudoHost: |
| 147 case CSSSelector::PseudoShadow: | 147 case CSSSelector::PseudoShadow: |
| 148 case CSSSelector::PseudoSpatialNavigationFocus: |
| 148 case CSSSelector::PseudoListBox: | 149 case CSSSelector::PseudoListBox: |
| 149 return true; | 150 return true; |
| 150 case CSSSelector::PseudoNotParsed: | 151 case CSSSelector::PseudoNotParsed: |
| 151 case CSSSelector::PseudoUnknown: | 152 case CSSSelector::PseudoUnknown: |
| 152 case CSSSelector::PseudoLeftPage: | 153 case CSSSelector::PseudoLeftPage: |
| 153 case CSSSelector::PseudoRightPage: | 154 case CSSSelector::PseudoRightPage: |
| 154 case CSSSelector::PseudoFirstPage: | 155 case CSSSelector::PseudoFirstPage: |
| 155 // These should not appear in StyleRule selectors. | 156 // These should not appear in StyleRule selectors. |
| 156 ASSERT_NOT_REACHED(); | 157 ASSERT_NOT_REACHED(); |
| 157 return false; | 158 return false; |
| 158 default: | 159 default: |
| 159 // New pseudo type added. Figure out if it needs a subtree invalidation
or not. | 160 // New pseudo type added. Figure out if it needs a subtree invalidation
or not. |
| 160 ASSERT_NOT_REACHED(); | 161 ASSERT_NOT_REACHED(); |
| 161 return false; | 162 return false; |
| 162 } | 163 } |
| 163 } | 164 } |
| 164 | 165 |
| 165 #endif // ENABLE(ASSERT) | 166 #endif // ENABLE(ASSERT) |
| 166 | 167 |
| 167 static bool requiresSubtreeInvalidation(const CSSSelector& selector) | 168 static bool requiresSubtreeInvalidation(const CSSSelector& selector) |
| 168 { | 169 { |
| 169 if (!selector.matchesPseudoElement() && selector.match() != CSSSelector::Pse
udoClass) { | 170 if (!selector.matchesPseudoElement() && selector.match() != CSSSelector::Pse
udoClass) { |
| 170 ASSERT(supportsInvalidation(selector.match())); | 171 ASSERT(supportsInvalidation(selector.match())); |
| 171 return false; | 172 return false; |
| 172 } | 173 } |
| 173 | 174 |
| 174 switch (selector.pseudoType()) { | 175 switch (selector.pseudoType()) { |
| 175 case CSSSelector::PseudoFirstLine: | 176 case CSSSelector::PseudoFirstLine: |
| 176 case CSSSelector::PseudoFirstLetter: | 177 case CSSSelector::PseudoFirstLetter: |
| 177 case CSSSelector::PseudoSpatialNavigationFocus: | |
| 178 // FIXME: Most pseudo classes/elements above can be supported and moved | 178 // FIXME: Most pseudo classes/elements above can be supported and moved |
| 179 // to assertSupportedPseudo(). Move on a case-by-case basis. If they | 179 // to assertSupportedPseudo(). Move on a case-by-case basis. If they |
| 180 // require subtree invalidation, document why. | 180 // require subtree invalidation, document why. |
| 181 case CSSSelector::PseudoHostContext: | 181 case CSSSelector::PseudoHostContext: |
| 182 // :host-context matches a shadow host, yet the simple selectors inside | 182 // :host-context matches a shadow host, yet the simple selectors inside |
| 183 // :host-context matches an ancestor of the shadow host. | 183 // :host-context matches an ancestor of the shadow host. |
| 184 return true; | 184 return true; |
| 185 default: | 185 default: |
| 186 ASSERT(supportsInvalidation(selector.pseudoType())); | 186 ASSERT(supportsInvalidation(selector.pseudoType())); |
| 187 return false; | 187 return false; |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 visitor->trace(uncommonAttributeRules); | 653 visitor->trace(uncommonAttributeRules); |
| 654 visitor->trace(m_classInvalidationSets); | 654 visitor->trace(m_classInvalidationSets); |
| 655 visitor->trace(m_attributeInvalidationSets); | 655 visitor->trace(m_attributeInvalidationSets); |
| 656 visitor->trace(m_idInvalidationSets); | 656 visitor->trace(m_idInvalidationSets); |
| 657 visitor->trace(m_pseudoInvalidationSets); | 657 visitor->trace(m_pseudoInvalidationSets); |
| 658 visitor->trace(m_styleInvalidator); | 658 visitor->trace(m_styleInvalidator); |
| 659 #endif | 659 #endif |
| 660 } | 660 } |
| 661 | 661 |
| 662 } // namespace blink | 662 } // namespace blink |
| OLD | NEW |