From 7ad2ff3232092d8b9268c12969e3fe7c2f2bc202 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Mon, 21 Nov 2022 03:10:05 +0000 Subject: [PATCH] Bug 1794070 - Add "overscrolled" state in APZTestData.additionalData. r=botond We'd like to use this for testing overscroll state in mochitests. Differential Revision: https://phabricator.services.mozilla.com/D160433 --- gfx/layers/apz/src/APZCTreeManager.cpp | 3 ++ .../helper_overscroll_in_apz_test_data.html | 29 +++++++++++++++++++ .../mochitest/test_group_touchevents-5.html | 6 +++- 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 gfx/layers/apz/test/mochitest/helper_overscroll_in_apz_test_data.html diff --git a/gfx/layers/apz/src/APZCTreeManager.cpp b/gfx/layers/apz/src/APZCTreeManager.cpp index eae58be4e72e..da77c86120d4 100644 --- a/gfx/layers/apz/src/APZCTreeManager.cpp +++ b/gfx/layers/apz/src/APZCTreeManager.cpp @@ -3559,6 +3559,9 @@ bool APZCTreeManager::GetAPZTestData(LayersId aLayersId, if (apzc->GetCheckerboardMagnitude(clippedBounds)) { apzcState += "checkerboarding,"; } + if (apzc->IsOverscrolled()) { + apzcState += "overscrolled,"; + } aOutData->RecordAdditionalData(viewId, apzcState); } } diff --git a/gfx/layers/apz/test/mochitest/helper_overscroll_in_apz_test_data.html b/gfx/layers/apz/test/mochitest/helper_overscroll_in_apz_test_data.html new file mode 100644 index 000000000000..ed05f25819cb --- /dev/null +++ b/gfx/layers/apz/test/mochitest/helper_overscroll_in_apz_test_data.html @@ -0,0 +1,29 @@ + + + +A simple test checks "overscrolled" info in APZTestData +Tests scroll anchoring updates in-progress wheel scrolling __relatively__ + + + +
+ diff --git a/gfx/layers/apz/test/mochitest/test_group_touchevents-5.html b/gfx/layers/apz/test/mochitest/test_group_touchevents-5.html index f91d1c6145a5..d4ae624a69c3 100644 --- a/gfx/layers/apz/test/mochitest/test_group_touchevents-5.html +++ b/gfx/layers/apz/test/mochitest/test_group_touchevents-5.html @@ -15,7 +15,11 @@ var subtests = [ {"file": "helper_bug1669625.html", "dp_suppression": false}, {"file": "helper_touch_drag_root_scrollbar.html", "prefs": [["apz.allow_zooming", true]]}, {"file": "helper_touch_drag_root_scrollbar.html", "prefs": [["apz.allow_zooming", false]]}, - + {"file": "helper_overscroll_in_apz_test_data.html", "prefs": [ + ["apz.overscroll.enabled", true], + ["apz.overscroll.test_async_scroll_offset.enabled", true], + ["apz.test.logging_enabled", true], + ]}, // Add new subtests here. If this starts timing out because it's taking too // long, create a test_group_touchevents-6.html file. Refer to 1423011#c57 // for more details.