a reminder about nsStyle*::CalcDifference methods

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

a reminder about nsStyle*::CalcDifference methods

L. David Baron
A reminder (or perhaps first warning) for those adding or reviewing
code to add new CSS properties or change their dynamic change

Since https://bugzilla.mozilla.org/show_bug.cgi?id=931668 landed,
nsStyle*::CalcDifference methods are required to return a non-zero
change hint if there is *any* change in the data between the style
structs.  If there is a change that needs no handling, they should
return nsChangeHint_NeutralChange.

(If you forget this, the style system might optimize away changes of
the CSS properties in question, in unexpected and seemingly-random
ways.  See https://bugzilla.mozilla.org/show_bug.cgi?id=1176782#c4
to #c15 for an example.)


𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                          https://www.mozilla.org/   𝄂
             Before I built a wall I'd ask to know
             What I was walling in or walling out,
             And to whom I was like to give offense.
               - Robert Frost, Mending Wall (1914)

dev-tech-layout mailing list
[hidden email]

signature.asc (836 bytes) Download Attachment