Nice trace from the 290 ms Layout to the once-per-second width transition—the timing correlation makes the stutter explanation really clear. The clipped full-width bar with translateX is a neat way to keep rounded ends; did you compare it with scaleX plus transform-origin:left, or was preserving the cap shape the deciding factor?
Thanks! Performance-wise I didn’t benchmark them against each other, since scaleX and translateX are both compositor-only transforms, so neither triggers layout. The cap shape was the deciding factor: with scaleX + transform-origin: left, the border-radius gets scaled along with the bar, so when the bar is short the rounded ends get squashed. Translating a full-width bar inside an overflow-hidden container keeps the corners intact for free. If I ever needed scaleX, I think the usual workaround is to scale a plain inner element and draw the rounded caps separately, but the clipped version was simpler here.
Alex Yu
Nice trace from the 290 ms Layout to the once-per-second width transition—the timing correlation makes the stutter explanation really clear. The clipped full-width bar with translateX is a neat way to keep rounded ends; did you compare it with scaleX plus transform-origin:left, or was preserving the cap shape the deciding factor?