Bug 1265551 - Autocomplete popup lags behind pan/zoom position r=kats
authorRandall Barker <rbarker@mozilla.com>
Mon, 18 Apr 2016 17:08:47 -0700
changeset 317686 61fbe83d308379611bef742a9c607a4583187f48
parent 317685 a1a6a81a37b7a226edbfe2f8b70b44395a14c2e1
child 317687 75c314efec3ed7459e97afba357f8066a4137b93
push id9480
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 17:12:58 +0000
treeherdermozilla-aurora@0d6a91c76a9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1265551
milestone48.0a1
Bug 1265551 - Autocomplete popup lags behind pan/zoom position r=kats
widget/android/AndroidContentController.cpp
--- a/widget/android/AndroidContentController.cpp
+++ b/widget/android/AndroidContentController.cpp
@@ -120,18 +120,23 @@ AndroidContentController::NotifyAPZState
                                                APZStateChange aChange,
                                                int aArg)
 {
   // This function may get invoked twice, if the first invocation is not on
   // the main thread then the ChromeProcessController version of this function
   // will redispatch to the main thread. We want to make sure that our handling
   // only happens on the main thread.
   ChromeProcessController::NotifyAPZStateChange(aGuid, aChange, aArg);
-  if (NS_IsMainThread() && aChange == layers::GeckoContentController::APZStateChange::TransformEnd) {
-    // This is used by tests to determine when the APZ is done doing whatever
-    // it's doing. XXX generify this as needed when writing additional tests.
+  if (NS_IsMainThread()) {
     nsCOMPtr<nsIObserverService> observerService = mozilla::services::GetObserverService();
-    observerService->NotifyObservers(nullptr, "APZ:TransformEnd", nullptr);
+    if (aChange == layers::GeckoContentController::APZStateChange::TransformEnd) {
+      // This is used by tests to determine when the APZ is done doing whatever
+      // it's doing. XXX generify this as needed when writing additional tests.
+      observerService->NotifyObservers(nullptr, "APZ:TransformEnd", nullptr);
+      observerService->NotifyObservers(nullptr, "PanZoom:StateChange", MOZ_UTF16("NOTHING"));
+    } else if (aChange == layers::GeckoContentController::APZStateChange::TransformBegin) {
+      observerService->NotifyObservers(nullptr, "PanZoom:StateChange", MOZ_UTF16("PANNING"));
+    }
   }
 }
 
 } // namespace widget
 } // namespace mozilla