You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the first ones, 206ms, is a this part of code for autohiding scrollbars (which I don't have enabled - I can't even find the option). Developer Tools tells me it affects 8875 elements. This also only happens on the extension, this does not appear when running from the userscript.
One of the next big ones is here, timing for ~350ms and affecting 11379 elements. This recalculation then causes a layout change of ~230ms for 19959 elements. Which in turns causes another 130ms recalculate style for 5368 elements, forced by this bit.
This is where my curiosity starts. Because turning off my userstyle, and going back to default styling, these reflows still occur with the same times.
Was just wondering if something like scrollIntoView()[1][2] could be used.
Also, I don't know if this is applicable, but I've seen mention of wrapping scroll events in requestAnimationFrame[1][2][3] too.
I don't know if this would alleviate some of the reflow issues? Was curious - or perhaps you've even tested this already.
Something like: when in a thread, keep a note of which post is at the bottom of the window and storing that somewhere (e.g. thread/101959270#p101960071) and then when a user goes back to that thread, do something with that scrollIntoView event?
Sorry for this mini-blog. I would've preferred to email something like this, but I couldn't find one. Was just curious, and am trying to find an answer for my reflow issues.
EDIT: While I found the offending CSS in my userstyle, I would like to think there is still something here.
Thanks. I'll investigate when I have time, but I suspect a lot of these layout calculations are things that are going to be happening anyway, whether or not 4chan X forces them to happen immediately by querying the height/position of elements.
If there's something in the build instructions you don't understand, please ask about it; there are probably many other people who don't understand it. And that needs to be fixed.
Not a bug, more just something to feed my curiosity.
I'm trying to debug some horrible reflow that happens when using my userstyle, which is particularly evident in threads with ~200+ posts.
Two example GIFs here and here along with a Timeline screenshot.
One of the first ones, 206ms, is a this part of code for autohiding scrollbars (which I don't have enabled - I can't even find the option). Developer Tools tells me it affects 8875 elements. This also only happens on the extension, this does not appear when running from the userscript.
One of the next big ones is here, timing for ~350ms and affecting 11379 elements. This recalculation then causes a layout change of ~230ms for 19959 elements. Which in turns causes another 130ms recalculate style for 5368 elements, forced by this bit.
And occassionaly this part pops up too.
This is where my curiosity starts. Because turning off my userstyle, and going back to default styling, these reflows still occur with the same times.
Was just wondering if something like
scrollIntoView()
[1][2] could be used.Also, I don't know if this is applicable, but I've seen mention of wrapping scroll events in
requestAnimationFrame
[1][2][3] too.I don't know if this would alleviate some of the reflow issues? Was curious - or perhaps you've even tested this already.
Something like: when in a thread, keep a note of which post is at the bottom of the window and storing that somewhere (e.g.
thread/101959270#p101960071
) and then when a user goes back to that thread, do something with thatscrollIntoView
event?Sorry for this mini-blog. I would've preferred to email something like this, but I couldn't find one. Was just curious, and am trying to find an answer for my reflow issues.
EDIT: While I found the offending CSS in my userstyle, I would like to think there is still something here.
EDIT2: The offending line is actually https://github.com/ccd0/4chan-x/blob/master/src/Monitoring/Unread.coffee#L176
The text was updated successfully, but these errors were encountered: