Commit 60b63538 authored by Maggie Cai's avatar Maggie Cai Committed by Commit Bot

Revert "Don't trigger main-thread overlay scrollbar animations if composited"

This reverts commit f5cdac12.

Reason for revert: This might be the cause of test failure virtual/threaded/external/wpt/feature-policy/experimental-features/vertical-scroll-disabled-scrollbar-tentative.html for https://ci.chromium.org/p/chromium/builders/ci/Win10%20Tests%20x64/48699 (and some builds after this). Revert to see if this fixed the test.

Original change's description:
> Don't trigger main-thread overlay scrollbar animations if composited
> 
> There are already hit tests and animations entirely in the impl thread
> for such scrollbars.
> 
> Bug: 1116800
> 
> Change-Id: I2714258717c89e0ea41232eb86abe12570526d28
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2364972
> Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
> Reviewed-by: David Bokan <bokan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#800302}

TBR=bokan@chromium.org,chrishtr@chromium.org

Change-Id: Ided42e8aa3339e93f85d9f73f3737197864b493d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1116800
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2369076Reviewed-by: default avatarMaggie Cai <mxcai@chromium.org>
Commit-Queue: Maggie Cai <mxcai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800529}
parent 6b4136e3
......@@ -1578,59 +1578,6 @@ TEST_F(ScrollbarsTestWithVirtualTimer, TestNonCompositedOverlayScrollbarsFade) {
mock_overlay_theme.SetOverlayScrollbarFadeOutDelay(base::TimeDelta());
}
TEST_F(ScrollbarsTestWithVirtualTimer, TestCompositedOverlayScrollbarsNoFade) {
ENABLE_OVERLAY_SCROLLBARS(true);
WebView().MainFrameWidget()->Resize(WebSize(640, 480));
SimRequest request("https://example.com/test.html", "text/html");
LoadURL("https://example.com/test.html");
request.Complete(R"HTML(
<!DOCTYPE html>
<style>
#space {
width: 1000px;
height: 1000px;
}
#container {
/* Force composited scrolling */
will-change: transform;
width: 200px;
height: 200px;
overflow: scroll;
}
div { height:1000px; width: 200px; }
</style>
<div id='container'>
<div id='space'></div>
</div>
)HTML");
Compositor().BeginFrame();
Document& document = GetDocument();
Element* container = document.getElementById("container");
ScrollableArea* scrollable_area =
ToLayoutBox(container->GetLayoutObject())->GetScrollableArea();
DCHECK(scrollable_area->UsesCompositedScrolling());
EXPECT_TRUE(scrollable_area->HasOverlayScrollbars());
EXPECT_TRUE(scrollable_area->HasLayerForVerticalScrollbar());
Scrollbar* vertical_scrollbar = scrollable_area->VerticalScrollbar();
scrollable_area->MouseEnteredScrollbar(*vertical_scrollbar);
EXPECT_FALSE(scrollable_area->NeedsShowScrollbarLayers());
scrollable_area->MouseExitedScrollbar(*vertical_scrollbar);
EXPECT_FALSE(scrollable_area->NeedsShowScrollbarLayers());
scrollable_area->MouseCapturedScrollbar();
EXPECT_FALSE(scrollable_area->NeedsShowScrollbarLayers());
scrollable_area->MouseReleasedScrollbar();
EXPECT_FALSE(scrollable_area->NeedsShowScrollbarLayers());
}
class ScrollbarAppearanceTest
: public ScrollbarsTest,
public testing::WithParamInterface</*use_overlay_scrollbars=*/bool> {};
......
......@@ -740,11 +740,6 @@ void ScrollableArea::ShowNonMacOverlayScrollbars() {
!GetPageScrollbarTheme().BlinkControlsOverlayVisibility())
return;
// Don't do this for composited scrollbars. These scrollbars are handled
// by separate code in cc::ScrollbarAnimationController.
if (LayerForVerticalScrollbar() || LayerForHorizontalScrollbar())
return;
SetScrollbarsHiddenIfOverlay(false);
needs_show_scrollbar_layers_ = true;
......
......@@ -551,7 +551,6 @@ class CORE_EXPORT ScrollableArea : public GarbageCollectedMixin {
vertical_scrollbar_needs_paint_invalidation_ = false;
scroll_corner_needs_paint_invalidation_ = false;
}
void ShowNonMacOverlayScrollbars();
// Called when scrollbar hides/shows for overlay scrollbars. This callback
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment