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

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: Added more test expectations. 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
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)) {
ojan 2014/02/18 22:53:39 Aside: How can this be null? Instead of being an "
chrishtr 2014/02/18 23:19:13 Done.
+ thisElementNeedsStyleRecalc = true;
foundInvalidationSet = true;
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) {

Powered by Google App Engine
This is Rietveld 408576698