Skip to content
  • Emilio Cobos Álvarez's avatar
    Bug 1620359 - Don't clear the "uses viewport units" bit when a font that... · 3d29b274
    Emilio Cobos Álvarez authored
    Bug 1620359 - Don't clear the "uses viewport units" bit when a font that doesn't cause a style change loads. r=jfkthame
    
    This is probably an old-ish bug made more frequent by the font loading
    optimizations.
    
    PostRebuildAllStyleData is a bit of a misnomer, but was always calling
    ClearCachedData() on the style set, even if we weren't guaranteed to restyle
    every element.
    
    This means both wasted work and correctness issues (as the "uses <rare-feature>"
    bits are cleared during this call, on the assumption that we'll then visit all
    elements and that'd recompute it properly).
    
    For now, unify a bit the different code paths and only clear these bits if we're
    guaranteed to restyle all elements.
    
    I should rename this to something better in a follow-up, and ideally also
    decouple the ClearCachedData() calls a bit...
    
    Differential Revision: https://phabricator.services.mozilla.com/D65740
    
    --HG--
    extra : moz-landing-system : lando
    3d29b274