feat: re-measure overflow without forced .update(true)#748
feat: re-measure overflow without forced .update(true)#748Menci wants to merge 1 commit intoKingSora:masterfrom
Conversation
|
BTW, I think overflow behavior shouldn't be inferred from |
|
Good day @Menci :) Thank you very much for taking the time to create a PR! I would really like to keep the current update functionality (e.g. passing just a I've recently released
I'm getting the overflow style to determine whether I can skip all of the needed calculations which are needed for the overflow. For those I'm also using potentialy heavy properties / functions such as |
I think getComputedStyle() is much more expensive than all the calculations. |
|
Updating via events also trigger getComputedStyle(). This PR introduces the way without getComputedStyle(). |
|
@Menci I've added a new option called You can test it out with the new |
|
Thank you! I'll check it later. |
This is a follow-up for #729.
.update(true)is very slow. From the performance tool in DevTools. the heavy path is:update -> ... -> getElementOverflow -> getStyles -> "anonymousCallbackTo: from(styles).deduce" -> getCSSVal -> "Recalculate style".To solve this, I introduced the option
.update({ measureOverflow: true })to trigger an measurement update bypassing the heavy forced-update logic.