Commit ba4c901f authored by Rahul Arakeri's avatar Rahul Arakeri Committed by Commit Bot

Fix for flaky test (scrollbar-button-gesture-target.html).

The test fails because it tries to dereference a raw pointer which
points to layer that was destroyed. The fix is to set the pointer
to null and add checks in scrollbar_controller.cc

Bug: 1002828, 987115
Change-Id: I46efc7e35ee62bb36020a42aafbd75998728017c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1854534
Commit-Queue: Rahul Arakeri <arakeri@microsoft.com>
Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706170}
parent 4cb3bc14
...@@ -402,6 +402,15 @@ float ScrollbarController::GetScrollerToScrollbarRatio() { ...@@ -402,6 +402,15 @@ float ScrollbarController::GetScrollerToScrollbarRatio() {
return scaled_scroller_to_scrollbar_ratio; return scaled_scroller_to_scrollbar_ratio;
} }
void ScrollbarController::DidUnregisterScrollbar(ElementId element_id) {
if (currently_captured_scrollbar_ &&
currently_captured_scrollbar_->scroll_element_id() == element_id)
currently_captured_scrollbar_ = nullptr;
drag_processed_for_current_frame_ = false;
drag_state_ = base::nullopt;
autoscroll_state_ = base::nullopt;
}
void ScrollbarController::RecomputeAutoscrollStateIfNeeded() { void ScrollbarController::RecomputeAutoscrollStateIfNeeded() {
if (!autoscroll_state_.has_value()) if (!autoscroll_state_.has_value())
return; return;
......
...@@ -38,6 +38,7 @@ class CC_EXPORT ScrollbarController { ...@@ -38,6 +38,7 @@ class CC_EXPORT ScrollbarController {
ScrollbarOrientation orientation() { ScrollbarOrientation orientation() {
return currently_captured_scrollbar_->orientation(); return currently_captured_scrollbar_->orientation();
} }
void DidUnregisterScrollbar(ElementId element_id);
void WillBeginImplFrame(); void WillBeginImplFrame();
......
...@@ -5317,6 +5317,10 @@ void LayerTreeHostImpl::RegisterScrollbarAnimationController( ...@@ -5317,6 +5317,10 @@ void LayerTreeHostImpl::RegisterScrollbarAnimationController(
scrollbar_opacity); scrollbar_opacity);
} }
void LayerTreeHostImpl::UnregisterScrollbarLayer(ElementId element_id) const {
scrollbar_controller_->DidUnregisterScrollbar(element_id);
}
void LayerTreeHostImpl::UnregisterScrollbarAnimationController( void LayerTreeHostImpl::UnregisterScrollbarAnimationController(
ElementId scroll_element_id) { ElementId scroll_element_id) {
scrollbar_animation_controllers_.erase(scroll_element_id); scrollbar_animation_controllers_.erase(scroll_element_id);
......
...@@ -373,6 +373,8 @@ class CC_EXPORT LayerTreeHostImpl : public InputHandler, ...@@ -373,6 +373,8 @@ class CC_EXPORT LayerTreeHostImpl : public InputHandler,
return need_update_gpu_rasterization_status_; return need_update_gpu_rasterization_status_;
} }
void UnregisterScrollbarLayer(ElementId element_id) const;
// MutatorHostClient implementation. // MutatorHostClient implementation.
bool IsElementInPropertyTrees(ElementId element_id, bool IsElementInPropertyTrees(ElementId element_id,
ElementListType list_type) const override; ElementListType list_type) const override;
......
...@@ -1919,6 +1919,7 @@ void LayerTreeImpl::UnregisterScrollbar( ...@@ -1919,6 +1919,7 @@ void LayerTreeImpl::UnregisterScrollbar(
element_id_to_scrollbar_layer_ids_.erase(scroll_element_id); element_id_to_scrollbar_layer_ids_.erase(scroll_element_id);
if (IsActiveTree()) { if (IsActiveTree()) {
host_impl_->UnregisterScrollbarAnimationController(scroll_element_id); host_impl_->UnregisterScrollbarAnimationController(scroll_element_id);
host_impl_->UnregisterScrollbarLayer(scroll_element_id);
} }
} }
} }
......
...@@ -2538,13 +2538,7 @@ crbug.com/953847 [ Mac ] virtual/threaded/fast/scrolling/scrollbars/scroll-chain ...@@ -2538,13 +2538,7 @@ crbug.com/953847 [ Mac ] virtual/threaded/fast/scrolling/scrollbars/scroll-chain
crbug.com/953847 [ Mac ] virtual/threaded/fast/scrolling/scrollbars/scrollbar-occluded-by-div.html [ Failure ] crbug.com/953847 [ Mac ] virtual/threaded/fast/scrolling/scrollbars/scrollbar-occluded-by-div.html [ Failure ]
crbug.com/953847 [ Mac ] virtual/threaded/fast/scrolling/scrollbars/scrollbar-button-gesture-target.html [ Failure ] crbug.com/953847 [ Mac ] virtual/threaded/fast/scrolling/scrollbars/scrollbar-button-gesture-target.html [ Failure ]
crbug.com/953847 [ Mac ] virtual/threaded/fast/scrolling/scrollbars/mouse-autoscrolling-on-scrollbar.html [ Failure Timeout ] crbug.com/953847 [ Mac ] virtual/threaded/fast/scrolling/scrollbars/mouse-autoscrolling-on-scrollbar.html [ Failure Timeout ]
crbug.com/953847 [ Mac ] virtual/compositor_threaded_scrollbar_scrolling/fast/scrolling/scrollbars/scrollbar-button-gesture-target.html [ Failure ]
# Compositor threaded scrollbar scrolls parent of subscroller.
# Note: even when fixed will still fail on Mac until crbug.com/953847
# is addressed. Uncomment below line when fixing crbug.com/965829.
#crbug.com/953847 [ Mac ] virtual/compositor_threaded_scrollbar_scrolling/fast/scrolling/scrollbars/scrollbar-button-gesture-target.html [ Failure ]
crbug.com/987115 [ Win ] virtual/compositor_threaded_scrollbar_scrolling/fast/scrolling/scrollbars/scrollbar-button-gesture-target.html [ Failure Crash ]
crbug.com/965829 [ Mac ] virtual/compositor_threaded_scrollbar_scrolling/fast/scrolling/scrollbars/scrollbar-button-gesture-target.html [ Failure ]
# Some control characters still not visible # Some control characters still not visible
crbug.com/893490 [ Mac ] external/wpt/css/css-text/white-space/control-chars-001.html [ Failure ] crbug.com/893490 [ Mac ] external/wpt/css/css-text/white-space/control-chars-001.html [ Failure ]
...@@ -5626,9 +5620,6 @@ crbug.com/1001936 external/wpt/css/css-masking/clip-path/clip-path-inline-001.ht ...@@ -5626,9 +5620,6 @@ crbug.com/1001936 external/wpt/css/css-masking/clip-path/clip-path-inline-001.ht
crbug.com/1002527 [ Debug ] fast/text/large-text-composed-char.html [ Pass Crash ] crbug.com/1002527 [ Debug ] fast/text/large-text-composed-char.html [ Pass Crash ]
crbug.com/1002686 [ Mac10.13 ] virtual/threaded/http/tests/devtools/tracing/timeline-style/timeline-recalculate-styles.js [ Failure ] crbug.com/1002686 [ Mac10.13 ] virtual/threaded/http/tests/devtools/tracing/timeline-style/timeline-recalculate-styles.js [ Failure ]
# Sheriff 2019-09-11
crbug.com/1002828 [ Linux ] virtual/compositor_threaded_scrollbar_scrolling/fast/scrolling/scrollbars/scrollbar-button-gesture-target.html [ Pass Failure Crash ]
# Tests fail because of scrollbar-width property # Tests fail because of scrollbar-width property
crbug.com/1003055 external/wpt/css/css-scroll-snap/scroll-target-align-001.html [ Failure ] crbug.com/1003055 external/wpt/css/css-scroll-snap/scroll-target-align-001.html [ Failure ]
crbug.com/1003055 external/wpt/css/css-scroll-snap/scroll-target-align-002.html [ Failure ] crbug.com/1003055 external/wpt/css/css-scroll-snap/scroll-target-align-002.html [ Failure ]
......
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