a reminder about nsStyle*::CalcDifference methods

"L. David Baron" <[email protected]>
Newsgroups gmane.comp.mozilla.devel.layout
Message-ID <[email protected]>
A reminder (or perhaps first warning) for those adding or reviewing
code to add new CSS properties or change their dynamic change
handling:

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.)

-David

-- 
𝄞   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
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout
signature.asc (application/pgp-signature, 819 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCAAGBQJV8R2fAAoJEO/hYSUPhPwh5M4P/2pRp7KmGFnf8NWMCNz7SfK7
5sk+U7SbUyG7x7XLpQbSINP294qg/dy1R3p1HK3Xz+jbSj8AnHJliKrYZIRiY5f9
aMipy87UyWupkO2pATRPhPRoUTT4AwboPW3YUzX9plfs9GRfrm60reJgVenNxqsM
eMoqaBuHj9vCSZarfuJKWVvNHeXCyxNw4iyiHlRbDiSGq12Vdn+hO6+1RBMwdE+p
YhAv5i/tsTvuPgFh31R51NwBJhEhBKovTiQpCxfuGa7FVeEtyEMmigSoUFIAezp+
BrsCx4PDdX6EyUNq8eZTYGNnEVZ3XlsGWFwnDwVZA9e6cTjvB4rPTest/axxjmi+
II95Zkb6M5XlzvOiY4UrMnFp1ninpJBOp7aUhVmR+u3lwNLU/m2CENcf27q6pEm0
i4iKVZBANzj5jNInK4ZJxygX2KxznGHPWFahkOUjLfs2b7IcA294Yx1R97gdDxX6
aURuqhPQkNuqahk67hoV7AoArO7Wutn9dZevcH7BGs7J/SxhuixuHuXd4TBV36Qq
7xRlSNwjJqtY54gDpxiV6YNbK6sgltWI9J4JomU2u35qpxXURrYxBkiXAX7DhPBG
XVpy2DPdz/5eCc9NoMLyG+a6ImL9F5hmc7thS1T9yJkfi9IBOXc60muOkzLouAOf
QMQ0hQpiJbmoy28lsphT
=Ridj
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.