Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(650)

Unified Diff: Source/core/css/RuleFeature.cpp

Issue 170873004: Fix issue in which removing a class does not always invalidate style (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed comments. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/virtual/targetedstylerecalc/fast/css/invalidation/targeted-class-style-invalidation-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/RuleFeature.cpp
diff --git a/Source/core/css/RuleFeature.cpp b/Source/core/css/RuleFeature.cpp
index b52569a0034cea47262ee54d626699f31eaf38c5..ea0edf74cc9cbe28cbadd82f0fc6e94542f40c6f 100644
--- a/Source/core/css/RuleFeature.cpp
+++ b/Source/core/css/RuleFeature.cpp
@@ -380,9 +380,12 @@ bool RuleFeatureSet::invalidateStyleForClassChangeOnChildren(Element* element, V
bool RuleFeatureSet::invalidateStyleForClassChange(Element* element, Vector<AtomicString>& invalidationClasses, bool foundInvalidationSet)
{
+ bool thisElementNeedsStyleRecalc = false;
int oldSize = invalidationClasses.size();
+
if (element->needsStyleInvalidation()) {
if (InvalidationList* invalidationList = m_pendingInvalidationMap.get(element)) {
+ thisElementNeedsStyleRecalc = true;
foundInvalidationSet = true;
esprehn 2014/02/18 22:52:33 Isn't this bool identical to foundInvalidationSet
chrishtr 2014/02/18 23:14:31 No, because not all elements in the subtree of an
for (InvalidationList::const_iterator it = invalidationList->begin(); it != invalidationList->end(); ++it) {
if ((*it)->wholeSubtreeInvalid()) {
@@ -396,8 +399,6 @@ bool RuleFeatureSet::invalidateStyleForClassChange(Element* element, Vector<Atom
}
}
- bool thisElementNeedsStyleRecalc = false;
-
if (element->hasClass()) {
const SpaceSplitString& classNames = element->classNames();
for (Vector<AtomicString>::const_iterator it = invalidationClasses.begin(); it != invalidationClasses.end(); ++it) {
« no previous file with comments | « LayoutTests/virtual/targetedstylerecalc/fast/css/invalidation/targeted-class-style-invalidation-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698