Backed out changeset a372a90a9475 (bug 1119126) for gaia-js-integration-8 failures
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Mon, 09 Feb 2015 15:33:24 +0100
changeset 241779 c13e7799a147a1ebdb8745e1bc58b7581b49fdca
parent 241778 1bd47ee5fde94ce09bc978436fa5250c2c9a7952
child 241780 44078171052141c0998b64d2f83faf34da75cb1a
push id619
push usercliu@mozilla.com
push dateMon, 09 Feb 2015 21:57:21 +0000
bugs1119126
milestone38.0a1
backs outa372a90a9475a79235e73934e2353ca4c8c284ec
Backed out changeset a372a90a9475 (bug 1119126) for gaia-js-integration-8 failures
dom/browser-element/BrowserElementChildPreload.js
layout/base/SelectionCarets.cpp
--- a/dom/browser-element/BrowserElementChildPreload.js
+++ b/dom/browser-element/BrowserElementChildPreload.js
@@ -633,18 +633,16 @@ BrowserElementChild.prototype = {
 
     // If we select something and selection range is visible, we cache current
     // event's target to selectionStateChangedTarget.
     // And dispatch the next SelectionStateChagne event if target is matched, so
     // that the parent side can hide the text dialog.
     // We clear selectionStateChangedTarget if selection carets are invisible.
     if (e.visible && !isCollapsed) {
       this._selectionStateChangedTarget = e.target;
-    } else if (canPaste && isCollapsed) {
-      this._selectionStateChangedTarget = e.target;
     } else {
       this._selectionStateChangedTarget = null;
     }
 
     let zoomFactor = content.screen.width / content.innerWidth;
 
     let detail = {
       rect: {
@@ -1141,17 +1139,16 @@ BrowserElementChild.prototype = {
   },
 
   _recvZoom: function(data) {
     docShell.contentViewer.fullZoom = data.json.zoom;
   },
 
   _recvDoCommand: function(data) {
     if (this._isCommandEnabled(data.json.command)) {
-      this._selectionStateChangedTarget = null;
       docShell.doCommand(COMMAND_MAP[data.json.command]);
     }
   },
 
   _recvSetInputMethodActive: function(data) {
     let msgData = { id: data.json.id };
     if (!this._isContentWindowCreated) {
       if (data.json.args.isActive) {
--- a/layout/base/SelectionCarets.cpp
+++ b/layout/base/SelectionCarets.cpp
@@ -1215,22 +1215,16 @@ SelectionCarets::ScrollPositionChanged()
       LaunchScrollEndDetector();
     } else {
       if (!mInAsyncPanZoomGesture) {
         UpdateSelectionCarets();
         DispatchSelectionStateChangedEvent(GetSelection(),
                                            SelectionState::Updateposition);
       }
     }
-  } else {
-    nsRefPtr<dom::Selection> selection = GetSelection();
-    if (selection && selection->RangeCount() && selection->IsCollapsed()) {
-      DispatchSelectionStateChangedEvent(selection,
-                                         SelectionState::Updateposition);
-    }
   }
 }
 
 void
 SelectionCarets::LaunchLongTapDetector()
 {
   if (mAsyncPanZoomEnabled) {
     return;
@@ -1318,22 +1312,16 @@ SelectionCarets::Reflow(DOMHighResTimeSt
     UpdateSelectionCarets();
 
     // We don't care selection state when we're at drag mode. We always hide
     // bubble in drag mode. So, don't dispatch event here.
     if (mDragMode == NONE) {
       DispatchSelectionStateChangedEvent(GetSelection(),
                                          SelectionState::Updateposition);
     }
-  } else {
-    nsRefPtr<dom::Selection> selection = GetSelection();
-    if (selection && selection->RangeCount() && selection->IsCollapsed()) {
-      DispatchSelectionStateChangedEvent(selection,
-                                         SelectionState::Updateposition);
-    }
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 SelectionCarets::ReflowInterruptible(DOMHighResTimeStamp aStart,
                                      DOMHighResTimeStamp aEnd)
 {