Backed out changeset ca51748d62b2 (bug 1155493)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Thu, 21 May 2015 16:20:58 +0200
changeset 244961 34b904a81f69886fc38a502b148ac1cde16e2a17
parent 244960 fa7575b66cc5ff06fbb492fa5becbd16fe67d6fb
child 244962 e550da3fc7a6987076c504e198e7561596b6c787
push id60068
push usercbook@mozilla.com
push dateThu, 21 May 2015 14:24:11 +0000
treeherdermozilla-inbound@0c323ae5636a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1155493
milestone41.0a1
backs outca51748d62b232c8312ff9d8decaf1a16aebf0a2
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
Backed out changeset ca51748d62b2 (bug 1155493)
layout/base/AccessibleCaretManager.cpp
--- a/layout/base/AccessibleCaretManager.cpp
+++ b/layout/base/AccessibleCaretManager.cpp
@@ -85,17 +85,16 @@ AccessibleCaretManager::OnSelectionChang
 
 void
 AccessibleCaretManager::HideCarets()
 {
   if (mFirstCaret->IsLogicallyVisible() || mSecondCaret->IsLogicallyVisible()) {
     AC_LOG("%s", __FUNCTION__);
     mFirstCaret->SetAppearance(Appearance::None);
     mSecondCaret->SetAppearance(Appearance::None);
-    DispatchCaretStateChangedEvent(CaretChangedReason::Visibilitychange);
     CancelCaretTimeoutTimer();
   }
 }
 
 void
 AccessibleCaretManager::UpdateCarets()
 {
   mCaretMode = GetCaretMode();
@@ -150,32 +149,26 @@ AccessibleCaretManager::UpdateCaretsForC
   if (!editingHost) {
     HideCarets();
     return;
   }
 
   // No need to consider whether the caret's position is out of scrollport.
   // According to the spec, we need to explicitly hide it after the scrolling is
   // ended.
-  bool oldSecondCaretVisible = mSecondCaret->IsLogicallyVisible();
-  PositionChangedResult caretResult = mFirstCaret->SetPosition(frame, offset);
+  mFirstCaret->SetPosition(frame, offset);
   mFirstCaret->SetSelectionBarEnabled(false);
   if (nsContentUtils::HasNonEmptyTextContent(
         editingHost, nsContentUtils::eRecurseIntoChildren)) {
     mFirstCaret->SetAppearance(Appearance::Normal);
     LaunchCaretTimeoutTimer();
   } else {
     mFirstCaret->SetAppearance(Appearance::NormalNotShown);
   }
   mSecondCaret->SetAppearance(Appearance::None);
-
-  if ((caretResult == PositionChangedResult::Changed ||
-      oldSecondCaretVisible) && !mActiveCaret) {
-    DispatchCaretStateChangedEvent(CaretChangedReason::Updateposition);
-  }
 }
 
 void
 AccessibleCaretManager::UpdateCaretsForSelectionMode()
 {
   AC_LOG("%s, selection: %p", __FUNCTION__, GetSelection());
 
   int32_t startOffset = 0;
@@ -216,24 +209,16 @@ AccessibleCaretManager::UpdateCaretsForS
 
   if (firstCaretResult == PositionChangedResult::Changed ||
       secondCaretResult == PositionChangedResult::Changed) {
     // Flush layout to make the carets intersection correct.
     mPresShell->FlushPendingNotifications(Flush_Layout);
   }
 
   UpdateCaretsForTilt();
-
-  if ((firstCaretResult == PositionChangedResult::Changed ||
-       secondCaretResult == PositionChangedResult::Changed ||
-       firstCaretResult == PositionChangedResult::Invisible ||
-       secondCaretResult == PositionChangedResult::Invisible) &&
-      !mActiveCaret) {
-    DispatchCaretStateChangedEvent(CaretChangedReason::Updateposition);
-  }
 }
 
 void
 AccessibleCaretManager::UpdateCaretsForTilt()
 {
   if (mFirstCaret->IsVisuallyVisible() && mSecondCaret->IsVisuallyVisible()) {
     if (mFirstCaret->Intersects(*mSecondCaret)) {
       if (mFirstCaret->LogicalPosition().x <=
@@ -263,17 +248,16 @@ AccessibleCaretManager::PressCaret(const
     mActiveCaret = mSecondCaret.get();
     SetSelectionDirection(eDirNext);
   }
 
   if (mActiveCaret) {
     mOffsetYToCaretLogicalPosition =
       mActiveCaret->LogicalPosition().y - aPoint.y;
     SetSelectionDragState(true);
-    DispatchCaretStateChangedEvent(CaretChangedReason::Presscaret);
     CancelCaretTimeoutTimer();
     rv = NS_OK;
   }
 
   return rv;
 }
 
 nsresult
@@ -290,30 +274,28 @@ AccessibleCaretManager::DragCaret(const 
 
 nsresult
 AccessibleCaretManager::ReleaseCaret()
 {
   MOZ_ASSERT(mActiveCaret);
 
   mActiveCaret = nullptr;
   SetSelectionDragState(false);
-  DispatchCaretStateChangedEvent(CaretChangedReason::Releasecaret);
   LaunchCaretTimeoutTimer();
   return NS_OK;
 }
 
 nsresult
 AccessibleCaretManager::TapCaret(const nsPoint& aPoint)
 {
   MOZ_ASSERT(GetCaretMode() != CaretMode::None);
 
   nsresult rv = NS_ERROR_FAILURE;
 
   if (GetCaretMode() == CaretMode::Cursor) {
-    DispatchCaretStateChangedEvent(CaretChangedReason::Taponcaret);
     rv = NS_OK;
   }
 
   return rv;
 }
 
 nsresult
 AccessibleCaretManager::SelectWordOrShortcut(const nsPoint& aPoint)
@@ -344,17 +326,16 @@ AccessibleCaretManager::SelectWordOrShor
   nsLayoutUtils::TransformPoint(rootFrame, ptFrame, ptInFrame);
 
   nsIContent* editingHost = ptFrame->GetContent()->GetEditingHost();
   if (ChangeFocus(ptFrame) &&
       (editingHost && !nsContentUtils::HasNonEmptyTextContent(
                          editingHost, nsContentUtils::eRecurseIntoChildren))) {
     // Content is empty. No need to select word.
     AC_LOG("%s, Cannot select word bacause content is empty", __FUNCTION__);
-    DispatchCaretStateChangedEvent(CaretChangedReason::Longpressonemptycontent);
     return NS_OK;
   }
 
   nsresult rv = SelectWord(ptFrame, ptInFrame);
   UpdateCarets();
   return rv;
 }