Bug 1396323 - Don't initialize HTMLInputElement editor for eVoidEvent. r?ehsan draft
authorRyan Hunt <rhunt@eqrion.net>
Tue, 05 Sep 2017 15:09:53 -0500
changeset 659285 f17ae0cef5e3bcb16f792849c0031327d475cf4e
parent 659065 3ecda4678c49ca255c38b1697142b9118cdd27e7
child 729948 47158c7cbd58d58581dd5b880ca78c2b7c87b2b4
push id78086
push userbmo:rhunt@eqrion.net
push dateTue, 05 Sep 2017 20:27:57 +0000
reviewersehsan
bugs1396323
milestone57.0a1
Bug 1396323 - Don't initialize HTMLInputElement editor for eVoidEvent. r?ehsan Keyboard APZ dispatches an eVoidEvent to gather all event targets that a key event would normally go to. This can sometimes trigger an HTMLInputElement to initialize its editor, which can cause unnecessary DOM modifications. MozReview-Commit-ID: 6EEttouVB81
dom/html/HTMLInputElement.cpp
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -3574,16 +3574,17 @@ HTMLInputElement::NeedToInitializeEditor
   // handled without the editor being initialized.  These events include:
   // mousein/move/out, overflow/underflow, and DOM mutation events.
   if (!IsSingleLineTextControl(false) ||
       aVisitor.mEvent->mClass == eMutationEventClass) {
     return false;
   }
 
   switch (aVisitor.mEvent->mMessage) {
+  case eVoidEvent:
   case eMouseMove:
   case eMouseEnterIntoWidget:
   case eMouseExitFromWidget:
   case eMouseOver:
   case eMouseOut:
   case eScrollPortUnderflow:
   case eScrollPortOverflow:
     return false;