Bug 1342867 - Label the runnable of ScrollOnFocusEvent. r=dholbert draft
authorKuoE0 <kuoe0.tw@gmail.com>
Wed, 08 Mar 2017 15:51:40 +0800
changeset 551297 ce8a20f8c2b81a00145acbf419ffaee20b065fe2
parent 502579 8744e9f8eb99f1290aae81985812d57364f18708
child 621508 fa5a03a2ad381ee5dcf3883fb695bf36e7561e5c
push id51014
push userbmo:kuoe0@mozilla.com
push dateSat, 25 Mar 2017 13:18:14 +0000
reviewersdholbert
bugs1342867
milestone55.0a1
Bug 1342867 - Label the runnable of ScrollOnFocusEvent. r=dholbert MozReview-Commit-ID: Dwk7F0gQBiz
layout/forms/nsTextControlFrame.cpp
--- a/layout/forms/nsTextControlFrame.cpp
+++ b/layout/forms/nsTextControlFrame.cpp
@@ -670,17 +670,19 @@ void nsTextControlFrame::SetFocus(bool a
     if (doc) {
       nsIFocusManager* fm = nsFocusManager::GetFocusManager();
       if (fm) {
         fm->GetLastFocusMethod(doc->GetWindow(), &lastFocusMethod);
       }
     }
     if (!(lastFocusMethod & nsIFocusManager::FLAG_BYMOUSE)) {
       RefPtr<ScrollOnFocusEvent> event = new ScrollOnFocusEvent(this);
-      nsresult rv = NS_DispatchToCurrentThread(event);
+      nsresult rv = mContent->OwnerDoc()->Dispatch("ScrollOnFocusEvent",
+                                                   TaskCategory::Other,
+                                                   do_AddRef(event));
       if (NS_SUCCEEDED(rv)) {
         mScrollEvent = event;
       }
     }
   }
 
   // tell the caret to use our selection
   caret->SetSelection(ourSel);