You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Text color is not updated when a class is toggled #7814
I suspect this occurs because modifying the class attribute through the DOMSettableToken list doesn't end up marking the node as dirty. Modifying the class attribute directly goes through this path instead, which would mark it dirty.
Yes, I verified that the node is correctly marked dirty. Also, changing to use .setAttribute("class", ...) or .className = ... does not fix the behavior. The behavior depends on which style property is changed. color and background don't work, but font-size does. Maybe the problem is that we're not triggering the correct sort of incremental layout, or the incremental layout logic is buggy for these properties.
Debugging shows that style recalc runs as expected, and repair_if_possible is called, and correctly repairs the text fragments, but the display list still ends up with the old colors for some reason.
background-color updates correctly on block elements, but not on inline elements. Maybe this is related to Flow::repair_style which is a no-op for InlineFlow.
Disabling incremental layout makes the test case work correctly.
The problem is that repair_if_possible repairs the original UnscannedText fragments from the node's ConstructionResult, rather than the InlineFlow and its ScannedText fragments.
I think this case should just return false; because we can't repair the correct fragment(s) here.
Activity
jdm commentedon Oct 1, 2015
Out of curiosity, does it update if you resize the window or move the mouse over the text?
paulrouget commentedon Oct 1, 2015
If I do something like
:hover{font-size: something}, it updates the color.jdm commentedon Oct 1, 2015
I suspect this occurs because modifying the class attribute through the DOMSettableToken list doesn't end up marking the node as dirty. Modifying the class attribute directly goes through this path instead, which would mark it dirty.
jdm commentedon Oct 1, 2015
I suspect the DOMSettableToken methods that mutate attributes should explicitly mark the relevant element as dirty.
Ms2ger commentedon Oct 1, 2015
That makes no sense. The attribute changing code should handle this; there's even code in
Element::attribute_mutatedthat should.mbrubeck commentedon Oct 1, 2015
Yes, I verified that the node is correctly marked dirty. Also, changing to use
.setAttribute("class", ...)or.className = ...does not fix the behavior. The behavior depends on which style property is changed.colorandbackgrounddon't work, butfont-sizedoes. Maybe the problem is that we're not triggering the correct sort of incremental layout, or the incremental layout logic is buggy for these properties.mbrubeck commentedon Oct 1, 2015
Debugging shows that style recalc runs as expected, and
repair_if_possibleis called, and correctly repairs the text fragments, but the display list still ends up with the old colors for some reason.background-colorupdates correctly on block elements, but not on inline elements. Maybe this is related toFlow::repair_stylewhich is a no-op forInlineFlow.Disabling incremental layout makes the test case work correctly.
mbrubeck commentedon Oct 1, 2015
The problem is that
repair_if_possiblerepairs the original UnscannedText fragments from the node's ConstructionResult, rather than the InlineFlow and its ScannedText fragments.I think this case should just
return false;because we can't repair the correct fragment(s) here.Incremental layout: Don't try to repair text fragment styles
Incremental layout: Don't try to repair text fragment styles
Auto merge of #7821 - mbrubeck:class-damage, r=pcwalton
Auto merge of #7821 - mbrubeck:class-damage, r=pcwalton