Bug 1547416 - Move nsIPresShell::ScrollAxis to PresShellForwards.h r=smaug
☠☠ backed out by 20d44dfc1b05 ☠ ☠
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 30 Apr 2019 00:07:49 +0000
changeset 471842 d89587999df100be804a749694ac08fffd5ab39d
parent 471841 70463f459a9c740f7b2f3c3fad5c88b017956507
child 471843 6b6600f6781c585371dd334b26ca1a6623c29e28
push id35935
push usershindli@mozilla.com
push dateTue, 30 Apr 2019 03:46:04 +0000
treeherdermozilla-central@f3c2a7206699 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1547416
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1547416 - Move nsIPresShell::ScrollAxis to PresShellForwards.h r=smaug `nsIPresShell::ScrollAxis` can be used anywhere and it's used by some utils actually. So, it should be in `mozilla` namespace and perhaps, `PresShellForwards.h` is a good place to move it rather than creating new header file. Differential Revision: https://phabricator.services.mozilla.com/D29110
accessible/base/nsCoreUtils.cpp
accessible/base/nsCoreUtils.h
accessible/generic/Accessible.cpp
accessible/generic/HyperTextAccessible.cpp
dom/base/Element.cpp
dom/base/Selection.cpp
dom/base/Selection.h
dom/base/nsDOMWindowUtils.cpp
dom/base/nsFocusManager.cpp
dom/events/ContentEventHandler.cpp
layout/base/PresShell.cpp
layout/base/PresShellForwards.h
layout/base/nsIPresShell.h
layout/forms/nsListControlFrame.cpp
layout/generic/nsFrameSelection.cpp
layout/style/ServoBindings.toml
layout/xul/nsMenuPopupFrame.cpp
toolkit/components/satchel/nsFormFillController.cpp
--- a/accessible/base/nsCoreUtils.cpp
+++ b/accessible/base/nsCoreUtils.cpp
@@ -206,25 +206,25 @@ bool nsCoreUtils::IsAncestorOf(nsINode *
     if (parentNode == aPossibleAncestorNode) return true;
   }
 
   return false;
 }
 
 nsresult nsCoreUtils::ScrollSubstringTo(nsIFrame *aFrame, nsRange *aRange,
                                         uint32_t aScrollType) {
-  nsIPresShell::ScrollAxis vertical, horizontal;
+  ScrollAxis vertical, horizontal;
   ConvertScrollTypeToPercents(aScrollType, &vertical, &horizontal);
 
   return ScrollSubstringTo(aFrame, aRange, vertical, horizontal);
 }
 
 nsresult nsCoreUtils::ScrollSubstringTo(nsIFrame *aFrame, nsRange *aRange,
-                                        nsIPresShell::ScrollAxis aVertical,
-                                        nsIPresShell::ScrollAxis aHorizontal) {
+                                        ScrollAxis aVertical,
+                                        ScrollAxis aHorizontal) {
   if (!aFrame || !aRange) {
     return NS_ERROR_FAILURE;
   }
 
   nsPresContext *presContext = aFrame->PresContext();
 
   nsCOMPtr<nsISelectionController> selCon;
   aFrame->GetSelectionController(presContext, getter_AddRefs(selCon));
@@ -257,19 +257,19 @@ void nsCoreUtils::ScrollFrameToPoint(nsI
   nsPoint deltaPoint = point - frameRect.TopLeft();
 
   nsPoint scrollPoint = scrollableFrame->GetScrollPosition();
   scrollPoint -= deltaPoint;
 
   scrollableFrame->ScrollTo(scrollPoint, ScrollMode::Instant);
 }
 
-void nsCoreUtils::ConvertScrollTypeToPercents(
-    uint32_t aScrollType, nsIPresShell::ScrollAxis *aVertical,
-    nsIPresShell::ScrollAxis *aHorizontal) {
+void nsCoreUtils::ConvertScrollTypeToPercents(uint32_t aScrollType,
+                                              ScrollAxis *aVertical,
+                                              ScrollAxis *aHorizontal) {
   WhereToScroll whereY, whereX;
   WhenToScroll whenY, whenX;
   switch (aScrollType) {
     case nsIAccessibleScrollType::SCROLL_TYPE_TOP_LEFT:
       whereY = kScrollToTop;
       whenY = WhenToScroll::Always;
       whereX = kScrollToLeft;
       whenX = WhenToScroll::Always;
@@ -305,18 +305,18 @@ void nsCoreUtils::ConvertScrollTypeToPer
       whenX = WhenToScroll::Always;
       break;
     default:
       whereY = kScrollMinimum;
       whenY = WhenToScroll::IfNotFullyVisible;
       whereX = kScrollMinimum;
       whenX = WhenToScroll::IfNotFullyVisible;
   }
-  *aVertical = nsIPresShell::ScrollAxis(whereY, whenY);
-  *aHorizontal = nsIPresShell::ScrollAxis(whereX, whenX);
+  *aVertical = ScrollAxis(whereY, whenY);
+  *aHorizontal = ScrollAxis(whereX, whenX);
 }
 
 nsIntPoint nsCoreUtils::GetScreenCoordsForWindow(nsINode *aNode) {
   nsIntPoint coords(0, 0);
   nsCOMPtr<nsIDocShellTreeItem> treeItem(GetDocShellFor(aNode));
   if (!treeItem) return coords;
 
   nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
@@ -502,17 +502,17 @@ already_AddRefed<nsTreeColumn> nsCoreUti
 bool nsCoreUtils::IsColumnHidden(nsTreeColumn *aColumn) {
   Element *element = aColumn->Element();
   return element->AttrValueIs(kNameSpaceID_None, nsGkAtoms::hidden,
                               nsGkAtoms::_true, eCaseMatters);
 }
 
 void nsCoreUtils::ScrollTo(PresShell *aPresShell, nsIContent *aContent,
                            uint32_t aScrollType) {
-  nsIPresShell::ScrollAxis vertical, horizontal;
+  ScrollAxis vertical, horizontal;
   ConvertScrollTypeToPercents(aScrollType, &vertical, &horizontal);
   aPresShell->ScrollContentIntoView(aContent, vertical, horizontal,
                                     ScrollFlags::ScrollOverflowHidden);
 }
 
 bool nsCoreUtils::IsWhitespaceString(const nsAString &aString) {
   nsAString::const_char_iterator iterBegin, iterEnd;
 
--- a/accessible/base/nsCoreUtils.h
+++ b/accessible/base/nsCoreUtils.h
@@ -152,37 +152,37 @@ class nsCoreUtils {
    * @param aFrame        the frame for accessible the range belongs to.
    * @param aRange    the range to scroll to
    * @param aVertical     how to align vertically, specified in percents, and
    * when.
    * @param aHorizontal     how to align horizontally, specified in percents,
    * and when.
    */
   static nsresult ScrollSubstringTo(nsIFrame *aFrame, nsRange *aRange,
-                                    nsIPresShell::ScrollAxis aVertical,
-                                    nsIPresShell::ScrollAxis aHorizontal);
+                                    mozilla::ScrollAxis aVertical,
+                                    mozilla::ScrollAxis aHorizontal);
 
   /**
    * Scrolls the given frame to the point, used for implememntation of
    * nsIAccessible::scrollToPoint and nsIAccessibleText::scrollSubstringToPoint.
    *
    * @param aScrollableFrame  the scrollable frame
    * @param aFrame            the frame to scroll
    * @param aPoint            the point scroll to
    */
   static void ScrollFrameToPoint(nsIFrame *aScrollableFrame, nsIFrame *aFrame,
                                  const nsIntPoint &aPoint);
 
   /**
    * Converts scroll type constant defined in nsIAccessibleScrollType to
    * vertical and horizontal parameters.
    */
-  static void ConvertScrollTypeToPercents(
-      uint32_t aScrollType, nsIPresShell::ScrollAxis *aVertical,
-      nsIPresShell::ScrollAxis *aHorizontal);
+  static void ConvertScrollTypeToPercents(uint32_t aScrollType,
+                                          mozilla::ScrollAxis *aVertical,
+                                          mozilla::ScrollAxis *aHorizontal);
 
   /**
    * Returns coordinates in device pixels relative screen for the top level
    * window.
    *
    * @param aNode  the DOM node hosted in the window.
    */
   static nsIntPoint GetScreenCoordsForWindow(nsINode *aNode);
--- a/accessible/generic/Accessible.cpp
+++ b/accessible/generic/Accessible.cpp
@@ -1839,18 +1839,17 @@ void Accessible::DoCommand(nsIContent* a
 
 void Accessible::DispatchClickEvent(nsIContent* aContent,
                                     uint32_t aActionIndex) const {
   if (IsDefunct()) return;
 
   RefPtr<PresShell> presShell = mDoc->PresShellPtr();
 
   // Scroll into view.
-  presShell->ScrollContentIntoView(aContent, nsIPresShell::ScrollAxis(),
-                                   nsIPresShell::ScrollAxis(),
+  presShell->ScrollContentIntoView(aContent, ScrollAxis(), ScrollAxis(),
                                    ScrollFlags::ScrollOverflowHidden);
 
   AutoWeakFrame frame = aContent->GetPrimaryFrame();
   if (!frame) return;
 
   // Compute x and y coordinates.
   nsPoint point;
   nsCOMPtr<nsIWidget> widget = frame->GetNearestWidget(point);
--- a/accessible/generic/HyperTextAccessible.cpp
+++ b/accessible/generic/HyperTextAccessible.cpp
@@ -1272,17 +1272,17 @@ nsresult HyperTextAccessible::SetSelecti
 
   // Set up the selection.
   for (int32_t idx = domSel->RangeCount() - 1; idx > 0; idx--)
     domSel->RemoveRange(*domSel->GetRangeAt(idx), IgnoreErrors());
   SetSelectionBoundsAt(0, aStartPos, aEndPos);
 
   // Make sure it is visible
   domSel->ScrollIntoView(nsISelectionController::SELECTION_FOCUS_REGION,
-                         nsIPresShell::ScrollAxis(), nsIPresShell::ScrollAxis(),
+                         ScrollAxis(), ScrollAxis(),
                          dom::Selection::SCROLL_FOR_CARET_MOVE |
                              dom::Selection::SCROLL_OVERFLOW_HIDDEN);
 
   // When selection is done, move the focus to the selection if accessible is
   // not focusable. That happens when selection is set within hypertext
   // accessible.
   if (isFocusable) return NS_OK;
 
@@ -1641,18 +1641,17 @@ void HyperTextAccessible::ScrollSubstrin
         // avoid divide by zero
         size.width = size.width ? size.width : 1;
         size.height = size.height ? size.height : 1;
 
         int16_t hPercent = offsetPointX * 100 / size.width;
         int16_t vPercent = offsetPointY * 100 / size.height;
 
         nsresult rv = nsCoreUtils::ScrollSubstringTo(
-            frame, range, nsIPresShell::ScrollAxis(vPercent),
-            nsIPresShell::ScrollAxis(hPercent));
+            frame, range, ScrollAxis(vPercent), ScrollAxis(hPercent));
         if (NS_FAILED(rv)) return;
 
         initialScrolled = true;
       } else {
         // Substring was scrolled to the given point already inside its closest
         // scrollable area. If there are nested scrollable areas then make
         // sure we scroll lower areas to the given point inside currently
         // traversed scrollable area.
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -778,20 +778,18 @@ void Element::ScrollIntoView(const Scrol
   } else if (aOptions.mBehavior == ScrollBehavior::Auto) {
     scrollFlags |= ScrollFlags::ScrollSmoothAuto;
   }
   if (StaticPrefs::layout_css_scroll_snap_v1_enabled()) {
     scrollFlags |= ScrollFlags::ScrollSnap;
   }
 
   presShell->ScrollContentIntoView(
-      this,
-      nsIPresShell::ScrollAxis(whereToScrollVertically, WhenToScroll::Always),
-      nsIPresShell::ScrollAxis(whereToScrollHorizontally, WhenToScroll::Always),
-      scrollFlags);
+      this, ScrollAxis(whereToScrollVertically, WhenToScroll::Always),
+      ScrollAxis(whereToScrollHorizontally, WhenToScroll::Always), scrollFlags);
 }
 
 void Element::Scroll(const CSSIntPoint& aScroll,
                      const ScrollOptions& aOptions) {
   nsIScrollableFrame* sf = GetScrollFrame();
   if (sf) {
     ScrollMode scrollMode = ScrollMode::Instant;
     if (aOptions.mBehavior == ScrollBehavior::Smooth) {
--- a/dom/base/Selection.cpp
+++ b/dom/base/Selection.cpp
@@ -1872,18 +1872,18 @@ nsresult Selection::DoAutoScroll(nsIFram
   // Get the point relative to the root most frame because the scroll we are
   // about to do will change the coordinates of aFrame.
   nsPoint globalPoint = aPoint + aFrame->GetOffsetToCrossDoc(rootmostFrame);
 
   bool done = false;
   bool didScroll;
   while (true) {
     didScroll = presShell->ScrollFrameRectIntoView(
-        aFrame, nsRect(aPoint, nsSize(0, 0)), nsIPresShell::ScrollAxis(),
-        nsIPresShell::ScrollAxis(), ScrollFlags::IgnoreMarginAndPadding);
+        aFrame, nsRect(aPoint, nsSize(0, 0)), ScrollAxis(), ScrollAxis(),
+        ScrollFlags::IgnoreMarginAndPadding);
     if (!weakFrame || !weakRootFrame) {
       return NS_OK;
     }
     if (!didScroll && !done) {
       // If aPoint is at the screen edge then try to scroll anyway, once.
       RefPtr<nsDeviceContext> dx =
           presShell->GetViewManager()->GetDeviceContext();
       nsRect screen;
@@ -3001,19 +3001,20 @@ Selection::ScrollSelectionIntoViewEvent:
   Selection* sel = mSelection;  // workaround to satisfy static analysis
   RefPtr<Selection> kungFuDeathGrip(sel);
   mSelection->mScrollEvent.Forget();
   mSelection->ScrollIntoView(mRegion, mVerticalScroll, mHorizontalScroll,
                              mFlags | flags);
   return NS_OK;
 }
 
-nsresult Selection::PostScrollSelectionIntoViewEvent(
-    SelectionRegion aRegion, int32_t aFlags, nsIPresShell::ScrollAxis aVertical,
-    nsIPresShell::ScrollAxis aHorizontal) {
+nsresult Selection::PostScrollSelectionIntoViewEvent(SelectionRegion aRegion,
+                                                     int32_t aFlags,
+                                                     ScrollAxis aVertical,
+                                                     ScrollAxis aHorizontal) {
   // If we've already posted an event, revoke it and place a new one at the
   // end of the queue to make sure that any new pending reflow events are
   // processed before we scroll. This will insure that we scroll to the
   // correct place on screen.
   mScrollEvent.Revoke();
   nsPresContext* presContext = GetPresContext();
   NS_ENSURE_STATE(presContext);
   nsRefreshDriver* refreshDriver = presContext->RefreshDriver();
@@ -3024,26 +3025,25 @@ nsresult Selection::PostScrollSelectionI
   refreshDriver->AddEarlyRunner(mScrollEvent.get());
   return NS_OK;
 }
 
 void Selection::ScrollIntoView(int16_t aRegion, bool aIsSynchronous,
                                WhereToScroll aVPercent, WhereToScroll aHPercent,
                                ErrorResult& aRv) {
   int32_t flags = aIsSynchronous ? Selection::SCROLL_SYNCHRONOUS : 0;
-  nsresult rv = ScrollIntoView(aRegion, nsIPresShell::ScrollAxis(aVPercent),
-                               nsIPresShell::ScrollAxis(aHPercent), flags);
+  nsresult rv = ScrollIntoView(aRegion, ScrollAxis(aVPercent),
+                               ScrollAxis(aHPercent), flags);
   if (NS_FAILED(rv)) {
     aRv.Throw(rv);
   }
 }
 
 nsresult Selection::ScrollIntoView(SelectionRegion aRegion,
-                                   nsIPresShell::ScrollAxis aVertical,
-                                   nsIPresShell::ScrollAxis aHorizontal,
+                                   ScrollAxis aVertical, ScrollAxis aHorizontal,
                                    int32_t aFlags) {
   if (!mFrameSelection) {
     return NS_OK;
   }
 
   PresShell* presShell = mFrameSelection->GetPresShell();
   if (!presShell || !presShell->GetDocument()) {
     return NS_OK;
--- a/dom/base/Selection.h
+++ b/dom/base/Selection.h
@@ -6,17 +6,17 @@
 
 #ifndef mozilla_Selection_h__
 #define mozilla_Selection_h__
 
 #include "nsIWeakReference.h"
 
 #include "mozilla/AccessibleCaretEventHub.h"
 #include "mozilla/AutoRestore.h"
-#include "mozilla/PresShell.h"  // For ScrollAxis
+#include "mozilla/PresShell.h"
 #include "mozilla/RangeBoundary.h"
 #include "mozilla/SelectionChangeEventDispatcher.h"
 #include "mozilla/TextRange.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/WeakPtr.h"
 #include "nsDirection.h"
 #include "nsISelectionController.h"
 #include "nsISelectionListener.h"
@@ -131,37 +131,37 @@ class Selection final : public nsSupport
   // region rects.
   nsIFrame* GetSelectionAnchorGeometry(SelectionRegion aRegion, nsRect* aRect);
   // Returns the position of the region (SELECTION_ANCHOR_REGION or
   // SELECTION_FOCUS_REGION only), and frame that that position is relative to.
   // The 'position' is a zero-width rectangle.
   nsIFrame* GetSelectionEndPointGeometry(SelectionRegion aRegion,
                                          nsRect* aRect);
 
-  nsresult PostScrollSelectionIntoViewEvent(
-      SelectionRegion aRegion, int32_t aFlags,
-      nsIPresShell::ScrollAxis aVertical, nsIPresShell::ScrollAxis aHorizontal);
+  nsresult PostScrollSelectionIntoViewEvent(SelectionRegion aRegion,
+                                            int32_t aFlags,
+                                            ScrollAxis aVertical,
+                                            ScrollAxis aHorizontal);
   enum {
     SCROLL_SYNCHRONOUS = 1 << 1,
     SCROLL_FIRST_ANCESTOR_ONLY = 1 << 2,
     SCROLL_DO_FLUSH =
         1 << 3,  // only matters if SCROLL_SYNCHRONOUS is passed too
     SCROLL_OVERFLOW_HIDDEN = 1 << 5,
     SCROLL_FOR_CARET_MOVE = 1 << 6
   };
   // If aFlags doesn't contain SCROLL_SYNCHRONOUS, then we'll flush when
   // the scroll event fires so we make sure to scroll to the right place.
   // Otherwise, if SCROLL_DO_FLUSH is also in aFlags, then this method will
   // flush layout and you MUST hold a strong ref on 'this' for the duration
   // of this call.  This might destroy arbitrary layout objects.
-  nsresult ScrollIntoView(
-      SelectionRegion aRegion,
-      nsIPresShell::ScrollAxis aVertical = nsIPresShell::ScrollAxis(),
-      nsIPresShell::ScrollAxis aHorizontal = nsIPresShell::ScrollAxis(),
-      int32_t aFlags = 0);
+  nsresult ScrollIntoView(SelectionRegion aRegion,
+                          ScrollAxis aVertical = ScrollAxis(),
+                          ScrollAxis aHorizontal = ScrollAxis(),
+                          int32_t aFlags = 0);
   nsresult SubtractRange(RangeData* aRange, nsRange* aSubtract,
                          nsTArray<RangeData>* aOutput);
   /**
    * AddItem adds aRange to this Selection.  If mUserInitiated is true,
    * then aRange is first scanned for -moz-user-select:none nodes and split up
    * into multiple ranges to exclude those before adding the resulting ranges
    * to this Selection.
    */
@@ -659,34 +659,33 @@ class Selection final : public nsSupport
   friend struct mozilla::AutoPrepareFocusRange;
   class ScrollSelectionIntoViewEvent;
   friend class ScrollSelectionIntoViewEvent;
 
   class ScrollSelectionIntoViewEvent : public Runnable {
    public:
     NS_DECL_NSIRUNNABLE
     ScrollSelectionIntoViewEvent(Selection* aSelection, SelectionRegion aRegion,
-                                 nsIPresShell::ScrollAxis aVertical,
-                                 nsIPresShell::ScrollAxis aHorizontal,
+                                 ScrollAxis aVertical, ScrollAxis aHorizontal,
                                  int32_t aFlags)
         : Runnable("dom::Selection::ScrollSelectionIntoViewEvent"),
           mSelection(aSelection),
           mRegion(aRegion),
           mVerticalScroll(aVertical),
           mHorizontalScroll(aHorizontal),
           mFlags(aFlags) {
       NS_ASSERTION(aSelection, "null parameter");
     }
     void Revoke() { mSelection = nullptr; }
 
    private:
     Selection* mSelection;
     SelectionRegion mRegion;
-    nsIPresShell::ScrollAxis mVerticalScroll;
-    nsIPresShell::ScrollAxis mHorizontalScroll;
+    ScrollAxis mVerticalScroll;
+    ScrollAxis mHorizontalScroll;
     int32_t mFlags;
   };
 
   /**
    * Set mAnchorFocusRange to mRanges[aIndex] if aIndex is a valid index.
    * Set mAnchorFocusRange to nullptr if aIndex is negative.
    * Otherwise, i.e., if aIndex is positive but out of bounds of mRanges, do
    * nothing.
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -2511,19 +2511,18 @@ nsDOMWindowUtils::ZoomToFocusedInput() {
       flags |= layers::ONLY_ZOOM_TO_DEFAULT_SCALE;
     }
 
     // The content may be inside a scrollable subframe inside a non-scrollable
     // root content document. In this scenario, we want to ensure that the
     // main-thread side knows to scroll the content into view before we get
     // the bounding content rect and ask APZ to adjust the visual viewport.
     presShell->ScrollContentIntoView(
-        content,
-        nsIPresShell::ScrollAxis(kScrollMinimum, WhenToScroll::IfNotVisible),
-        nsIPresShell::ScrollAxis(kScrollMinimum, WhenToScroll::IfNotVisible),
+        content, ScrollAxis(kScrollMinimum, WhenToScroll::IfNotVisible),
+        ScrollAxis(kScrollMinimum, WhenToScroll::IfNotVisible),
         ScrollFlags::ScrollOverflowHidden);
 
     CSSRect bounds =
         nsLayoutUtils::GetBoundingContentRect(content, rootScrollFrame);
     if (bounds.IsEmpty()) {
       // Do not zoom on empty bounds. Bail out.
       return NS_OK;
     }
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -2130,20 +2130,18 @@ void nsFocusManager::ScrollIntoView(Pres
                                     uint32_t aFlags) {
   // if the noscroll flag isn't set, scroll the newly focused element into view
   if (!(aFlags & FLAG_NOSCROLL)) {
     ScrollFlags scrollFlags = ScrollFlags::ScrollOverflowHidden;
     if (!(aFlags & FLAG_BYELEMENTFOCUS)) {
       scrollFlags |= ScrollFlags::IgnoreMarginAndPadding;
     }
     aPresShell->ScrollContentIntoView(
-        aContent,
-        nsIPresShell::ScrollAxis(kScrollMinimum, WhenToScroll::IfNotVisible),
-        nsIPresShell::ScrollAxis(kScrollMinimum, WhenToScroll::IfNotVisible),
-        scrollFlags);
+        aContent, ScrollAxis(kScrollMinimum, WhenToScroll::IfNotVisible),
+        ScrollAxis(kScrollMinimum, WhenToScroll::IfNotVisible), scrollFlags);
   }
 }
 
 void nsFocusManager::RaiseWindow(nsPIDOMWindowOuter* aWindow) {
   // don't raise windows that are already raised or are in the process of
   // being lowered
   if (!aWindow || aWindow == mActiveWindow || aWindow == mWindowBeingLowered)
     return;
--- a/dom/events/ContentEventHandler.cpp
+++ b/dom/events/ContentEventHandler.cpp
@@ -2999,18 +2999,17 @@ nsresult ContentEventHandler::OnSelectio
         ->SetBaseAndExtentInLimiter(*startNodeStrong, startNodeOffset,
                                     *endNodeStrong, endNodeOffset, error);
     if (NS_WARN_IF(error.Failed())) {
       return error.StealNSResult();
     }
   }
 
   mSelection->ScrollIntoView(nsISelectionController::SELECTION_FOCUS_REGION,
-                             nsIPresShell::ScrollAxis(),
-                             nsIPresShell::ScrollAxis(), 0);
+                             ScrollAxis(), ScrollAxis(), 0);
   aEvent->mSucceeded = true;
   return NS_OK;
 }
 
 nsRect ContentEventHandler::FrameRelativeRect::RectRelativeTo(
     nsIFrame* aDestFrame) const {
   if (!mBaseFrame || NS_WARN_IF(!aDestFrame)) {
     return nsRect();
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -3310,20 +3310,18 @@ static nscoord ComputeWhereToScroll(Wher
  * Note that, since we are performing a layout scroll, it's possible that
  * this fnction will sometimes be unsuccessful; the content will move as
  * fast as it can on the screen using layout viewport scrolling, and then
  * stop there, even if it could get closer to the desired position by
  * moving the visual viewport within the layout viewport.
  */
 static void ScrollToShowRect(nsIPresShell* aPresShell,
                              nsIScrollableFrame* aFrameAsScrollable,
-                             const nsRect& aRect,
-                             nsIPresShell::ScrollAxis aVertical,
-                             nsIPresShell::ScrollAxis aHorizontal,
-                             ScrollFlags aScrollFlags) {
+                             const nsRect& aRect, ScrollAxis aVertical,
+                             ScrollAxis aHorizontal, ScrollFlags aScrollFlags) {
   nsPoint scrollPt = aFrameAsScrollable->GetVisualViewportOffset();
   nsRect visibleRect(scrollPt, aFrameAsScrollable->GetVisualViewportSize());
 
   nsSize lineSize;
   // Don't call GetLineScrollAmount unless we actually need it. Not only
   // does this save time, but it's not safe to call GetLineScrollAmount
   // during reflow (because it depends on font size inflation and doesn't
   // use the in-reflow-safe font-size inflation path). If we did call it,
@@ -3394,18 +3392,18 @@ static void ScrollToShowRect(nsIPresShel
         aPresShell->GetPresContext()->IsRootContentDocument()) {
       aPresShell->ScrollToVisual(scrollPt, FrameMetrics::eMainThread,
                                  scrollMode);
     }
   }
 }
 
 nsresult PresShell::ScrollContentIntoView(nsIContent* aContent,
-                                          nsIPresShell::ScrollAxis aVertical,
-                                          nsIPresShell::ScrollAxis aHorizontal,
+                                          ScrollAxis aVertical,
+                                          ScrollAxis aHorizontal,
                                           ScrollFlags aScrollFlags) {
   NS_ENSURE_TRUE(aContent, NS_ERROR_NULL_POINTER);
   RefPtr<Document> composedDoc = aContent->GetComposedDoc();
   NS_ENSURE_STATE(composedDoc);
 
   NS_ASSERTION(mDidInitialize, "should have done initial reflow by now");
 
   if (mContentToScrollTo) {
@@ -3512,18 +3510,18 @@ void PresShell::DoScrollContentIntoView(
 
   ScrollFrameRectIntoView(container, frameBounds, data->mContentScrollVAxis,
                           data->mContentScrollHAxis,
                           data->mContentToScrollToFlags);
 }
 
 bool nsIPresShell::ScrollFrameRectIntoView(nsIFrame* aFrame,
                                            const nsRect& aRect,
-                                           nsIPresShell::ScrollAxis aVertical,
-                                           nsIPresShell::ScrollAxis aHorizontal,
+                                           ScrollAxis aVertical,
+                                           ScrollAxis aHorizontal,
                                            ScrollFlags aScrollFlags) {
   bool didScroll = false;
   // This function needs to work even if rect has a width or height of 0.
   nsRect rect = aRect;
   nsIFrame* container = aFrame;
   // Walk up the frame hierarchy scrolling the rect into view and
   // keeping rect relative to container
   do {
@@ -8508,25 +8506,23 @@ bool PresShell::EventHandler::PrepareToU
     // ScrollContentIntoView, which has a one-pixel disagreement of whether the
     // frame is actually in view. The result is that the frame is aligned with
     // the top of the window, but the menu is still at the bottom.
     //
     // Doing this call first forces the frame to be in view, eliminating the
     // problem. The only difference in the result is that if your cursor is in
     // an edit box below the current view, you'll get the edit box aligned with
     // the top of the window. This is arguably better behavior anyway.
-    rv = MOZ_KnownLive(mPresShell)
-             ->ScrollContentIntoView(
-                 content,
-                 nsIPresShell::ScrollAxis(kScrollMinimum,
-                                          WhenToScroll::IfNotVisible),
-                 nsIPresShell::ScrollAxis(kScrollMinimum,
-                                          WhenToScroll::IfNotVisible),
-                 ScrollFlags::ScrollOverflowHidden |
-                     ScrollFlags::IgnoreMarginAndPadding);
+    rv =
+        MOZ_KnownLive(mPresShell)
+            ->ScrollContentIntoView(
+                content, ScrollAxis(kScrollMinimum, WhenToScroll::IfNotVisible),
+                ScrollAxis(kScrollMinimum, WhenToScroll::IfNotVisible),
+                ScrollFlags::ScrollOverflowHidden |
+                    ScrollFlags::IgnoreMarginAndPadding);
     NS_ENSURE_SUCCESS(rv, false);
     frame = content->GetPrimaryFrame();
     NS_WARNING_ASSERTION(frame, "No frame for focused content?");
   }
 
   // Actually scroll the selection (ie caret) into view. Note that this must
   // be synchronous since we will be checking the caret position on the screen.
   //
--- a/layout/base/PresShellForwards.h
+++ b/layout/base/PresShellForwards.h
@@ -72,31 +72,81 @@ enum class ReflowRootHandling {
   InferFromBitToAdd,       // is changing iff (aBitToAdd == NS_FRAME_IS_DIRTY)
 
   // Note:  With eStyleChange, these can also apply to out-of-flows
   // in addition to aFrame.
 };
 
 // WhereToScroll should be 0 ~ 100 or -1.  When it's in 0 ~ 100, it means
 // percentage of scrollTop/scrollLeft in scrollHeight/scrollWidth.
-// See ComputeWhereToScroll() for the detail.
+// See the comment for constructor of ScrollAxis for the detail.
 typedef int16_t WhereToScroll;
 static const WhereToScroll kScrollToTop = 0;
 static const WhereToScroll kScrollToLeft = 0;
 static const WhereToScroll kScrollToCenter = 50;
 static const WhereToScroll kScrollToBottom = 100;
 static const WhereToScroll kScrollToRight = 100;
 static const WhereToScroll kScrollMinimum = -1;
 
+// See the comment for constructor of ScrollAxis for the detail.
 enum class WhenToScroll : uint8_t {
   Always,
   IfNotVisible,
   IfNotFullyVisible,
 };
 
+struct ScrollAxis final {
+  /**
+   * aWhere:
+   *   Either a percentage or a special value. PresShell defines:
+   *   * (Default) kScrollMinimum = -1: The visible area is scrolled the
+   *     minimum amount to show as much as possible of the frame. This won't
+   *     hide any initially visible part of the frame.
+   *   * kScrollToTop = 0: The frame's upper edge is aligned with the top edge
+   *     of the visible area.
+   *   * kScrollToBottom = 100: The frame's bottom edge is aligned with the
+   *     bottom edge of the visible area.
+   *   * kScrollToLeft = 0: The frame's left edge is aligned with the left edge
+   *     of the visible area.
+   *   * kScrollToRight = 100: The frame's right edge is aligned* with the right
+   *     edge of the visible area.
+   *   * kScrollToCenter = 50: The frame is centered along the axis the
+   *     ScrollAxis is used for.
+   *
+   *   Other values are treated as a percentage, and the point*"percent"
+   *   down the frame is placed at the point "percent" down the visible area.
+   *
+   * aWhen:
+   *   * (Default) WhenToScroll::IfNotFullyVisible: Move the frame only if it is
+   *     not fully visible (including if it's not visible at all). Note that
+   *     in this case if the frame is too large to fit in view, it will only
+   *     be scrolled if more of it can fit than is already in view.
+   *   * WhenToScroll::IfNotVisible: Move the frame only if none of it is
+   *     visible.
+   *   * WhenToScroll::Always: Move the frame regardless of its current
+   *     visibility.
+   *
+   * aOnlyIfPerceivedScrollableDirection:
+   *   If the direction is not a perceived scrollable direction (i.e. no
+   *   scrollbar showing and less than one device pixel of scrollable
+   *   distance), don't scroll. Defaults to false.
+   */
+  explicit ScrollAxis(WhereToScroll aWhere = kScrollMinimum,
+                      WhenToScroll aWhen = WhenToScroll::IfNotFullyVisible,
+                      bool aOnlyIfPerceivedScrollableDirection = false)
+      : mWhereToScroll(aWhere),
+        mWhenToScroll(aWhen),
+        mOnlyIfPerceivedScrollableDirection(
+            aOnlyIfPerceivedScrollableDirection) {}
+
+  WhereToScroll mWhereToScroll;
+  WhenToScroll mWhenToScroll;
+  bool mOnlyIfPerceivedScrollableDirection : 1;
+};
+
 enum class ScrollFlags {
   None = 0,
   ScrollFirstAncestorOnly = 1 << 0,
   ScrollOverflowHidden = 1 << 1,
   ScrollNoParentFrames = 1 << 2,
   ScrollSmooth = 1 << 3,
   ScrollSmoothAuto = 1 << 4,
   ScrollSnap = 1 << 5,
--- a/layout/base/nsIPresShell.h
+++ b/layout/base/nsIPresShell.h
@@ -614,63 +614,16 @@ class nsIPresShell : public nsStubDocume
 
   /**
    * Get a reference rendering context. This is a context that should not
    * be rendered to, but is suitable for measuring text and performing
    * other non-rendering operations. Guaranteed to return non-null.
    */
   already_AddRefed<gfxContext> CreateReferenceRenderingContext();
 
-  typedef struct ScrollAxis {
-    mozilla::WhereToScroll mWhereToScroll;
-    mozilla::WhenToScroll mWhenToScroll;
-    bool mOnlyIfPerceivedScrollableDirection : 1;
-    /**
-     * aWhere:
-     *   Either a percentage or a special value. nsIPresShell defines:
-     *   * (Default) SCROLL_MINIMUM = -1: The visible area is scrolled the
-     *     minimum amount to show as much as possible of the frame. This won't
-     *     hide any initially visible part of the frame.
-     *   * SCROLL_TOP = 0: The frame's upper edge is aligned with the top edge
-     *     of the visible area.
-     *   * SCROLL_BOTTOM = 100: The frame's bottom edge is aligned with the
-     *     bottom edge of the visible area.
-     *   * SCROLL_LEFT = 0: The frame's left edge is aligned with the left edge
-     *     of the visible area.
-     *   * SCROLL_RIGHT = 100: The frame's right edge is aligned* with the right
-     *     edge of the visible area.
-     *   * SCROLL_CENTER = 50: The frame is centered along the axis the
-     *     ScrollAxis is used for.
-     *
-     *   Other values are treated as a percentage, and the point*"percent"
-     *   down the frame is placed at the point "percent" down the visible area.
-     *
-     * aWhen:
-     *   * (Default) SCROLL_IF_NOT_FULLY_VISIBLE: Move the frame only if it is
-     *     not fully visible (including if it's not visible at all). Note that
-     *     in this case if the frame is too large to fit in view, it will only
-     *     be scrolled if more of it can fit than is already in view.
-     *   * SCROLL_IF_NOT_VISIBLE: Move the frame only if none of it is visible.
-     *   * SCROLL_ALWAYS: Move the frame regardless of its current visibility.
-     *
-     * aOnlyIfPerceivedScrollableDirection:
-     *   If the direction is not a perceived scrollable direction (i.e. no
-     *   scrollbar showing and less than one device pixel of scrollable
-     *   distance), don't scroll. Defaults to false.
-     */
-    explicit ScrollAxis(
-        mozilla::WhereToScroll aWhere = mozilla::kScrollMinimum,
-        mozilla::WhenToScroll aWhen = mozilla::WhenToScroll::IfNotFullyVisible,
-        bool aOnlyIfPerceivedScrollableDirection = false)
-        : mWhereToScroll(aWhere),
-          mWhenToScroll(aWhen),
-          mOnlyIfPerceivedScrollableDirection(
-              aOnlyIfPerceivedScrollableDirection) {}
-  } ScrollAxis;
-
   /**
    * Scrolls the view of the document so that the given area of a frame
    * is visible, if possible. Layout is not flushed before scrolling.
    *
    * @param aRect relative to aFrame
    * @param aVertical see ScrollContentIntoView and ScrollAxis
    * @param aHorizontal see ScrollContentIntoView and ScrollAxis
    * @param aScrollFlags if SCROLL_FIRST_ANCESTOR_ONLY is set, only the
@@ -685,17 +638,18 @@ class nsIPresShell : public nsStubDocume
    * contain this document in a iframe or the like.
    * If SCROLL_IGNORE_SCROLL_MARGIN_AND_PADDING is set we ignore scroll-margin
    * value specified for |aFrame| and scroll-padding value for the scroll
    * container. This option is typically used to locate poped-up frames into
    * view.
    * @return true if any scrolling happened, false if no scrolling happened
    */
   bool ScrollFrameRectIntoView(nsIFrame* aFrame, const nsRect& aRect,
-                               ScrollAxis aVertical, ScrollAxis aHorizontal,
+                               mozilla::ScrollAxis aVertical,
+                               mozilla::ScrollAxis aHorizontal,
                                mozilla::ScrollFlags aScrollFlags);
 
   /**
    * Determine if a rectangle specified in the frame's coordinate system
    * intersects "enough" with the viewport to be considered visible. This
    * is not a strict test against the viewport -- it's a test against
    * the intersection of the viewport and the frame's ancestor scrollable
    * frames. If it doesn't intersect enough, return a value indicating
@@ -1556,18 +1510,18 @@ class nsIPresShell : public nsStubDocume
   void RemoveSheet(mozilla::StyleOrigin, mozilla::StyleSheet*);
   void RemovePreferenceStyles();
 
   void WillDoReflow();
 
   // This data is stored as a content property (nsGkAtoms::scrolling) on
   // mContentToScrollTo when we have a pending ScrollIntoView.
   struct ScrollIntoViewData {
-    ScrollAxis mContentScrollVAxis;
-    ScrollAxis mContentScrollHAxis;
+    mozilla::ScrollAxis mContentScrollVAxis;
+    mozilla::ScrollAxis mContentScrollHAxis;
     mozilla::ScrollFlags mContentToScrollToFlags;
   };
 
   static mozilla::LazyLogModule gLog;
 
   DOMHighResTimeStamp GetPerformanceNowUnclamped();
 
   // The callback for the mReflowContinueTimer timer.
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -1808,18 +1808,18 @@ void nsListControlFrame::ScrollToIndex(i
   }
 }
 
 void nsListControlFrame::ScrollToFrame(dom::HTMLOptionElement& aOptElement) {
   // otherwise we find the content's frame and scroll to it
   nsIFrame* childFrame = aOptElement.GetPrimaryFrame();
   if (childFrame) {
     PresShell()->ScrollFrameRectIntoView(
-        childFrame, nsRect(nsPoint(0, 0), childFrame->GetSize()),
-        nsIPresShell::ScrollAxis(), nsIPresShell::ScrollAxis(),
+        childFrame, nsRect(nsPoint(0, 0), childFrame->GetSize()), ScrollAxis(),
+        ScrollAxis(),
         ScrollFlags::ScrollOverflowHidden |
             ScrollFlags::ScrollFirstAncestorOnly |
             ScrollFlags::IgnoreMarginAndPadding);
   }
 }
 
 //---------------------------------------------------------------------
 // Ok, the entire idea of this routine is to move to the next item that
--- a/layout/generic/nsFrameSelection.cpp
+++ b/layout/generic/nsFrameSelection.cpp
@@ -697,18 +697,17 @@ nsresult nsFrameSelection::MoveCaret(nsD
         offset = anchorFocusRange->StartOffset();
       } else {
         node = anchorFocusRange->GetEndContainer();
         offset = anchorFocusRange->EndOffset();
       }
       sel->Collapse(node, offset);
     }
     sel->ScrollIntoView(nsISelectionController::SELECTION_FOCUS_REGION,
-                        nsIPresShell::ScrollAxis(), nsIPresShell::ScrollAxis(),
-                        scrollFlags);
+                        ScrollAxis(), ScrollAxis(), scrollFlags);
     return NS_OK;
   }
 
   nsIFrame* frame;
   int32_t offsetused = 0;
   nsresult result =
       sel->GetPrimaryFrameForFocusNode(&frame, &offsetused, visualMovement);
 
@@ -827,18 +826,18 @@ nsresult nsFrameSelection::MoveCaret(nsD
     if (!isBRFrame) {
       mHint = CARET_ASSOCIATE_BEFORE;  // We're now at the end of the frame to
                                        // the left.
     }
     result = NS_OK;
   }
   if (NS_SUCCEEDED(result)) {
     result = mDomSelections[index]->ScrollIntoView(
-        nsISelectionController::SELECTION_FOCUS_REGION,
-        nsIPresShell::ScrollAxis(), nsIPresShell::ScrollAxis(), scrollFlags);
+        nsISelectionController::SELECTION_FOCUS_REGION, ScrollAxis(),
+        ScrollAxis(), scrollFlags);
   }
 
   return result;
 }
 
 nsPrevNextBidiLevels nsFrameSelection::GetPrevNextBidiLevels(
     nsIContent* aNode, uint32_t aContentOffset, bool aJumpLines) const {
   return GetPrevNextBidiLevels(aNode, aContentOffset, mHint, aJumpLines);
@@ -1384,39 +1383,38 @@ Selection* nsFrameSelection::GetSelectio
 nsresult nsFrameSelection::ScrollSelectionIntoView(SelectionType aSelectionType,
                                                    SelectionRegion aRegion,
                                                    int16_t aFlags) const {
   int8_t index = GetIndexFromSelectionType(aSelectionType);
   if (index < 0) return NS_ERROR_INVALID_ARG;
 
   if (!mDomSelections[index]) return NS_ERROR_NULL_POINTER;
 
-  nsIPresShell::ScrollAxis verticalScroll = nsIPresShell::ScrollAxis();
+  ScrollAxis verticalScroll = ScrollAxis();
   int32_t flags = Selection::SCROLL_DO_FLUSH;
   if (aFlags & nsISelectionController::SCROLL_SYNCHRONOUS) {
     flags |= Selection::SCROLL_SYNCHRONOUS;
   } else if (aFlags & nsISelectionController::SCROLL_FIRST_ANCESTOR_ONLY) {
     flags |= Selection::SCROLL_FIRST_ANCESTOR_ONLY;
   }
   if (aFlags & nsISelectionController::SCROLL_OVERFLOW_HIDDEN) {
     flags |= Selection::SCROLL_OVERFLOW_HIDDEN;
   }
   if (aFlags & nsISelectionController::SCROLL_CENTER_VERTICALLY) {
-    verticalScroll = nsIPresShell::ScrollAxis(kScrollToCenter,
-                                              WhenToScroll::IfNotFullyVisible);
+    verticalScroll =
+        ScrollAxis(kScrollToCenter, WhenToScroll::IfNotFullyVisible);
   }
   if (aFlags & nsISelectionController::SCROLL_FOR_CARET_MOVE) {
     flags |= Selection::SCROLL_FOR_CARET_MOVE;
   }
 
   // After ScrollSelectionIntoView(), the pending notifications might be
   // flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
   RefPtr<Selection> sel = mDomSelections[index];
-  return sel->ScrollIntoView(aRegion, verticalScroll,
-                             nsIPresShell::ScrollAxis(), flags);
+  return sel->ScrollIntoView(aRegion, verticalScroll, ScrollAxis(), flags);
 }
 
 nsresult nsFrameSelection::RepaintSelection(SelectionType aSelectionType) {
   int8_t index = GetIndexFromSelectionType(aSelectionType);
   if (index < 0) return NS_ERROR_INVALID_ARG;
   if (!mDomSelections[index]) return NS_ERROR_NULL_POINTER;
   NS_ENSURE_STATE(mPresShell);
 
--- a/layout/style/ServoBindings.toml
+++ b/layout/style/ServoBindings.toml
@@ -351,31 +351,31 @@ opaque-types = [
     "mozilla::detail::HashTable", # <- We should be able to remove this and
                                   # HashSet below once
                                   # https://github.com/rust-lang/rust-bindgen/pull/1515
                                   # is available
     "mozilla::detail::PointerType",
     "mozilla::HashSet",
     "mozilla::Pair",
     "mozilla::Pair_Base",
+    "mozilla::ScrollAxis",  # <- For some reason the alignment of this is 4
+                            # for clang.
     "mozilla::SeenPtrs",
     "mozilla::SupportsWeakPtr",
     "mozilla::Tuple",
     "SupportsWeakPtr",
     "mozilla::detail::WeakReference",
     "mozilla::WeakPtr",
     "nsWritingIterator_reference", "nsReadingIterator_reference",
     "nsTObserverArray",  # <- Inherits from nsAutoTObserverArray<T, 0>
     "nsTHashtable",  # <- Inheriting from inner typedefs that clang
                      #    doesn't expose properly.
     "nsBaseHashtable", "nsRefPtrHashtable", "nsDataHashtable", "nsClassHashtable",  # <- Ditto
     "nsInterfaceHashtable",  # <- Ditto
     "mozilla::dom::Document_SelectorCache",  # <- Inherits from nsExpirationTracker<.., 4>
-    "nsIPresShell_ScrollAxis",  # <- For some reason the alignment of this is 4
-                                # for clang.
     "nsPIDOMWindow",  # <- Takes the vtable from a template parameter, and we can't
                       #    generate it conditionally.
     "JS::Rooted",
     "mozilla::Maybe",
     "gfxSize",  # <- union { struct { T width; T height; }; T components[2] };
     "gfxSize_Super",  # Ditto.
     "mozilla::StyleAnimationValue",
     "StyleAnimationValue", # pulls in a whole bunch of stuff we don't need in the bindings
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -1809,17 +1809,17 @@ nsIScrollableFrame* nsMenuPopupFrame::Ge
 
   return nullptr;
 }
 
 void nsMenuPopupFrame::EnsureMenuItemIsVisible(nsMenuFrame* aMenuItem) {
   if (aMenuItem) {
     aMenuItem->PresShell()->ScrollFrameRectIntoView(
         aMenuItem, nsRect(nsPoint(0, 0), aMenuItem->GetRect().Size()),
-        nsIPresShell::ScrollAxis(), nsIPresShell::ScrollAxis(),
+        ScrollAxis(), ScrollAxis(),
         ScrollFlags::ScrollOverflowHidden |
             ScrollFlags::ScrollFirstAncestorOnly |
             ScrollFlags::IgnoreMarginAndPadding);
   }
 }
 
 void nsMenuPopupFrame::ChangeByPage(bool aIsUp) {
   // Only scroll by page within menulists.
--- a/toolkit/components/satchel/nsFormFillController.cpp
+++ b/toolkit/components/satchel/nsFormFillController.cpp
@@ -382,19 +382,18 @@ nsFormFillController::SetPopupOpen(bool 
       // make sure input field is visible before showing popup (bug 320938)
       nsCOMPtr<nsIContent> content = mFocusedInput;
       NS_ENSURE_STATE(content);
       nsCOMPtr<nsIDocShell> docShell = GetDocShellForInput(mFocusedInput);
       NS_ENSURE_STATE(docShell);
       RefPtr<PresShell> presShell = docShell->GetPresShell();
       NS_ENSURE_STATE(presShell);
       presShell->ScrollContentIntoView(
-          content,
-          nsIPresShell::ScrollAxis(kScrollMinimum, WhenToScroll::IfNotVisible),
-          nsIPresShell::ScrollAxis(kScrollMinimum, WhenToScroll::IfNotVisible),
+          content, ScrollAxis(kScrollMinimum, WhenToScroll::IfNotVisible),
+          ScrollAxis(kScrollMinimum, WhenToScroll::IfNotVisible),
           ScrollFlags::ScrollOverflowHidden |
               ScrollFlags::IgnoreMarginAndPadding);
       // mFocusedPopup can be destroyed after ScrollContentIntoView, see bug
       // 420089
       if (mFocusedPopup) {
         mFocusedPopup->OpenAutocompletePopup(this, mFocusedInput);
       }
     } else {