Bug 1251915 - Correct AccessibleCaretEventHub coding style by clang-format. r=roc
authorTing-Yu Lin <tlin@mozilla.com>
Mon, 29 Feb 2016 15:51:44 +0800
changeset 322439 51b5b9c96032fc9f8ea93ed010ce43b6b2442f76
parent 322438 b26f4f428a14f2375834297943a371c24af362a6
child 322440 50cb73a3297424c6caa60a128a11843af57becb6
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1251915
milestone47.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 1251915 - Correct AccessibleCaretEventHub coding style by clang-format. r=roc This patch is generatedy by applying clang-format on AccessibleCaretEventHub.cpp. MozReview-Commit-ID: 10qPJ47CVMH
layout/base/AccessibleCaretEventHub.cpp
--- a/layout/base/AccessibleCaretEventHub.cpp
+++ b/layout/base/AccessibleCaretEventHub.cpp
@@ -63,17 +63,18 @@ public:
   }
 
   virtual void OnScrollStart(AccessibleCaretEventHub* aContext) override
   {
     aContext->mManager->OnScrollStart();
     aContext->SetState(aContext->ScrollState());
   }
 
-  virtual void OnScrollPositionChanged(AccessibleCaretEventHub* aContext) override
+  virtual void OnScrollPositionChanged(
+    AccessibleCaretEventHub* aContext) override
   {
     aContext->mManager->OnScrollPositionChanged();
   }
 
   virtual void OnSelectionChanged(AccessibleCaretEventHub* aContext,
                                   nsIDOMDocument* aDoc, nsISelection* aSel,
                                   int16_t aReason) override
   {
@@ -382,18 +383,18 @@ MOZ_IMPL_STATE_CLASS_GETTER(LongTapState
 
 bool AccessibleCaretEventHub::sUseLongTapInjector = true;
 
 AccessibleCaretEventHub::AccessibleCaretEventHub(nsIPresShell* aPresShell)
   : mPresShell(aPresShell)
 {
   static bool prefsAdded = false;
   if (!prefsAdded) {
-    Preferences::AddBoolVarCache(&sUseLongTapInjector,
-                                 "layout.accessiblecaret.use_long_tap_injector");
+    Preferences::AddBoolVarCache(
+      &sUseLongTapInjector, "layout.accessiblecaret.use_long_tap_injector");
     prefsAdded = true;
   }
 }
 
 AccessibleCaretEventHub::~AccessibleCaretEventHub()
 {
 }
 
@@ -471,151 +472,149 @@ AccessibleCaretEventHub::HandleEvent(Wid
 
   if (!mInitialized) {
     return status;
   }
 
   MOZ_ASSERT(mRefCnt.get() > 1, "Expect caller holds us as well!");
 
   switch (aEvent->mClass) {
-  case eMouseEventClass:
-    status = HandleMouseEvent(aEvent->AsMouseEvent());
-    break;
+    case eMouseEventClass:
+      status = HandleMouseEvent(aEvent->AsMouseEvent());
+      break;
 
-  case eTouchEventClass:
-    status = HandleTouchEvent(aEvent->AsTouchEvent());
-    break;
+    case eTouchEventClass:
+      status = HandleTouchEvent(aEvent->AsTouchEvent());
+      break;
 
-  case eKeyboardEventClass:
-    status = HandleKeyboardEvent(aEvent->AsKeyboardEvent());
-    break;
+    case eKeyboardEventClass:
+      status = HandleKeyboardEvent(aEvent->AsKeyboardEvent());
+      break;
 
-  default:
-    break;
+    default:
+      break;
   }
 
   return status;
 }
 
 nsEventStatus
 AccessibleCaretEventHub::HandleMouseEvent(WidgetMouseEvent* aEvent)
 {
   nsEventStatus rv = nsEventStatus_eIgnore;
 
   if (aEvent->button != WidgetMouseEvent::eLeftButton) {
     return rv;
   }
 
-  int32_t id = (mActiveTouchId == kInvalidTouchId ?
-                kDefaultTouchId : mActiveTouchId);
+  int32_t id =
+    (mActiveTouchId == kInvalidTouchId ? kDefaultTouchId : mActiveTouchId);
   nsPoint point = GetMouseEventPosition(aEvent);
 
   switch (aEvent->mMessage) {
-  case eMouseDown:
-    AC_LOGV("Before eMouseDown, state: %s", mState->Name());
-    rv = mState->OnPress(this, point, id);
-    AC_LOGV("After eMouseDown, state: %s, consume: %d",
-            mState->Name(), rv);
-    break;
+    case eMouseDown:
+      AC_LOGV("Before eMouseDown, state: %s", mState->Name());
+      rv = mState->OnPress(this, point, id);
+      AC_LOGV("After eMouseDown, state: %s, consume: %d", mState->Name(), rv);
+      break;
 
-  case eMouseMove:
-    AC_LOGV("Before eMouseMove, state: %s", mState->Name());
-    rv = mState->OnMove(this, point);
-    AC_LOGV("After eMouseMove, state: %s, consume: %d", mState->Name(), rv);
-    break;
+    case eMouseMove:
+      AC_LOGV("Before eMouseMove, state: %s", mState->Name());
+      rv = mState->OnMove(this, point);
+      AC_LOGV("After eMouseMove, state: %s, consume: %d", mState->Name(), rv);
+      break;
 
-  case eMouseUp:
-    AC_LOGV("Before eMouseUp, state: %s", mState->Name());
-    rv = mState->OnRelease(this);
-    AC_LOGV("After eMouseUp, state: %s, consume: %d", mState->Name(),
-            rv);
-    break;
+    case eMouseUp:
+      AC_LOGV("Before eMouseUp, state: %s", mState->Name());
+      rv = mState->OnRelease(this);
+      AC_LOGV("After eMouseUp, state: %s, consume: %d", mState->Name(), rv);
+      break;
 
-  case eMouseLongTap:
-    AC_LOGV("Before eMouseLongTap, state: %s", mState->Name());
-    rv = mState->OnLongTap(this, point);
-    AC_LOGV("After eMouseLongTap, state: %s, consume: %d", mState->Name(),
-            rv);
-    break;
+    case eMouseLongTap:
+      AC_LOGV("Before eMouseLongTap, state: %s", mState->Name());
+      rv = mState->OnLongTap(this, point);
+      AC_LOGV("After eMouseLongTap, state: %s, consume: %d", mState->Name(),
+              rv);
+      break;
 
-  default:
-    break;
+    default:
+      break;
   }
 
   return rv;
 }
 
 nsEventStatus
 AccessibleCaretEventHub::HandleTouchEvent(WidgetTouchEvent* aEvent)
 {
   if (aEvent->touches.IsEmpty()) {
     AC_LOG("%s: Receive a touch event without any touch data!", __FUNCTION__);
     return nsEventStatus_eIgnore;
   }
 
   nsEventStatus rv = nsEventStatus_eIgnore;
 
-  int32_t id = (mActiveTouchId == kInvalidTouchId ?
-                aEvent->touches[0]->Identifier() : mActiveTouchId);
+  int32_t id =
+    (mActiveTouchId == kInvalidTouchId ? aEvent->touches[0]->Identifier()
+                                       : mActiveTouchId);
   nsPoint point = GetTouchEventPosition(aEvent, id);
 
   switch (aEvent->mMessage) {
-  case eTouchStart:
-    AC_LOGV("Before eTouchStart, state: %s", mState->Name());
-    rv = mState->OnPress(this, point, id);
-    AC_LOGV("After eTouchStart, state: %s, consume: %d", mState->Name(), rv);
-    break;
+    case eTouchStart:
+      AC_LOGV("Before eTouchStart, state: %s", mState->Name());
+      rv = mState->OnPress(this, point, id);
+      AC_LOGV("After eTouchStart, state: %s, consume: %d", mState->Name(), rv);
+      break;
 
-  case eTouchMove:
-    AC_LOGV("Before eTouchMove, state: %s", mState->Name());
-    rv = mState->OnMove(this, point);
-    AC_LOGV("After eTouchMove, state: %s, consume: %d", mState->Name(), rv);
-    break;
+    case eTouchMove:
+      AC_LOGV("Before eTouchMove, state: %s", mState->Name());
+      rv = mState->OnMove(this, point);
+      AC_LOGV("After eTouchMove, state: %s, consume: %d", mState->Name(), rv);
+      break;
 
-  case eTouchEnd:
-    AC_LOGV("Before eTouchEnd, state: %s", mState->Name());
-    rv = mState->OnRelease(this);
-    AC_LOGV("After eTouchEnd, state: %s, consume: %d", mState->Name(), rv);
-    break;
+    case eTouchEnd:
+      AC_LOGV("Before eTouchEnd, state: %s", mState->Name());
+      rv = mState->OnRelease(this);
+      AC_LOGV("After eTouchEnd, state: %s, consume: %d", mState->Name(), rv);
+      break;
 
-  case eTouchCancel:
-    AC_LOGV("Before eTouchCancel, state: %s", mState->Name());
-    rv = mState->OnRelease(this);
-    AC_LOGV("After eTouchCancel, state: %s, consume: %d", mState->Name(),
-            rv);
-    break;
+    case eTouchCancel:
+      AC_LOGV("Before eTouchCancel, state: %s", mState->Name());
+      rv = mState->OnRelease(this);
+      AC_LOGV("After eTouchCancel, state: %s, consume: %d", mState->Name(), rv);
+      break;
 
-  default:
-    break;
+    default:
+      break;
   }
 
   return rv;
 }
 
 nsEventStatus
 AccessibleCaretEventHub::HandleKeyboardEvent(WidgetKeyboardEvent* aEvent)
 {
   switch (aEvent->mMessage) {
-  case eKeyUp:
-    AC_LOGV("eKeyUp, state: %s", mState->Name());
-    mManager->OnKeyboardEvent();
-    break;
+    case eKeyUp:
+      AC_LOGV("eKeyUp, state: %s", mState->Name());
+      mManager->OnKeyboardEvent();
+      break;
 
-  case eKeyDown:
-    AC_LOGV("eKeyDown, state: %s", mState->Name());
-    mManager->OnKeyboardEvent();
-    break;
+    case eKeyDown:
+      AC_LOGV("eKeyDown, state: %s", mState->Name());
+      mManager->OnKeyboardEvent();
+      break;
 
-  case eKeyPress:
-    AC_LOGV("eKeyPress, state: %s", mState->Name());
-    mManager->OnKeyboardEvent();
-    break;
+    case eKeyPress:
+      AC_LOGV("eKeyPress, state: %s", mState->Name());
+      mManager->OnKeyboardEvent();
+      break;
 
-  default:
-    break;
+    default:
+      break;
   }
 
   return nsEventStatus_eIgnore;
 }
 
 bool
 AccessibleCaretEventHub::MoveDistanceIsLarge(const nsPoint& aPoint) const
 {