Bug 1046573 - Add an observer notification for newly created selection objects; r=ehsan
☠☠ backed out by 7efc5743fc2b ☠ ☠
authorkernp25@yahoo.com
Tue, 05 Aug 2014 13:44:26 -0400
changeset 198017 80d85e3fdf41554337e55b673d8032902369c8ca
parent 198016 761e5154c14ce13e35b2f725e7ea1e501b446a84
child 198018 cf5d28075da421778ecbe40e2b40111e7b6894dc
push id1036
push userrnewman@mozilla.com
push dateWed, 06 Aug 2014 02:14:58 +0000
treeherderservices-central@3fd543e150c8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1046573
milestone34.0a1
Bug 1046573 - Add an observer notification for newly created selection objects; r=ehsan
layout/generic/nsSelection.cpp
--- a/layout/generic/nsSelection.cpp
+++ b/layout/generic/nsSelection.cpp
@@ -357,16 +357,22 @@ nsFrameSelection::nsFrameSelection()
   mSelectionChangeReason = nsISelectionListener::NO_REASON;
 
   mDelayedMouseEventValid = false;
   // These values are not used since they are only valid when
   // mDelayedMouseEventValid is true, and setting mDelayedMouseEventValid
   //alwaysoverrides these values.
   mDelayedMouseEventIsShift = false;
   mDelayedMouseEventClickCount = 0;
+
+  nsCOMPtr<nsIObserverService> observerService =
+    mozilla::services::GetObserverService();
+  if (observerService) {
+    observerService->NotifyObservers(this, "selection-object-created", nullptr);
+  }
 }
 
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsFrameSelection)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsFrameSelection)
   int32_t i;
   for (i = 0; i < nsISelectionController::NUM_SELECTIONTYPES; ++i) {