mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 895284 - Fix plus tests for caret and selection monocles appearing at the same time after a urlbar tap. r=jwilde
This commit is contained in:
parent
35e9397d58
commit
c1673a63e6
@ -844,10 +844,7 @@ var SelectionHelperUI = {
|
||||
|
||||
if (this._hitTestSelection(aEvent) && this._targetIsEditable) {
|
||||
// Attach to the newly placed caret position
|
||||
this._sendAsyncMessage("Browser:CaretAttach", {
|
||||
xPos: aEvent.clientX,
|
||||
yPos: aEvent.clientY
|
||||
});
|
||||
this.attachToCaret(this._msgTarget, aEvent.clientX, aEvent.clientY);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -88,6 +88,37 @@ gTests.push({
|
||||
sendElementTap(window, paste);
|
||||
ok(edit.popup.popupOpen, "bug: popup should be showing");
|
||||
|
||||
clearSelection(edit);
|
||||
delete window.r;
|
||||
}
|
||||
});
|
||||
|
||||
gTests.push({
|
||||
desc: "bug 895284 - tap selection",
|
||||
run: function bug887120_test() {
|
||||
gWindow = window;
|
||||
|
||||
yield showNavBar();
|
||||
let edit = document.getElementById("urlbar-edit");
|
||||
edit.value = "wikipedia.org";
|
||||
edit.select();
|
||||
|
||||
let editCoords = logicalCoordsForElement(edit);
|
||||
SelectionHelperUI.attachEditSession(ChromeSelectionHandler, editCoords.x, editCoords.y);
|
||||
|
||||
ok(SelectionHelperUI.isSelectionUIVisible, "selection enabled");
|
||||
|
||||
let selection = edit.QueryInterface(Components.interfaces.nsIDOMXULTextBoxElement)
|
||||
.editor.selection;
|
||||
let rects = selection.getRangeAt(0).getClientRects();
|
||||
let midX = Math.ceil(((rects[0].right - rects[0].left) * .5) + rects[0].left);
|
||||
let midY = Math.ceil(((rects[0].bottom - rects[0].top) * .5) + rects[0].top);
|
||||
|
||||
sendTap(window, midX, midY);
|
||||
|
||||
ok(SelectionHelperUI.isCaretUIVisible, "caret browsing enabled");
|
||||
|
||||
clearSelection(edit);
|
||||
delete window.r;
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user