mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 04:13:11 +00:00
LibWeb: Rename is_scrollable() to is_user_scrollable()
is_user_scrollable() is more appropriate name since this function returns true only for boxes scrollable by user interaction.
This commit is contained in:
parent
491da2a810
commit
5f364e9bc1
|
@ -55,7 +55,7 @@ bool Box::is_scroll_container() const
|
||||||
|| overflow_value_makes_box_a_scroll_container(computed_values().overflow_y());
|
|| overflow_value_makes_box_a_scroll_container(computed_values().overflow_y());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Box::is_scrollable() const
|
bool Box::is_user_scrollable() const
|
||||||
{
|
{
|
||||||
// FIXME: Support horizontal scroll as well (overflow-x)
|
// FIXME: Support horizontal scroll as well (overflow-x)
|
||||||
return computed_values().overflow_y() == CSS::Overflow::Scroll || computed_values().overflow_y() == CSS::Overflow::Auto;
|
return computed_values().overflow_y() == CSS::Overflow::Scroll || computed_values().overflow_y() == CSS::Overflow::Auto;
|
||||||
|
|
|
@ -54,7 +54,7 @@ public:
|
||||||
|
|
||||||
bool is_scroll_container() const;
|
bool is_scroll_container() const;
|
||||||
|
|
||||||
bool is_scrollable() const;
|
bool is_user_scrollable() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Box(DOM::Document&, DOM::Node*, NonnullRefPtr<CSS::StyleProperties>);
|
Box(DOM::Document&, DOM::Node*, NonnullRefPtr<CSS::StyleProperties>);
|
||||||
|
|
|
@ -165,7 +165,7 @@ bool EventHandler::handle_mousewheel(CSSPixelPoint position, unsigned button, un
|
||||||
|
|
||||||
auto* containing_block = paintable->containing_block();
|
auto* containing_block = paintable->containing_block();
|
||||||
while (containing_block) {
|
while (containing_block) {
|
||||||
if (containing_block->is_scrollable()) {
|
if (containing_block->is_user_scrollable()) {
|
||||||
const_cast<Painting::PaintableBox*>(containing_block->paintable_box())->handle_mousewheel({}, position, buttons, modifiers, wheel_delta_x * scroll_step_size, wheel_delta_y * scroll_step_size);
|
const_cast<Painting::PaintableBox*>(containing_block->paintable_box())->handle_mousewheel({}, position, buttons, modifiers, wheel_delta_x * scroll_step_size, wheel_delta_y * scroll_step_size);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -729,7 +729,7 @@ void PaintableWithLines::paint(PaintContext& context, PaintPhase phase) const
|
||||||
|
|
||||||
bool PaintableBox::handle_mousewheel(Badge<EventHandler>, CSSPixelPoint, unsigned, unsigned, int wheel_delta_x, int wheel_delta_y)
|
bool PaintableBox::handle_mousewheel(Badge<EventHandler>, CSSPixelPoint, unsigned, unsigned, int wheel_delta_x, int wheel_delta_y)
|
||||||
{
|
{
|
||||||
if (!layout_box().is_scrollable())
|
if (!layout_box().is_user_scrollable())
|
||||||
return false;
|
return false;
|
||||||
scroll_by(wheel_delta_x, wheel_delta_y);
|
scroll_by(wheel_delta_x, wheel_delta_y);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue