| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 bool RuleFeatureSet::updateClassInvalidationSets(const CSSSelector& selector) | 103 bool RuleFeatureSet::updateClassInvalidationSets(const CSSSelector& selector) |
| 104 { | 104 { |
| 105 if (!supportsClassDescendantInvalidation(selector)) | 105 if (!supportsClassDescendantInvalidation(selector)) |
| 106 return false; | 106 return false; |
| 107 | 107 |
| 108 Vector<AtomicString> classes; | 108 Vector<AtomicString> classes; |
| 109 AtomicString id; | 109 AtomicString id; |
| 110 AtomicString tagName; | 110 AtomicString tagName; |
| 111 | 111 |
| 112 const CSSSelector* lastSelector = &selector; | 112 const CSSSelector* lastSelector = &selector; |
| 113 for (; lastSelector->relation() == CSSSelector::SubSelector; lastSelector =
lastSelector->tagHistory()) { | 113 for (; lastSelector; lastSelector = lastSelector->tagHistory()) { |
| 114 extractClassIdOrTag(*lastSelector, classes, id, tagName); | 114 extractClassIdOrTag(*lastSelector, classes, id, tagName); |
| 115 if (lastSelector->m_match == CSSSelector::Class) |
| 116 ensureClassInvalidationSet(lastSelector->value()); |
| 117 if (lastSelector->relation() != CSSSelector::SubSelector) |
| 118 break; |
| 115 } | 119 } |
| 116 extractClassIdOrTag(*lastSelector, classes, id, tagName); | |
| 117 | 120 |
| 118 for (const CSSSelector* current = &selector ; current; current = current->ta
gHistory()) { | 121 if (!lastSelector) |
| 122 return true; |
| 123 |
| 124 for (const CSSSelector* current = lastSelector->tagHistory(); current; curre
nt = current->tagHistory()) { |
| 119 if (current->m_match == CSSSelector::Class) { | 125 if (current->m_match == CSSSelector::Class) { |
| 120 DescendantInvalidationSet& invalidationSet = ensureClassInvalidation
Set(current->value()); | 126 DescendantInvalidationSet& invalidationSet = ensureClassInvalidation
Set(current->value()); |
| 121 if (!id.isEmpty()) | 127 if (!id.isEmpty()) |
| 122 invalidationSet.addId(id); | 128 invalidationSet.addId(id); |
| 123 if (!tagName.isEmpty()) | 129 if (!tagName.isEmpty()) |
| 124 invalidationSet.addTagName(tagName); | 130 invalidationSet.addTagName(tagName); |
| 125 for (Vector<AtomicString>::const_iterator it = classes.begin(); it !
= classes.end(); ++it) { | 131 for (Vector<AtomicString>::const_iterator it = classes.begin(); it !
= classes.end(); ++it) { |
| 126 invalidationSet.addClass(*it); | 132 invalidationSet.addClass(*it); |
| 127 } | 133 } |
| 128 } | 134 } |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 } | 424 } |
| 419 | 425 |
| 420 invalidationClasses.remove(oldSize, invalidationClasses.size() - oldSize); | 426 invalidationClasses.remove(oldSize, invalidationClasses.size() - oldSize); |
| 421 element->clearChildNeedsStyleInvalidation(); | 427 element->clearChildNeedsStyleInvalidation(); |
| 422 element->clearNeedsStyleInvalidation(); | 428 element->clearNeedsStyleInvalidation(); |
| 423 | 429 |
| 424 return thisElementNeedsStyleRecalc; | 430 return thisElementNeedsStyleRecalc; |
| 425 } | 431 } |
| 426 | 432 |
| 427 } // namespace WebCore | 433 } // namespace WebCore |
| OLD | NEW |