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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 void RuleFeatureSet::scheduleStyleInvalidationForClassChange(const SpaceSplitStr
ing& changedClasses, Element& element) | 439 void RuleFeatureSet::scheduleStyleInvalidationForClassChange(const SpaceSplitStr
ing& changedClasses, Element& element) |
440 { | 440 { |
441 unsigned changedSize = changedClasses.size(); | 441 unsigned changedSize = changedClasses.size(); |
442 for (unsigned i = 0; i < changedSize; ++i) { | 442 for (unsigned i = 0; i < changedSize; ++i) { |
443 addClassToInvalidationSet(changedClasses[i], element); | 443 addClassToInvalidationSet(changedClasses[i], element); |
444 } | 444 } |
445 } | 445 } |
446 | 446 |
447 void RuleFeatureSet::scheduleStyleInvalidationForClassChange(const SpaceSplitStr
ing& oldClasses, const SpaceSplitString& newClasses, Element& element) | 447 void RuleFeatureSet::scheduleStyleInvalidationForClassChange(const SpaceSplitStr
ing& oldClasses, const SpaceSplitString& newClasses, Element& element) |
448 { | 448 { |
449 if (!oldClasses.size()) | 449 if (!oldClasses.size()) { |
450 scheduleStyleInvalidationForClassChange(newClasses, element); | 450 scheduleStyleInvalidationForClassChange(newClasses, element); |
| 451 return; |
| 452 } |
451 | 453 |
452 // Class vectors tend to be very short. This is faster than using a hash tab
le. | 454 // Class vectors tend to be very short. This is faster than using a hash tab
le. |
453 BitVector remainingClassBits; | 455 BitVector remainingClassBits; |
454 remainingClassBits.ensureSize(oldClasses.size()); | 456 remainingClassBits.ensureSize(oldClasses.size()); |
455 | 457 |
456 for (unsigned i = 0; i < newClasses.size(); ++i) { | 458 for (unsigned i = 0; i < newClasses.size(); ++i) { |
457 bool found = false; | 459 bool found = false; |
458 for (unsigned j = 0; j < oldClasses.size(); ++j) { | 460 for (unsigned j = 0; j < oldClasses.size(); ++j) { |
459 if (newClasses[i] == oldClasses[j]) { | 461 if (newClasses[i] == oldClasses[j]) { |
460 // Mark each class that is still in the newClasses so we can ski
p doing | 462 // Mark each class that is still in the newClasses so we can ski
p doing |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 visitor->trace(siblingRules); | 520 visitor->trace(siblingRules); |
519 visitor->trace(uncommonAttributeRules); | 521 visitor->trace(uncommonAttributeRules); |
520 visitor->trace(m_classInvalidationSets); | 522 visitor->trace(m_classInvalidationSets); |
521 visitor->trace(m_attributeInvalidationSets); | 523 visitor->trace(m_attributeInvalidationSets); |
522 visitor->trace(m_idInvalidationSets); | 524 visitor->trace(m_idInvalidationSets); |
523 visitor->trace(m_pseudoInvalidationSets); | 525 visitor->trace(m_pseudoInvalidationSets); |
524 visitor->trace(m_styleInvalidator); | 526 visitor->trace(m_styleInvalidator); |
525 } | 527 } |
526 | 528 |
527 } // namespace WebCore | 529 } // namespace WebCore |
OLD | NEW |