Revert "LibWeb: Turn Window.scroll(0, 0) into a no-op when possible"

This reverts commit 9840a8c750.

Regressed a number of CSS transitions tests in WPT.
This commit is contained in:
Andreas Kling 2025-04-22 19:28:06 +02:00
parent 7bedc1c556
commit 42f72bbdce
Notes: github-actions[bot] 2025-04-22 17:48:01 +00:00

View file

@ -1465,10 +1465,6 @@ void Window::scroll(ScrollToOptions const& options)
x = HTML::normalize_non_finite_values(x);
y = HTML::normalize_non_finite_values(y);
// OPTIMIZATION: If we're asked to scroll to (0, 0) and we're already there, do nothing.
if (x == 0 && y == 0 && navigable->viewport_scroll_offset().is_zero())
return;
// 5. Let viewport width be the width of the viewport excluding the width of the scroll bar, if any.
auto viewport_width = viewport_rect.width();