From 491da2a810a1f6b94fc46662c551a7b6c7ebbfd9 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Tue, 8 Aug 2023 15:39:03 +0200 Subject: [PATCH] LibWeb: Use is_scroll_container instead of is_scrollable in JS APIs is_scroll_container() returns true for "overflow: hidden" which allows programmable scrolling while is_scrollable() returns true only for "overflow: scroll" and "overflow: auto" which allow scrolling only by user interactions. --- Userland/Libraries/LibWeb/DOM/Element.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index 8b56b187d1..7c6b908a24 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -1041,7 +1041,7 @@ void Element::set_scroll_left(double x) return; auto* box = static_cast(layout_node()); - if (!box->is_scrollable()) + if (!box->is_scroll_container()) return; // FIXME: or the element has no overflow. @@ -1109,7 +1109,7 @@ void Element::set_scroll_top(double y) return; auto* box = static_cast(layout_node()); - if (!box->is_scrollable()) + if (!box->is_scroll_container()) return; // FIXME: or the element has no overflow.