I don't see any shaming in that post, but I'd like to see clip-path moved to the compositor to make this easier https://bugs.chromium.org/p/chromium/issues/detail?id=686074 …
-
-
Replying to @jaffathecake @pcwalton
If a browser can get layout working at 60fps on a cheap phone, that'd be great! Haven't seen it yet though.
1 reply 0 retweets 1 like -
Replying to @jaffathecake
Width and height for absolute position is trivial to hit 60 with. Only problem is main thread jank. That’s why layout should move off it.
1 reply 0 retweets 0 likes -
Replying to @pcwalton
That's making a lot of assumptions about the content of the el. Also, by requiring abs position you're forcing tricks onto the dev again
2 replies 0 retweets 0 likes -
Replying to @jaffathecake
Besides, the interior layout doesn’t change, so it won’t be recomputed. Layout work is trivial.
1 reply 0 retweets 0 likes -
Replying to @pcwalton
Yeah, if you restrict yourself to the simple design in the post, but in reality developers use more complex designs
1 reply 0 retweets 0 likes -
Replying to @jaffathecake
If the problem is “don’t lay out the interior during an animation”, then devs should directly request that. Not drop into linear algebra.
1 reply 0 retweets 0 likes -
Replying to @pcwalton @jaffathecake
For example, it should be sufficient to set a fixed width for the content to prevent relayout of the inside during animation.
1 reply 0 retweets 0 likes -
Replying to @pcwalton
That's replacing one trick with another. Clip-path is the sensible choice if you want to change the rendered portion without changing layout
1 reply 0 retweets 0 likes -
Replying to @jaffathecake
I think if you were to ask average Web developers (not perf geeks) how to write such a thing, they’d reach for width before clip path.
2 replies 0 retweets 0 likes
It’s certainly what I’d do: inner div with fixed width, then animate an outer div’s width/height with overflow:hidden set.
-
-
Replying to @pcwalton
The use of the fixed inner div is kinda perf-geeky
2 replies 0 retweets 0 likes -
Replying to @jaffathecake
Well, it’s needed for the animation to look right. Otherwise with certain layouts you’d see the contents jump around.
2 replies 0 retweets 0 likes - 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.