Bug 1490974 Part 2: Remove an assert that insists only editable elements can use independent selection. r=mikedeboer
authorBrad Werth <bwerth@mozilla.com>
Tue, 05 Mar 2019 20:19:15 +0000
changeset 520341 330d7fe2bf6b43a7b35759f15b303c3092281a74
parent 520340 cdafab7858451738ce6f5d6b6fb4c2ce937a443d
child 520342 81d7a246c2b0d47820c3e186a0c9832685be2f77
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer
bugs1490974
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 1490974 Part 2: Remove an assert that insists only editable elements can use independent selection. r=mikedeboer Depends on D10631 Differential Revision: https://phabricator.services.mozilla.com/D21428
toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
--- a/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
+++ b/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
@@ -581,24 +581,20 @@ nsresult nsTypeAheadFind::FindItNow(nsIP
           // Otherwise move focus/caret to editable element
           if (fm) {
             fm->SetFocus(mFoundEditable, 0);
           }
           break;
         }
 
         // If we reach here without setting mFoundEditable, then something
-        // besides editable elements can cause us to have an independent
-        // selection controller.  I don't know whether this is possible.
-        // Currently, we simply fall back to grabbing the document's selection
-        // controller in this case.  Perhaps we should reject this find match
-        // and search again.
-        NS_ASSERTION(mFoundEditable,
-                     "Independent selection controller on "
-                     "non-editable element!");
+        // besides editable elements gave us an independent selection
+        // controller. List controls with multiple visible elements can do
+        // this (nsAreaSelectsFrame), and possibly others. We fall back to
+        // grabbing the document's selection controller in this case.
       }
 
       if (!mFoundEditable) {
         // Not using a separate selection controller, so just get the
         // document's controller and selection.
         GetSelection(presShell, getter_AddRefs(selectionController),
                      getter_AddRefs(selection));
       }