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
@mrobinson with #41834 the test now correctly scrolls to the target. However, the window.scrollY is still 0. I briefly looked into it, but got quickly overwhelmed with all the layout stuff.
Do you know why window.scrollY isn't updated if we do scrollIntoView? See the implementation in #41834 for the updates scroll algorithm for navigation fragments. It doesn't use window.scrollTo since the spec doesn't do so either.
@mrobinson with #41834 the test now correctly scrolls to the target. However, the window.scrollY is still 0. I briefly looked into it, but got quickly overwhelmed with all the layout stuff.
Do you know why window.scrollY isn't updated if we do scrollIntoView? See the implementation in #41834 for the updates scroll algorithm for navigation fragments. It doesn't use window.scrollTo since the spec doesn't do so either.
Sorry for the delay in replying. I took at look at this test and after a bit of minimization it seems that the issue is that the load event is fired before the call to scrollIntoView. I was able to see this by:
Minimizing the test to a single redirect and fragment navigation.
Putting println! right before the call to the fragment-related Element::scroll_into_view_with_options.
Putting a println! in the implementation of ScrollY.
The ScrollYprintln! printed before the call to scroll_into_view_with_options. In addition, changing the onload handler to be a setTimeout that fired after 3 seconds caused the test to pass. I suspect that you need to delay the load event when dealing with fragment navigation.
Activity
net: Implement redirect taint for requests
net: Implement redirect taint for requests
net: Implement redirect taint for requests (#41824)
net: Align redirect HTTP Fetch with spec comments (servo#41798)
script: Implement navigate to fragment algorithm
script: Implement navigate to fragment algorithm
script: Implement "Location-navigate a location" (#41805)
script: Implement navigate to fragment algorithm
TimvdLippe commentedon Jan 13, 2026
@mrobinson with #41834 the test now correctly scrolls to the target. However, the
window.scrollYis still 0. I briefly looked into it, but got quickly overwhelmed with all the layout stuff.Do you know why
window.scrollYisn't updated if we doscrollIntoView? See the implementation in #41834 for the updates scroll algorithm for navigation fragments. It doesn't usewindow.scrollTosince the spec doesn't do so either.script: Implement navigate to fragment algorithm
script: Implement navigate to fragment algorithm
script: Implement navigate to fragment algorithm
script: Implement navigate to fragment algorithm (#41834)
mrobinson commentedon Jan 16, 2026
Sorry for the delay in replying. I took at look at this test and after a bit of minimization it seems that the issue is that the load event is fired before the call to
scrollIntoView. I was able to see this by:println!right before the call to the fragment-relatedElement::scroll_into_view_with_options.println!in the implementation ofScrollY.The
ScrollYprintln!printed before the call toscroll_into_view_with_options. In addition, changing theonloadhandler to be asetTimeoutthat fired after 3 seconds caused the test to pass. I suspect that you need to delay the load event when dealing with fragment navigation.