diff --git a/blink/renderer/core/scroll/scrollable_area.cc b/blink/renderer/core/scroll/scrollable_area.cc index 8760dd33dc99db9eeda8daa5433e9473d68986b9..1be6f4f7ce33e8ec3aec1cc027c9f777306ba523 100644 --- a/blink/renderer/core/scroll/scrollable_area.cc +++ b/blink/renderer/core/scroll/scrollable_area.cc @@ -110,7 +110,11 @@ ScrollableArea::ScrollableArea( horizontal_scrollbar_needs_paint_invalidation_(false), vertical_scrollbar_needs_paint_invalidation_(false), scroll_corner_needs_paint_invalidation_(false), +#ifdef OHOS_SCROLLBAR + scrollbars_hidden_if_overlay_(false), +#else scrollbars_hidden_if_overlay_(true), +#endif scrollbar_captured_(false), mouse_over_scrollbar_(false), has_been_disposed_(false), @@ -851,6 +855,15 @@ void ScrollableArea::SetScrollbarsHiddenIfOverlayInternal(bool hidden) { } void ScrollableArea::FadeOverlayScrollbarsTimerFired(TimerBase*) { +#ifdef OHOS_SCROLLBAR + // Scrollbars can become composited in the time it takes the timer set in + // ShowNonMacOverlayScrollbars to be fired. + if (RuntimeEnabledFeatures:: + InterruptComposedScrollbarDisappearanceEnabled() && + UsesCompositedScrolling()) { + return; + } +#endif // OHOS_SCROLLBAR SetScrollbarsHiddenIfOverlay(true); } diff --git a/blink/renderer/platform/runtime_enabled_features.json5 b/blink/renderer/platform/runtime_enabled_features.json5 index 84bcb00f69dc0c89f01c43c07351d7d23b3f30f6..496524014be15492dcaedc5e4e1946878efc4e6e 100644 --- a/blink/renderer/platform/runtime_enabled_features.json5 +++ b/blink/renderer/platform/runtime_enabled_features.json5 @@ -2013,6 +2013,10 @@ status: "stable", base_feature: "none", }, + { + name: "InterruptComposedScrollbarDisappearance", + status: "stable", + }, { name: "KeyboardAccessibleTooltip", status: "experimental",