Skip navigation
commitStyles() has existed for years, but now in Firefox, it behaves like I always thought it…
0:00 / 1:51

commitStyles() has existed for years, but now in Firefox, it behaves like I always thought it…

Jake Archibald

@jaffathecake108K followers

Visit on X
77 likesDownloadOriginal post

10,872 views

commitStyles() has existed for years, but now in Firefox, it behaves like I always thought it should. Firefox is the first to make this change, but hopefully others will follow soon.

16 Comments

Comments from the original post on X (Twitter)

  • Jake Archibald's profile picture

    @jaffathecake

    The task scheduling API helps you take a large synchronous task, and chunk it up into smaller pieces, yielding to the event loop and rendering along the way. It’s now in Chrome & Firefox, but there’s a polyfill for Safari users.

    87 likes

  • Jake Archibald's profile picture

    @jaffathecake

    URLPattern lets you parse URLs using familiar route syntax. It’s now in Chrome & Firefox, but it’s likely to land in the next version of Safari.

    110 likes

  • Jake Archibald's profile picture

    @jaffathecake

    Yay! It's the first Firefox release since I've joined the team, so let's take a look at some of the new developer-facing features in Firefox 142… 🧵

    524 likes

  • Jake Archibald's profile picture

    @jaffathecake

    …And that’s not all! See for more features, fixes, and tooling updates.

    35 likes

  • original だいすけ's profile picture

    @daisuke

    Peter Storm!!

    1 like

  • 🍥kvndy's profile picture

    @kvndy

    Both fillMode and commitStyles are hacks obviated by additive and relative animation, relative to the specified style, from the delta to zero. CSS Transitions Faster Reversal too, these are all unnecessary, sub-optimal solutions. Why can’t the browser calculate the “FLIP” for us?

  • Jake Archibald's profile picture

    @jaffathecake

    Doesn't the view transition API handle the 'FLIP' case really well?

  • 🍥kvndy's profile picture

    @kvndy

    Handling of interruption and retargeting performs as CSS Animations. Jumps to destination. Animations don’t blend together but they could, using the easing function

  • Stas Lashmanov's profile picture

    @CyberAP

    So .finished resolves exactly 1 frame before the styles return back to initial state or do we get a 1 frame jump before the styles are committed?

  • Jake Archibald's profile picture

    @jaffathecake

    They haven't changed when finished resolves, it's more that commitStyles knows to apply the final state in that case. This all happens before the next paint, so there's no visual jump.

    1 like

  • JvdMeulen's profile picture

    @JvdMeulen

    Ik waardeer je inzet vanuit het verleden enorm maar dit is een beetje zoals wij Nederlanders zeggen: “wij van wc-eend”.

  • Jake Archibald's profile picture

    @jaffathecake

    It's fair to question everything, but I invite you to judge the actual content here. What's your issue?

  • JvdMeulen's profile picture

    @JvdMeulen

    It’s not the technical stuff, it’s more like “they were lacking behind, but now I’m here and everything is great again”.

  • Jake Archibald's profile picture

    @jaffathecake

    I was upfront about features that were also in other browsers, even if they were in previews, or just being worked on. If I was as dishonest as you're painting me, I wouldn't have mentioned any of that.

  • Jake Archibald's profile picture

    @jaffathecake

    And I absolutely reject your accusation that I'm making out that I'm the reason anything has changed.

    1 like

  • JvdMeulen's profile picture

    @JvdMeulen

    Not accusing, assuming. That’s how it “felt”. I’m sorry that I’m being to harsh. I didn’t mean to be mean/ignorant.