Bug 1534158 - Drop InspectorUtils.scrollElementIntoView. r=emilio
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Mon, 11 Mar 2019 19:23:29 +0000
changeset 521437 aa539ea8ce27
parent 521436 de512e13803b
child 521438 3e745bcded68
push id10866
push usernerli@mozilla.com
push dateTue, 12 Mar 2019 18:59:09 +0000
treeherdermozilla-beta@445c24a51727 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1534158, 1018324
milestone67.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 1534158 - Drop InspectorUtils.scrollElementIntoView. r=emilio This was introduced in bug 1018324 for the DOM Inspector addon but we no longer support those kinds of addons. Differential Revision: https://phabricator.services.mozilla.com/D22872
dom/chrome-webidl/InspectorUtils.webidl
layout/inspector/InspectorUtils.cpp
layout/inspector/InspectorUtils.h
--- a/dom/chrome-webidl/InspectorUtils.webidl
+++ b/dom/chrome-webidl/InspectorUtils.webidl
@@ -71,17 +71,16 @@ namespace InspectorUtils {
   sequence<DOMString> getCSSPseudoElementNames();
   void addPseudoClassLock(Element element,
                           DOMString pseudoClass,
                           optional boolean enabled = true);
   void removePseudoClassLock(Element element, DOMString pseudoClass);
   boolean hasPseudoClassLock(Element element, DOMString pseudoClass);
   void clearPseudoClassLocks(Element element);
   [Throws] void parseStyleSheet(CSSStyleSheet sheet, DOMString input);
-  void scrollElementIntoView(Element element);
   boolean isCustomElementName([TreatNullAs=EmptyString] DOMString name,
                               DOMString? namespaceURI);
 };
 
 dictionary PropertyNamesOptions {
   boolean includeAliases = false;
   boolean includeShorthands = true;
   boolean includeExperimentals = false;
--- a/layout/inspector/InspectorUtils.cpp
+++ b/layout/inspector/InspectorUtils.cpp
@@ -678,28 +678,16 @@ void InspectorUtils::ClearPseudoClassLoc
 /* static */
 void InspectorUtils::ParseStyleSheet(GlobalObject& aGlobalObject,
                                      StyleSheet& aSheet,
                                      const nsAString& aInput,
                                      ErrorResult& aRv) {
   aRv = aSheet.ReparseSheet(aInput);
 }
 
-void InspectorUtils::ScrollElementIntoView(GlobalObject& aGlobalObject,
-                                           Element& aElement) {
-  nsIPresShell* presShell = aElement.OwnerDoc()->GetShell();
-  if (!presShell) {
-    return;
-  }
-
-  presShell->ScrollContentIntoView(&aElement, nsIPresShell::ScrollAxis(),
-                                   nsIPresShell::ScrollAxis(),
-                                   nsIPresShell::SCROLL_OVERFLOW_HIDDEN);
-}
-
 bool InspectorUtils::IsCustomElementName(GlobalObject&, const nsAString& aName,
                                          const nsAString& aNamespaceURI) {
   if (aName.IsEmpty()) {
     return false;
   }
 
   int32_t namespaceID;
   nsContentUtils::NameSpaceManager()->RegisterNameSpace(aNamespaceURI,
--- a/layout/inspector/InspectorUtils.h
+++ b/layout/inspector/InspectorUtils.h
@@ -234,22 +234,16 @@ class InspectorUtils {
    * @param DOMCSSStyleSheet aSheet
    * @param DOMString aInput
    *        The new source string for the style sheet.
    */
   static void ParseStyleSheet(GlobalObject& aGlobal, StyleSheet& aSheet,
                               const nsAString& aInput, ErrorResult& aRv);
 
   /**
-   * Scroll an element completely into view, if possible.
-   * This is similar to ensureElementIsVisible but for all ancestors.
-   */
-  static void ScrollElementIntoView(GlobalObject& aGlobal, Element& aElement);
-
-  /**
    * Check if the provided name can be custom element name.
    */
   static bool IsCustomElementName(GlobalObject&, const nsAString& aName,
                                   const nsAString& aNamespaceURI);
 
  private:
   static already_AddRefed<ComputedStyle> GetCleanComputedStyleForElement(
       Element* aElement, nsAtom* aPseudo);