Bug 1545359: indicate 'focusedElement' in nsIFocusManager.idl can be an anonymous descendant of the element which was focused r=NeilDeakin
authorMirko Brodesser <mbrodesser@mozilla.com>
Mon, 29 Apr 2019 13:30:35 +0000
changeset 530559 dde986f8138db1c196ddaa173271239a3de0c925
parent 530558 4802b506ce335a362e535ce0baf5bbbbdf69bae0
child 530560 3fa81f747c9399c04c3c9b7bd76acedcfe3c21dd
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeilDeakin
bugs1545359
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 1545359: indicate 'focusedElement' in nsIFocusManager.idl can be an anonymous descendant of the element which was focused r=NeilDeakin Differential Revision: https://phabricator.services.mozilla.com/D28029
dom/interfaces/base/nsIFocusManager.idl
--- a/dom/interfaces/base/nsIFocusManager.idl
+++ b/dom/interfaces/base/nsIFocusManager.idl
@@ -75,17 +75,19 @@ interface nsIFocusManager : nsISupports
    * the current focusedWindow will be used by default. This has the result
    * of retrieving the method that was used to focus the currently focused
    * element.
    */
   uint32_t getLastFocusMethod(in mozIDOMWindowProxy window);
 
   /**
    * Changes the focused element reference within the window containing
-   * aElement to aElement.
+   * aElement to aElement or potentially redirects it to an anonymous
+   * descendant of it (e.g., for `<input type="number">` the focus is redirected
+   * to its descendant `<input type="text">`).
    */
   void setFocus(in Element aElement, in unsigned long aFlags);
 
   /**
    * Move the focus to another element. If aStartElement is specified, then
    * movement is done relative to aStartElement. If aStartElement is null,
    * then movement is done relative to the currently focused element. If no
    * element is focused, focus the first focusable element within the
@@ -94,18 +96,18 @@ interface nsIFocusManager : nsISupports
    *
    * Specifying aStartElement and using MOVEFOCUS_LAST is not currently
    * implemented.
    *
    * If no element is found, and aType is either MOVEFOCUS_ROOT or
    * MOVEFOCUS_CARET, then the focus is cleared. If aType is any other value,
    * the focus is not changed.
    *
-   * Returns the element that was focused. The return value may be null if focus
-   * was moved into a child process.
+   * Returns the element that was focused (see setFocus). The return value
+   * may be null if focus was moved into a child process.
    */
   Element moveFocus(in mozIDOMWindowProxy aWindow,
                     in Element aStartElement,
                     in unsigned long aType, in unsigned long aFlags);
 
   /**
    * Clears the focused element within aWindow. If the current focusedWindow
    * is a descendant of aWindow, sets the current focusedWindow to aWindow.
@@ -136,17 +138,18 @@ interface nsIFocusManager : nsISupports
                                      out mozIDOMWindowProxy aFocusedWindow);
 
   /**
    * Moves the selection caret within aWindow to the current focus.
    */
   void moveCaretToFocus(in mozIDOMWindowProxy aWindow);
 
   /***
-   * Check if given element is focusable.
+   * Check if given element (or potentially a descendant, see setFocus) is
+   * focusable.
    */
   boolean elementIsFocusable(in Element aElement, in unsigned long aFlags);
 
   /*
    * Raise the window when switching focus
    */
   const unsigned long FLAG_RAISE = 1;