diff --git a/dom/base/Selection.cpp b/dom/base/Selection.cpp index a99dd08d019c..f0f6367c6c8e 100644 --- a/dom/base/Selection.cpp +++ b/dom/base/Selection.cpp @@ -24,7 +24,6 @@ #include "mozilla/EventStates.h" #include "mozilla/HTMLEditor.h" #include "mozilla/Logging.h" -#include "mozilla/layers/ScrollInputMethods.h" #include "mozilla/PresShell.h" #include "mozilla/RangeBoundary.h" #include "mozilla/RangeUtils.h" @@ -79,7 +78,6 @@ using namespace mozilla; using namespace mozilla::dom; -using mozilla::layers::ScrollInputMethod; static LazyLogModule sSelectionLog("Selection"); @@ -3004,12 +3002,6 @@ nsresult Selection::ScrollIntoView(SelectionRegion aRegion, scrollFlags |= ScrollFlags::ScrollOverflowHidden; } - if (aFlags & Selection::SCROLL_FOR_CARET_MOVE) { - mozilla::Telemetry::Accumulate( - mozilla::Telemetry::SCROLL_INPUT_METHODS, - (uint32_t)ScrollInputMethod::MainThreadScrollCaretIntoView); - } - presShell->ScrollFrameRectIntoView(frame, rect, nsMargin(), aVertical, aHorizontal, scrollFlags); return NS_OK; diff --git a/dom/html/TextControlState.cpp b/dom/html/TextControlState.cpp index b5f58b8e4a0e..8d2f1f0ab8c6 100644 --- a/dom/html/TextControlState.cpp +++ b/dom/html/TextControlState.cpp @@ -40,7 +40,6 @@ #include "mozilla/dom/HTMLInputElement.h" #include "mozilla/dom/HTMLTextAreaElement.h" #include "mozilla/dom/Text.h" -#include "mozilla/layers/ScrollInputMethods.h" #include "mozilla/StaticPrefs_dom.h" #include "nsFrameSelection.h" #include "mozilla/ErrorResult.h" @@ -53,7 +52,6 @@ namespace mozilla { using namespace dom; -using layers::ScrollInputMethod; using ValueSetterOption = TextControlState::ValueSetterOption; using ValueSetterOptions = TextControlState::ValueSetterOptions; @@ -660,10 +658,6 @@ TextInputSelectionController::CompleteScroll(bool aForward) { return NS_ERROR_NOT_INITIALIZED; } - mozilla::Telemetry::Accumulate( - mozilla::Telemetry::SCROLL_INPUT_METHODS, - (uint32_t)ScrollInputMethod::MainThreadCompleteScroll); - mScrollFrame->ScrollBy(nsIntPoint(0, aForward ? 1 : -1), ScrollUnit::WHOLE, ScrollMode::Instant); return NS_OK; @@ -717,10 +711,6 @@ TextInputSelectionController::ScrollPage(bool aForward) { return NS_ERROR_NOT_INITIALIZED; } - mozilla::Telemetry::Accumulate( - mozilla::Telemetry::SCROLL_INPUT_METHODS, - (uint32_t)ScrollInputMethod::MainThreadScrollPage); - mScrollFrame->ScrollBy(nsIntPoint(0, aForward ? 1 : -1), ScrollUnit::PAGES, ScrollMode::Smooth); return NS_OK; @@ -732,10 +722,6 @@ TextInputSelectionController::ScrollLine(bool aForward) { return NS_ERROR_NOT_INITIALIZED; } - mozilla::Telemetry::Accumulate( - mozilla::Telemetry::SCROLL_INPUT_METHODS, - (uint32_t)ScrollInputMethod::MainThreadScrollLine); - mScrollFrame->ScrollBy(nsIntPoint(0, aForward ? 1 : -1), ScrollUnit::LINES, ScrollMode::Smooth); return NS_OK; @@ -747,10 +733,6 @@ TextInputSelectionController::ScrollCharacter(bool aRight) { return NS_ERROR_NOT_INITIALIZED; } - mozilla::Telemetry::Accumulate( - mozilla::Telemetry::SCROLL_INPUT_METHODS, - (uint32_t)ScrollInputMethod::MainThreadScrollCharacter); - mScrollFrame->ScrollBy(nsIntPoint(aRight ? 1 : -1, 0), ScrollUnit::LINES, ScrollMode::Smooth); return NS_OK; diff --git a/gfx/layers/apz/src/AsyncPanZoomController.cpp b/gfx/layers/apz/src/AsyncPanZoomController.cpp index 49f0cadfd180..cefe2a5a11c0 100644 --- a/gfx/layers/apz/src/AsyncPanZoomController.cpp +++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp @@ -71,7 +71,6 @@ #include "mozilla/layers/DirectionUtils.h" // for GetAxis{Start,End,Length,Scale} #include "mozilla/layers/LayerTransactionParent.h" // for LayerTransactionParent #include "mozilla/layers/MetricsSharingController.h" // for MetricsSharingController -#include "mozilla/layers/ScrollInputMethods.h" // for ScrollInputMethod #include "mozilla/mozalloc.h" // for operator new, etc #include "mozilla/Unused.h" // for unused #include "mozilla/FloatingPoint.h" // for FuzzyEquals* @@ -949,10 +948,6 @@ nsEventStatus AsyncPanZoomController::HandleDragEvent( if (aEvent.mType == MouseInput::MouseType::MOUSE_DOWN) { APZC_LOG("%p starting scrollbar drag\n", this); SetState(SCROLLBAR_DRAG); - - mozilla::Telemetry::Accumulate( - mozilla::Telemetry::SCROLL_INPUT_METHODS, - (uint32_t)ScrollInputMethod::ApzScrollbarDrag); } if (aEvent.mType != MouseInput::MouseType::MOUSE_MOVE) { @@ -1229,9 +1224,6 @@ void AsyncPanZoomController::StartAutoscroll(const ScreenPoint& aPoint) { // Cancel any existing animation. CancelAnimation(); - Telemetry::Accumulate(Telemetry::SCROLL_INPUT_METHODS, - (uint32_t)ScrollInputMethod::ApzAutoscrolling); - SetState(AUTOSCROLL); StartAnimation(new AutoscrollAnimation(*this, aPoint)); } @@ -1965,36 +1957,7 @@ ParentLayerPoint AsyncPanZoomController::GetScrollWheelDelta( return delta; } -static void ReportKeyboardScrollAction(const KeyboardScrollAction& aAction) { - ScrollInputMethod scrollMethod; - - switch (aAction.mType) { - case KeyboardScrollAction::eScrollLine: { - scrollMethod = ScrollInputMethod::ApzScrollLine; - break; - } - case KeyboardScrollAction::eScrollCharacter: { - scrollMethod = ScrollInputMethod::ApzScrollCharacter; - break; - } - case KeyboardScrollAction::eScrollPage: { - scrollMethod = ScrollInputMethod::ApzScrollPage; - break; - } - case KeyboardScrollAction::eScrollComplete: { - scrollMethod = ScrollInputMethod::ApzCompleteScroll; - break; - } - } - - mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS, - (uint32_t)scrollMethod); -} - nsEventStatus AsyncPanZoomController::OnKeyboard(const KeyboardInput& aEvent) { - // Report the type of scroll action to telemetry - ReportKeyboardScrollAction(aEvent.mAction); - // Mark that this APZC has async key scrolled mTestHasAsyncKeyScrolled = true; @@ -2311,23 +2274,6 @@ void AsyncPanZoomController::DoDelayedRequestContentRepaint() { mPinchPaintTimerSet = false; } -static ScrollInputMethod ScrollInputMethodForWheelDeltaType( - ScrollWheelInput::ScrollDeltaType aDeltaType) { - switch (aDeltaType) { - case ScrollWheelInput::SCROLLDELTA_LINE: { - return ScrollInputMethod::ApzWheelLine; - } - case ScrollWheelInput::SCROLLDELTA_PAGE: { - return ScrollInputMethod::ApzWheelPage; - } - case ScrollWheelInput::SCROLLDELTA_PIXEL: { - return ScrollInputMethod::ApzWheelPixel; - } - } - MOZ_ASSERT_UNREACHABLE("Invalid value"); - return ScrollInputMethod::ApzWheelLine; -} - static void AdjustDeltaForAllowedScrollDirections( ParentLayerPoint& aDelta, const ScrollDirections& aAllowedScrollDirections) { @@ -2412,10 +2358,6 @@ nsEventStatus AsyncPanZoomController::OnScrollWheel( return nsEventStatus_eIgnore; } - mozilla::Telemetry::Accumulate( - mozilla::Telemetry::SCROLL_INPUT_METHODS, - (uint32_t)ScrollInputMethodForWheelDeltaType(aEvent.mDeltaType)); - switch (aEvent.mScrollMode) { case ScrollWheelInput::SCROLLMODE_INSTANT: { // Wheel events from "clicky" mouse wheels trigger scroll snapping to the @@ -2551,9 +2493,6 @@ nsEventStatus AsyncPanZoomController::OnPanBegin( StartTouch(aEvent.mLocalPanStartPoint, aEvent.mTimeStamp); - mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS, - (uint32_t)ScrollInputMethod::ApzPanGesture); - if (GetAxisLockMode() == FREE) { SetState(PANNING); return nsEventStatus_eConsumeNoDefault; @@ -3351,8 +3290,6 @@ nsEventStatus AsyncPanZoomController::StartPanning( } if (IsInPanningState()) { - mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS, - (uint32_t)ScrollInputMethod::ApzTouch); mTouchStartRestingTimeBeforePan = aEventTime - mTouchStartTime; mMinimumVelocityDuringPan = Nothing(); diff --git a/gfx/layers/apz/util/ScrollInputMethods.h b/gfx/layers/apz/util/ScrollInputMethods.h deleted file mode 100644 index 999f2c6abf68..000000000000 --- a/gfx/layers/apz/util/ScrollInputMethods.h +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef mozilla_layers_ScrollInputMethods_h -#define mozilla_layers_ScrollInputMethods_h - -namespace mozilla { -namespace layers { - -/** - * An enumeration that lists various input methods used to trigger scrolling. - * Used as the values for the SCROLL_INPUT_METHODS telemetry histogram. - */ -enum class ScrollInputMethod { - - // === Driven by APZ === - - ApzTouch, // touch events - ApzWheelPixel, // wheel events, pixel scrolling mode - ApzWheelLine, // wheel events, line scrolling mode - ApzWheelPage, // wheel events, page scrolling mode - ApzPanGesture, // pan gesture events (generally triggered by trackpad) - ApzScrollbarDrag, // dragging the scrollbar - - // === Driven by the main thread === - - // Keyboard - MainThreadScrollLine, // line scrolling - // (generally triggered by up/down arrow keys) - MainThreadScrollCharacter, // character scrolling - // (generally triggered by left/right arrow keys) - MainThreadScrollPage, // page scrolling - // (generally triggered by PageUp/PageDown keys) - MainThreadCompleteScroll, // scrolling to the end of the scroll range - // (generally triggered by Home/End keys) - MainThreadScrollCaretIntoView, // scrolling to bring the caret into view - // after moving the caret via the keyboard - - // Touch - MainThreadTouch, // touch events - - // Scrollbar - MainThreadScrollbarDrag, // dragging the scrollbar - MainThreadScrollbarButtonClick, // clicking the buttons at the ends of the - // scrollback track - MainThreadScrollbarTrackClick, // clicking the scrollbar track above or - // below the thumb - - // Autoscrolling - MainThreadAutoscrolling, // autoscrolling - - // === Additional input methods implemented in APZ === - - // Async Keyboard - ApzScrollLine, // line scrolling - // (generally triggered by up/down arrow keys) - ApzScrollCharacter, // character scrolling - // (generally triggered by left/right arrow keys) - ApzScrollPage, // page scrolling - // (generally triggered by PageUp/PageDown keys) - ApzCompleteScroll, // scrolling to the end of the scroll range - // (generally triggered by Home/End keys) - - // Autoscrolling - ApzAutoscrolling, - - // New input methods can be added at the end, up to a maximum of 64. - // They should only be added at the end, to preserve the numerical values - // of the existing enumerators. -}; - -} // namespace layers -} // namespace mozilla - -#endif /* mozilla_layers_ScrollInputMethods_h */ diff --git a/gfx/layers/moz.build b/gfx/layers/moz.build index 3664c642b068..4ee564bc3d04 100755 --- a/gfx/layers/moz.build +++ b/gfx/layers/moz.build @@ -121,7 +121,6 @@ EXPORTS.mozilla.layers += [ "apz/util/ContentProcessController.h", "apz/util/DoubleTapToZoom.h", "apz/util/InputAPZContext.h", - "apz/util/ScrollInputMethods.h", "apz/util/ScrollLinkedEffectDetector.h", "apz/util/TouchActionHelper.h", "apz/util/TouchCounter.h", diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index f05df518f646..ed3f3dc077c6 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -190,7 +190,6 @@ #include "nsQueryObject.h" #include "mozilla/GlobalStyleSheetCache.h" #include "mozilla/layers/InputAPZContext.h" -#include "mozilla/layers/ScrollInputMethods.h" #include "mozilla/layers/FocusTarget.h" #include "mozilla/layers/WebRenderLayerManager.h" #include "mozilla/layers/WebRenderUserData.h" @@ -2382,9 +2381,6 @@ PresShell::ScrollPage(bool aForward) { nsIScrollableFrame* scrollFrame = GetScrollableFrameToScroll(VerticalScrollDirection); if (scrollFrame) { - mozilla::Telemetry::Accumulate( - mozilla::Telemetry::SCROLL_INPUT_METHODS, - (uint32_t)ScrollInputMethod::MainThreadScrollPage); scrollFrame->ScrollBy( nsIntPoint(0, aForward ? 1 : -1), ScrollUnit::PAGES, ScrollMode::Smooth, nullptr, mozilla::ScrollOrigin::NotSpecified, @@ -2398,9 +2394,6 @@ PresShell::ScrollLine(bool aForward) { nsIScrollableFrame* scrollFrame = GetScrollableFrameToScroll(VerticalScrollDirection); if (scrollFrame) { - mozilla::Telemetry::Accumulate( - mozilla::Telemetry::SCROLL_INPUT_METHODS, - (uint32_t)ScrollInputMethod::MainThreadScrollLine); int32_t lineCount = Preferences::GetInt("toolkit.scrollbox.verticalScrollDistance", NS_DEFAULT_VERTICAL_SCROLL_DISTANCE); @@ -2417,9 +2410,6 @@ PresShell::ScrollCharacter(bool aRight) { nsIScrollableFrame* scrollFrame = GetScrollableFrameToScroll(HorizontalScrollDirection); if (scrollFrame) { - mozilla::Telemetry::Accumulate( - mozilla::Telemetry::SCROLL_INPUT_METHODS, - (uint32_t)ScrollInputMethod::MainThreadScrollCharacter); int32_t h = Preferences::GetInt("toolkit.scrollbox.horizontalScrollDistance", NS_DEFAULT_HORIZONTAL_SCROLL_DISTANCE); @@ -2436,9 +2426,6 @@ PresShell::CompleteScroll(bool aForward) { nsIScrollableFrame* scrollFrame = GetScrollableFrameToScroll(VerticalScrollDirection); if (scrollFrame) { - mozilla::Telemetry::Accumulate( - mozilla::Telemetry::SCROLL_INPUT_METHODS, - (uint32_t)ScrollInputMethod::MainThreadCompleteScroll); scrollFrame->ScrollBy( nsIntPoint(0, aForward ? 1 : -1), ScrollUnit::WHOLE, ScrollMode::Smooth, nullptr, mozilla::ScrollOrigin::NotSpecified, diff --git a/layout/generic/nsFrameSelection.cpp b/layout/generic/nsFrameSelection.cpp index c256eade0f13..d02f6f3a0e22 100644 --- a/layout/generic/nsFrameSelection.cpp +++ b/layout/generic/nsFrameSelection.cpp @@ -80,14 +80,12 @@ static NS_DEFINE_CID(kFrameTraversalCID, NS_FRAMETRAVERSAL_CID); #include "mozilla/dom/SelectionBinding.h" #include "mozilla/AsyncEventDispatcher.h" #include "mozilla/Telemetry.h" -#include "mozilla/layers/ScrollInputMethods.h" #include "nsFocusManager.h" #include "nsPIDOMWindow.h" using namespace mozilla; using namespace mozilla::dom; -using mozilla::layers::ScrollInputMethod; static LazyLogModule sFrameSelectionLog("FrameSelection"); @@ -1915,10 +1913,6 @@ nsresult nsFrameSelection::PageMove(bool aForward, bool aExtend, // Then, scroll the given frame one page. if (scrollableFrame) { - mozilla::Telemetry::Accumulate( - mozilla::Telemetry::SCROLL_INPUT_METHODS, - (uint32_t)ScrollInputMethod::MainThreadScrollPage); - // If we'll call ScrollSelectionIntoView later and selection wasn't // changed and we scroll outside of selection limiter, we shouldn't use // smooth scroll here because nsIScrollableFrame uses normal runnable, diff --git a/layout/xul/nsScrollbarButtonFrame.cpp b/layout/xul/nsScrollbarButtonFrame.cpp index ecb2596a6a75..7bf50c5384d4 100644 --- a/layout/xul/nsScrollbarButtonFrame.cpp +++ b/layout/xul/nsScrollbarButtonFrame.cpp @@ -26,10 +26,8 @@ #include "mozilla/MouseEvents.h" #include "mozilla/PresShell.h" #include "mozilla/Telemetry.h" -#include "mozilla/layers/ScrollInputMethods.h" using namespace mozilla; -using mozilla::layers::ScrollInputMethod; // // NS_NewToolbarFrame @@ -168,10 +166,6 @@ bool nsScrollbarButtonFrame::HandleButtonPress(nsPresContext* aPresContext, return false; } - mozilla::Telemetry::Accumulate( - mozilla::Telemetry::SCROLL_INPUT_METHODS, - (uint32_t)ScrollInputMethod::MainThreadScrollbarButtonClick); - if (!m) { sb->MoveToNewPosition(nsScrollbarFrame::ImplementsScrollByUnit::No); if (!weakFrame.IsAlive()) { diff --git a/layout/xul/nsSliderFrame.cpp b/layout/xul/nsSliderFrame.cpp index 84ca7e590323..d2a6087131b7 100644 --- a/layout/xul/nsSliderFrame.cpp +++ b/layout/xul/nsSliderFrame.cpp @@ -47,7 +47,6 @@ #include "mozilla/layers/APZCCallbackHelper.h" #include "mozilla/layers/AsyncDragMetrics.h" #include "mozilla/layers/InputAPZContext.h" -#include "mozilla/layers/ScrollInputMethods.h" #include "mozilla/layers/WebRenderLayerManager.h" #include @@ -59,7 +58,6 @@ using mozilla::layers::AsyncDragMetrics; using mozilla::layers::InputAPZContext; using mozilla::layers::ScrollbarData; using mozilla::layers::ScrollDirection; -using mozilla::layers::ScrollInputMethod; bool nsSliderFrame::gMiddlePref = false; int32_t nsSliderFrame::gSnapMultiplier; @@ -743,10 +741,6 @@ nsresult nsSliderFrame::HandleEvent(nsPresContext* aPresContext, nsSize thumbSize = thumbFrame->GetSize(); nscoord thumbLength = isHorizontal ? thumbSize.width : thumbSize.height; - mozilla::Telemetry::Accumulate( - mozilla::Telemetry::SCROLL_INPUT_METHODS, - (uint32_t)ScrollInputMethod::MainThreadScrollbarTrackClick); - // set it AutoWeakFrame weakFrame(this); // should aMaySnap be true here? @@ -1245,19 +1239,6 @@ nsresult nsSliderFrame::StopDrag() { AddListener(); DragThumb(false); - if (!mScrollingWithAPZ) { - // We record this one at the end of the drag rather than at the beginning - // because at the point that the main thread starts the drag (in StartDrag) - // it may not know for sure whether APZ or the main thread will end up - // handling the drag. Even if mScrollingWithAPZ is true initially, it - // may get set to false if APZ rejects the drag. But by the end of the drag - // the mScrollingWithAPZ flag should be correct and so we can use it here - // to determine if APZ or the main thread handled the drag. - mozilla::Telemetry::Accumulate( - mozilla::Telemetry::SCROLL_INPUT_METHODS, - (uint32_t)ScrollInputMethod::MainThreadScrollbarDrag); - } - mScrollingWithAPZ = false; UnsuppressDisplayport(); @@ -1437,10 +1418,6 @@ nsSliderFrame::HandlePress(nsPresContext* aPresContext, WidgetGUIEvent* aEvent, return NS_OK; } - mozilla::Telemetry::Accumulate( - mozilla::Telemetry::SCROLL_INPUT_METHODS, - (uint32_t)ScrollInputMethod::MainThreadScrollbarTrackClick); - if (IsXULHorizontal() ? eventPoint.x < thumbRect.x : eventPoint.y < thumbRect.y) change = -1; diff --git a/toolkit/actors/AutoScrollChild.jsm b/toolkit/actors/AutoScrollChild.jsm index 16cde645643d..b96757924cb1 100644 --- a/toolkit/actors/AutoScrollChild.jsm +++ b/toolkit/actors/AutoScrollChild.jsm @@ -235,11 +235,6 @@ class AutoScrollChild extends JSWindowActorChild { let content = this.document.defaultView; this._lastFrame = content.performance.now(); content.requestAnimationFrame(this.autoscrollLoop); - - const kAutoscroll = 15; // defined in mozilla/layers/ScrollInputMethods.h - Services.telemetry - .getHistogramById("SCROLL_INPUT_METHODS") - .add(kAutoscroll); } stopScroll() { diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index 56ca0f77d715..a4758ebc8608 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -13923,16 +13923,6 @@ "releaseChannelCollection": "opt-out", "description": "Graphics Crash Reason (...)" }, - "SCROLL_INPUT_METHODS": { - "record_in_processes": ["main", "content", "gpu"], - "products": ["firefox"], - "alert_emails": ["botond@mozilla.com"], - "bug_numbers": [1670003, 1672576], - "expires_in_version": "89", - "kind": "enumerated", - "n_values": 64, - "description": "Count of scroll actions triggered by different input methods. See gfx/layers/apz/util/ScrollInputMethods.h for a list of possible values and their meanings." - }, "WEBFONT_DOWNLOAD_TIME": { "record_in_processes": ["main", "content"], "products": ["firefox", "fennec"], diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index 153be8b63ff6..bdd37c74ab2b 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -215,7 +215,6 @@ #include "mozilla/layers/APZInputBridge.h" #include "mozilla/layers/InputAPZContext.h" #include "mozilla/layers/KnowsCompositor.h" -#include "mozilla/layers/ScrollInputMethods.h" #include "InputData.h" #include "mozilla/TaskController.h" @@ -7251,9 +7250,6 @@ bool nsWindow::OnGesture(WPARAM wParam, LPARAM lParam) { bool endFeedback = true; if (mGesture.PanDeltaToPixelScroll(wheelEvent)) { - mozilla::Telemetry::Accumulate( - mozilla::Telemetry::SCROLL_INPUT_METHODS, - (uint32_t)ScrollInputMethod::MainThreadTouch); DispatchEvent(&wheelEvent, status); }