Bug 943047 - Undo addressing of bogus review comment.
authorJonathan Watt <jwatt@jwatt.org>
Sun, 01 Dec 2013 14:43:26 +0000
changeset 172821 736f56fc70ba7971299401930204e562d2ad0449
parent 172820 3e9d8536f7a8da711dbb7e8879e52abaab191746
child 172822 44f0d31a45309483c017c8a178553975d95030a7
push id3224
push userlsblakk@mozilla.com
push dateTue, 04 Feb 2014 01:06:49 +0000
treeherdermozilla-beta@60c04d0987f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs943047
milestone28.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 943047 - Undo addressing of bogus review comment.
content/html/content/src/HTMLInputElement.cpp
--- a/content/html/content/src/HTMLInputElement.cpp
+++ b/content/html/content/src/HTMLInputElement.cpp
@@ -3290,25 +3290,16 @@ HTMLInputElement::PreHandleEvent(nsEvent
 
   if (mType == NS_FORM_INPUT_RANGE &&
       (aVisitor.mEvent->message == NS_FOCUS_CONTENT ||
        aVisitor.mEvent->message == NS_BLUR_CONTENT)) {
     // Just as nsGenericHTMLFormElementWithState::PreHandleEvent calls
     // nsIFormControlFrame::SetFocus, we handle focus here.
     nsIFrame* frame = GetPrimaryFrame();
     if (frame) {
-      if (aVisitor.mEvent->message == NS_FOCUS_CONTENT) {
-        // Tell our frame it's getting focus so that it can make sure focus
-        // is moved to our anonymous text control.
-        nsNumberControlFrame* numberControlFrame =
-          do_QueryFrame(GetPrimaryFrame());
-        if (numberControlFrame) {
-          numberControlFrame->HandleFocusEvent(aVisitor.mEvent);
-        }
-      }
       frame->InvalidateFrameSubtree();
     }
   }
 
   if (mType == NS_FORM_INPUT_NUMBER &&
       aVisitor.mEvent->mFlags.mIsTrusted) {
     if (mNumberControlSpinnerIsSpinning) {
       // If the timer is running the user has depressed the mouse on one of the
@@ -3337,16 +3328,31 @@ HTMLInputElement::PreHandleEvent(nsEvent
         }
         if (stopSpin) {
           StopNumberControlSpinnerSpin();
         }
       } else if (aVisitor.mEvent->message == NS_MOUSE_BUTTON_UP) {
         StopNumberControlSpinnerSpin();
       }
     }
+    if (aVisitor.mEvent->message == NS_FOCUS_CONTENT ||
+        aVisitor.mEvent->message == NS_BLUR_CONTENT) {
+      nsIFrame* frame = GetPrimaryFrame();
+      if (frame) {
+        if (aVisitor.mEvent->message == NS_FOCUS_CONTENT) {
+          // Tell our frame it's getting focus so that it can make sure focus
+          // is moved to our anonymous text control.
+          nsNumberControlFrame* numberControlFrame =
+            do_QueryFrame(GetPrimaryFrame());
+          if (numberControlFrame) {
+            numberControlFrame->HandleFocusEvent(aVisitor.mEvent);
+          }
+        }
+      }
+    }
   }
 
   nsresult rv = nsGenericHTMLFormElementWithState::PreHandleEvent(aVisitor);
 
   // We do this after calling the base class' PreHandleEvent so that
   // nsIContent::PreHandleEvent doesn't reset any change we make to mCanHandle.
   if (mType == NS_FORM_INPUT_NUMBER &&
       aVisitor.mEvent->mFlags.mIsTrusted  &&