DescriptionFix issue in which removing a class does not always
invalidate style on the element losing the class.
The situation in which it fails is the following:
.class1 .class2 {}
<div class='class1'>
<div id='inner' class='class2'>
</div>
</div>
then code like:
document.querySelector('#inner').className = ''
Previously, an invalidation run would be scheduled, which
calls RuleFeatureSet::invalidateStyleForClassChange, but
since the class that is being mutated does not exist on the
inner element, the variable thisElementNeedsStyleRecalc was
never set to true. What we should do instead is set a local
style recalc on every element which has a pending
invalidation list, because a pending invalidation list means
that code must have done something to that element with
CSSOM, and hence we should assume style needs to be
recomputed. (In fact we do know that for sure since code
excecuted earlier verifies that the CSSOM mutation needs
some sort of style recalc.)
BUG=344376
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=167392
Patch Set 1 #Patch Set 2 : Added more test expectations. #
Total comments: 4
Patch Set 3 : Fixed comments. #
Total comments: 4
Patch Set 4 : Addressed comments. #Patch Set 5 : Fixed bug - was not clearing the NeedsStyleInvalidation bit correctly. #
Messages
Total messages: 15 (0 generated)
|