LibWeb: Do not paint scrollbar of ViewportPaintable

Scrollbar of viewport is supposed to be painted by chrome.
This commit is contained in:
Aliaksandr Kalenik 2024-04-18 09:56:19 +02:00 committed by Andreas Kling
parent eb4f36e5a1
commit d53058421a
Notes: sideshowbarker 2024-07-17 06:40:21 +09:00

View file

@ -343,7 +343,7 @@ void PaintableBox::paint(PaintContext& context, PaintPhase phase) const
} }
auto scrollbar_width = computed_values().scrollbar_width(); auto scrollbar_width = computed_values().scrollbar_width();
if (phase == PaintPhase::Overlay && scrollbar_width != CSS::ScrollbarWidth::None) { if (!layout_box().is_viewport() && phase == PaintPhase::Overlay && scrollbar_width != CSS::ScrollbarWidth::None) {
auto color = Color(Color::NamedColor::DarkGray).with_alpha(128); auto color = Color(Color::NamedColor::DarkGray).with_alpha(128);
int thumb_corner_radius = static_cast<int>(context.rounded_device_pixels(scrollbar_thumb_thickness / 2)); int thumb_corner_radius = static_cast<int>(context.rounded_device_pixels(scrollbar_thumb_thickness / 2));
if (auto thumb_rect = scroll_thumb_rect(ScrollDirection::Horizontal); thumb_rect.has_value()) { if (auto thumb_rect = scroll_thumb_rect(ScrollDirection::Horizontal); thumb_rect.has_value()) {