فهرست منبع

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.
Aliaksandr Kalenik 2 سال پیش
والد
کامیت
491da2a810
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      Userland/Libraries/LibWeb/DOM/Element.cpp

+ 2 - 2
Userland/Libraries/LibWeb/DOM/Element.cpp

@@ -1041,7 +1041,7 @@ void Element::set_scroll_left(double x)
         return;
 
     auto* box = static_cast<Layout::Box*>(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::Box*>(layout_node());
-    if (!box->is_scrollable())
+    if (!box->is_scroll_container())
         return;
 
     // FIXME: or the element has no overflow.