Bug 1016184 part 3a - Fix typos and minor style changes. r=ehsan
☠☠ backed out by 1f216e2e339e ☠ ☠
authorTing-Yu Lin <tlin@mozilla.com>
Sun, 27 Jul 2014 00:13:00 +0200
changeset 196985 0d03cd217c644fe787b3e79551687057b22994c4
parent 196984 8a6391cb51808934c043270373272da039bdd965
child 196986 d0513eae0c979b3ee51e6d1ceac80559cc90dc28
push id47020
push usercbook@mozilla.com
push dateThu, 31 Jul 2014 06:41:00 +0000
treeherdermozilla-inbound@0893f2ef4b9a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1016184
milestone34.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 1016184 part 3a - Fix typos and minor style changes. r=ehsan Also group the private section together, and remove the protect section since TouchCaret is a MOZ_FINAL class.
layout/base/TouchCaret.cpp
layout/base/TouchCaret.h
--- a/layout/base/TouchCaret.cpp
+++ b/layout/base/TouchCaret.cpp
@@ -120,17 +120,17 @@ TouchCaret::SetVisibility(bool aVisible)
   touchCaretElement->ClassList()->Toggle(NS_LITERAL_STRING("hidden"),
                                          dom::Optional<bool>(!mVisible),
                                          err);
   TOUCHCARET_LOG("Visibility %s", (mVisible ? "shown" : "hidden"));
 
   // Set touch caret expiration time.
   mVisible ? LaunchExpirationTimer() : CancelExpirationTimer();
 
-  // We must call SetHasTouchCaret() in order to get APZC to wait until the
+  // We must call SetMayHaveTouchCaret() in order to get APZC to wait until the
   // event has been round-tripped and check whether it has been handled,
   // otherwise B2G will end up panning the document when the user tries to drag
   // touch caret.
   presShell->SetMayHaveTouchCaret(mVisible);
 }
 
 nsRect
 TouchCaret::GetTouchFrameRect()
@@ -324,17 +324,17 @@ TouchCaret::IsOnTouchCaret(const nsPoint
     int32_t dy = Abs(aPoint.y - posY);
     distance = dx + dy;
   }
   return (distance <= TouchCaretMaxDistance());
 }
 
 nsresult
 TouchCaret::NotifySelectionChanged(nsIDOMDocument* aDoc, nsISelection* aSel,
-                                     int16_t aReason)
+                                   int16_t aReason)
 {
   // Hide touch caret while no caret exists.
   nsCOMPtr<nsIPresShell> presShell = do_QueryReferent(mPresShell);
   if (!presShell) {
     return NS_OK;
   }
 
   nsRefPtr<nsCaret> caret = presShell->GetCaret();
--- a/layout/base/TouchCaret.h
+++ b/layout/base/TouchCaret.h
@@ -14,26 +14,23 @@
 #include "nsITimer.h"
 #include "mozilla/EventForwards.h"
 #include "mozilla/TouchEvents.h"
 #include "Units.h"
 
 namespace mozilla {
 
 /**
- * The TouchCaret places a touch caret according to caret postion when the
+ * The TouchCaret places a touch caret according to caret position when the
  * caret is shown.
  * TouchCaret is also responsible for touch caret visibility. Touch caret
  * won't be shown when timer expires or while key event causes selection change.
  */
 class TouchCaret MOZ_FINAL : public nsISelectionListener
 {
-private:
-  ~TouchCaret();
-
 public:
   explicit TouchCaret(nsIPresShell* aPresShell);
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSISELECTIONLISTENER
 
   void Terminate()
   {
@@ -68,16 +65,18 @@ public:
   {
     return mVisible;
   }
 
 private:
   // Hide default constructor.
   TouchCaret() MOZ_DELETE;
 
+  ~TouchCaret();
+
   /**
    * Find the nsCanvasFrame which holds the touch caret.
    */
   nsIFrame* GetCanvasFrame();
 
   /**
    * Retrieve the bounding rectangle of the touch caret.
    *
@@ -221,17 +220,16 @@ private:
     return sTouchCaretMaxDistance;
   }
 
   static int32_t TouchCaretExpirationTime()
   {
     return sTouchCaretExpirationTime;
   }
 
-protected:
   nsWeakPtr mPresShell;
 
   // Touch caret visibility
   bool mVisible;
   // Touch caret timer
   nsCOMPtr<nsITimer> mTouchCaretExpirationTimer;
 
   // Preference