Bug 1596768 - Remove GetBindingParent() in HTMLFormControlAccessible. r=surkov
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sat, 16 Nov 2019 10:15:26 +0000
changeset 502317 74841f58fb9f9d8b667b3c246e8405e6d4765adb
parent 502316 1603f5abc56e6c2483e46ce577f6450e4c58733b
child 502318 dd4a4052989c04446a8fdd9bed66ab8937150d57
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs1596768
milestone72.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 1596768 - Remove GetBindingParent() in HTMLFormControlAccessible. r=surkov This code doesn't want to deal with Shadow DOM but with <input type=number> and such native-anonymous inputs. So do that explicitly. Differential Revision: https://phabricator.services.mozilla.com/D53204
accessible/html/HTMLFormControlAccessible.h
--- a/accessible/html/HTMLFormControlAccessible.h
+++ b/accessible/html/HTMLFormControlAccessible.h
@@ -95,25 +95,25 @@ class HTMLTextFieldAccessible final : pu
   virtual ~HTMLTextFieldAccessible() {}
 
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) const override;
 
   /**
    * Return a widget element this input is part of, for example, search-textbox
    * or HTML:input@type="number".
+   *
+   * FIXME: This should probably be renamed.
    */
   nsIContent* BindingOrWidgetParent() const {
-    nsIContent* el = mContent->GetBindingParent();
-    if (el) {
+    if (auto* el = mContent->GetClosestNativeAnonymousSubtreeRootParent()) {
       return el;
     }
     // XUL search-textbox custom element
-    ErrorResult rv;
-    return Elm()->Closest(NS_LITERAL_STRING("search-textbox"), rv);
+    return Elm()->Closest(NS_LITERAL_STRING("search-textbox"), IgnoreErrors());
   }
 };
 
 /**
  * Accessible for input@type="file" element.
  */
 class HTMLFileInputAccessible : public HyperTextAccessibleWrap {
  public: