Bug 998188 part.7 Firefox for Android should use XP line break at calling sendQueryContentEvent() in its chrome r=margaret.leibovic, feedback=markcapella
authorMasayuki Nakano <masayuki@d-toybox.com>
Sat, 26 Apr 2014 08:52:14 +0900
changeset 199921 cf785bf038ed6551bee31d9aeae6fb952ec5b864
parent 199920 93b58802f74386df550295870f5be2bfc5ea51ac
child 199922 1db547d439de7a621157ef1462ccfda4b4d7f199
push id486
push userasasaki@mozilla.com
push dateMon, 14 Jul 2014 18:39:42 +0000
treeherdermozilla-release@d33428174ff1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs998188
milestone31.0a1
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
Bug 998188 part.7 Firefox for Android should use XP line break at calling sendQueryContentEvent() in its chrome r=margaret.leibovic, feedback=markcapella
mobile/android/chrome/content/SelectionHandler.js
--- a/mobile/android/chrome/content/SelectionHandler.js
+++ b/mobile/android/chrome/content/SelectionHandler.js
@@ -778,17 +778,18 @@ var SelectionHandler = {
     // stays within the bounds of the field
     if (this._activeType == this.TYPE_CURSOR) {
       // Get rect of text inside element
       let range = document.createRange();
       range.selectNodeContents(this._targetElement.QueryInterface(Ci.nsIDOMNSEditableElement).editor.rootElement);
       let textBounds = range.getBoundingClientRect();
 
       // Get rect of editor
-      let editorBounds = this._domWinUtils.sendQueryContentEvent(this._domWinUtils.QUERY_EDITOR_RECT, 0, 0, 0, 0);
+      let editorBounds = this._domWinUtils.sendQueryContentEvent(this._domWinUtils.QUERY_EDITOR_RECT, 0, 0, 0, 0,
+                                                                 this._domWinUtils.QUERY_CONTENT_FLAG_USE_XP_LINE_BREAK);
       // the return value from sendQueryContentEvent is in LayoutDevice pixels and we want CSS pixels, so
       // divide by the pixel ratio
       let editorRect = new Rect(editorBounds.left / window.devicePixelRatio,
                                 editorBounds.top / window.devicePixelRatio,
                                 editorBounds.width / window.devicePixelRatio,
                                 editorBounds.height / window.devicePixelRatio);
 
       // Use intersection of the text rect and the editor rect
@@ -991,17 +992,18 @@ var SelectionHandler = {
         return x < 0 || y < 0 || x > bounds.width || y > bounds.height;
       };
     }
 
     let positions = null;
     if (this._activeType == this.TYPE_CURSOR) {
       // The left and top properties returned are relative to the client area
       // of the window, so we don't need to account for a sub-frame offset.
-      let cursor = this._domWinUtils.sendQueryContentEvent(this._domWinUtils.QUERY_CARET_RECT, this._targetElement.selectionEnd, 0, 0, 0);
+      let cursor = this._domWinUtils.sendQueryContentEvent(this._domWinUtils.QUERY_CARET_RECT, this._targetElement.selectionEnd, 0, 0, 0,
+                                                           this._domWinUtils.QUERY_CONTENT_FLAG_USE_XP_LINE_BREAK);
       // the return value from sendQueryContentEvent is in LayoutDevice pixels and we want CSS pixels, so
       // divide by the pixel ratio
       let x = cursor.left / window.devicePixelRatio;
       let y = (cursor.top + cursor.height) / window.devicePixelRatio;
       return [{ handle: this.HANDLE_TYPE_MIDDLE,
                 left: x + scroll.X,
                 top: y + scroll.Y,
                 hidden: checkHidden(x, y) }];