Backed out changeset 079ee7b41c3a (bug 1156160) for selection reftest failures
authorPhil Ringnalda <philringnalda@gmail.com>
Wed, 30 Nov 2016 21:34:42 -0800
changeset 324903 7d0ff0aae0a0b99a26ae1236817dabba93f53e49
parent 324902 0fc28aab9031aa803f8adbe69c059063195cd6c3
child 324904 5dc43b5e3673c0ffac1099fbd14a2b31f9263e10
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
bugs1156160
milestone53.0a1
backs out079ee7b41c3a5c33e1608c01ebaf17751f41d5f9
Backed out changeset 079ee7b41c3a (bug 1156160) for selection reftest failures CLOSED TREE
layout/base/AccessibleCaretEventHub.cpp
layout/base/AccessibleCaretEventHub.h
layout/base/AccessibleCaretManager.cpp
layout/base/AccessibleCaretManager.h
--- a/layout/base/AccessibleCaretEventHub.cpp
+++ b/layout/base/AccessibleCaretEventHub.cpp
@@ -27,18 +27,17 @@ namespace mozilla {
 #undef AC_LOG
 #define AC_LOG(message, ...)                                                   \
   AC_LOG_BASE("AccessibleCaretEventHub (%p): " message, this, ##__VA_ARGS__);
 
 #undef AC_LOGV
 #define AC_LOGV(message, ...)                                                  \
   AC_LOGV_BASE("AccessibleCaretEventHub (%p): " message, this, ##__VA_ARGS__);
 
-NS_IMPL_ISUPPORTS(AccessibleCaretEventHub,
-                  nsIDocumentActivity, nsIReflowObserver, nsIScrollObserver,
+NS_IMPL_ISUPPORTS(AccessibleCaretEventHub, nsIReflowObserver, nsIScrollObserver,
                   nsISelectionListener, nsISupportsWeakReference);
 
 // -----------------------------------------------------------------------------
 // NoActionState
 //
 class AccessibleCaretEventHub::NoActionState
   : public AccessibleCaretEventHub::State
 {
@@ -429,22 +428,16 @@ AccessibleCaretEventHub::Init()
     return;
   }
 
   docShell->AddWeakReflowObserver(this);
   docShell->AddWeakScrollObserver(this);
 
   mDocShell = static_cast<nsDocShell*>(docShell);
 
-  nsIDocument* doc = mPresShell->GetDocument();
-  if (doc) {
-    doc->RegisterActivityObserver(
-      NS_ISUPPORTS_CAST(nsIDocumentActivity*, this));
-  }
-
   if (sUseLongTapInjector) {
     mLongTapInjectorTimer = do_CreateInstance("@mozilla.org/timer;1");
   }
 
   mScrollEndInjectorTimer = do_CreateInstance("@mozilla.org/timer;1");
 
   mManager = MakeUnique<AccessibleCaretManager>(mPresShell);
 
@@ -459,22 +452,16 @@ AccessibleCaretEventHub::Terminate()
   }
 
   RefPtr<nsDocShell> docShell(mDocShell.get());
   if (docShell) {
     docShell->RemoveWeakReflowObserver(this);
     docShell->RemoveWeakScrollObserver(this);
   }
 
-  nsIDocument* doc = mPresShell->GetDocument();
-  if (doc) {
-    doc->UnregisterActivityObserver(
-      NS_ISUPPORTS_CAST(nsIDocumentActivity*, this));
-  }
-
   if (mLongTapInjectorTimer) {
     mLongTapInjectorTimer->Cancel();
   }
 
   if (mScrollEndInjectorTimer) {
     mScrollEndInjectorTimer->Cancel();
   }
 
@@ -710,35 +697,16 @@ NS_IMETHODIMP
 AccessibleCaretEventHub::ReflowInterruptible(DOMHighResTimeStamp aStart,
                                              DOMHighResTimeStamp aEnd)
 {
   // Defer the error checking to Reflow().
   return Reflow(aStart, aEnd);
 }
 
 void
-AccessibleCaretEventHub::NotifyOwnerDocumentActivityChanged()
-{
-  if (!mInitialized) {
-    return;
-  }
-
-  MOZ_ASSERT(mRefCnt.get() > 1, "Expect caller holds us as well!");
-
-  nsIDocument* doc = mPresShell->GetDocument();
-  if (!doc) {
-    return;
-  }
-
-  if (!doc->Hidden()) {
-    mManager->OnDocumentVisible();
-  }
-}
-
-void
 AccessibleCaretEventHub::AsyncPanZoomStarted()
 {
   if (!mInitialized) {
     return;
   }
 
   MOZ_ASSERT(mRefCnt.get() > 1, "Expect caller holds us as well!");
 
--- a/layout/base/AccessibleCaretEventHub.h
+++ b/layout/base/AccessibleCaretEventHub.h
@@ -6,17 +6,16 @@
 
 #ifndef AccessibleCaretEventHub_h
 #define AccessibleCaretEventHub_h
 
 #include "mozilla/EventForwards.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/WeakPtr.h"
 #include "nsCOMPtr.h"
-#include "nsIDocumentActivity.h"
 #include "nsIFrame.h"
 #include "nsIReflowObserver.h"
 #include "nsIScrollObserver.h"
 #include "nsISelectionListener.h"
 #include "nsPoint.h"
 #include "mozilla/RefPtr.h"
 #include "nsWeakReference.h"
 
@@ -56,35 +55,32 @@ class WidgetTouchEvent;
 // State transition diagram:
 // http://hg.mozilla.org/mozilla-central/raw-file/default/layout/base/doc/AccessibleCaretEventHubStates.png
 // Source code of the diagram:
 // http://hg.mozilla.org/mozilla-central/file/default/layout/base/doc/AccessibleCaretEventHubStates.dot
 //
 // Please see the wiki page for more information.
 // https://wiki.mozilla.org/AccessibleCaret
 //
-class AccessibleCaretEventHub
-  : public nsIDocumentActivity
-  , public nsIReflowObserver
-  , public nsIScrollObserver
-  , public nsISelectionListener
-  , public nsSupportsWeakReference
+class AccessibleCaretEventHub : public nsIReflowObserver,
+                                public nsIScrollObserver,
+                                public nsISelectionListener,
+                                public nsSupportsWeakReference
 {
 public:
   explicit AccessibleCaretEventHub(nsIPresShell* aPresShell);
   void Init();
   void Terminate();
 
   nsEventStatus HandleEvent(WidgetEvent* aEvent);
 
   // Call this function to notify the blur event happened.
   void NotifyBlur(bool aIsLeavingDocument);
 
   NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOCUMENTACTIVITY
   NS_DECL_NSIREFLOWOBSERVER
   NS_DECL_NSISELECTIONLISTENER
 
   // Override nsIScrollObserver methods.
   virtual void ScrollPositionChanged() override;
   virtual void AsyncPanZoomStarted() override;
   virtual void AsyncPanZoomStopped() override;
 
--- a/layout/base/AccessibleCaretManager.cpp
+++ b/layout/base/AccessibleCaretManager.cpp
@@ -747,23 +747,16 @@ AccessibleCaretManager::OnKeyboardEvent(
 void
 AccessibleCaretManager::OnFrameReconstruction()
 {
   mFirstCaret->EnsureApzAware();
   mSecondCaret->EnsureApzAware();
 }
 
 void
-AccessibleCaretManager::OnDocumentVisible()
-{
-  AC_LOG("%s: UpdateCarets()", __FUNCTION__);
-  UpdateCarets();
-}
-
-void
 AccessibleCaretManager::SetLastInputSource(uint16_t aInputSource)
 {
   mLastInputSource = aInputSource;
 }
 
 Selection*
 AccessibleCaretManager::GetSelection() const
 {
--- a/layout/base/AccessibleCaretManager.h
+++ b/layout/base/AccessibleCaretManager.h
@@ -98,20 +98,16 @@ public:
                                       int16_t aReason);
   // Handle key event.
   virtual void OnKeyboardEvent();
 
   // The canvas frame holding the accessible caret anonymous content elements
   // was reconstructed, resulting in the content elements getting cloned.
   virtual void OnFrameReconstruction();
 
-  // Called by AccessibleCaretEventHub to inform us that the document
-  // becomes visible.
-  virtual void OnDocumentVisible();
-
   // Update the manager with the last input source that was observed. This
   // is used in part to determine if the carets should be shown or hidden.
   void SetLastInputSource(uint16_t aInputSource);
 
 protected:
   // This enum representing the number of AccessibleCarets on the screen.
   enum class CaretMode : uint8_t {
     // No caret on the screen.