Bug 1251915 - Correct AccessibleCaretEventHub coding style by clang-format. r?roc draft
authorTing-Yu Lin <tlin@mozilla.com>
Mon, 29 Feb 2016 15:51:44 +0800
changeset 335351 b3f1092042ba9e9183359bc196ce05772169b29c
parent 335350 79201c70dbdddceb5c3f259212b1f082331e7cd5
child 335352 e7a49790c26342eefbc8c4cf83170c8ef293e5fd
push id11765
push usertlin@mozilla.com
push dateMon, 29 Feb 2016 07:52:33 +0000
reviewersroc
bugs1251915
milestone47.0a1
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
 {