зеркало из https://github.com/mozilla/gecko-dev.git
Bug 846412 - Don't close selection helper until after the user makes a decision in a selection context menu. r=mbrubeck
This commit is contained in:
Родитель
39b30d5cd5
Коммит
26ff566423
|
@ -26,27 +26,11 @@ const BrowserTouchHandler = {
|
|||
json: aMessage.json,
|
||||
target: aMessage.target };
|
||||
// Touch input selection handling
|
||||
if (!InputSourceHelper.isPrecise) {
|
||||
if (SelectionHelperUI.isActive) {
|
||||
// Selection handler is active.
|
||||
if (aMessage.json.types.indexOf("selected-text") != -1) {
|
||||
// long tap on existing selection. The incoming message has the
|
||||
// string data, so reset the selection handler and invoke the
|
||||
// context menu.
|
||||
SelectionHelperUI.closeEditSession();
|
||||
} else {
|
||||
// Weird, context menu request with no selected text and
|
||||
// SelectionHelperUI is active? Might be a bug, warn. Fall
|
||||
// through anyway, the context menu handler will look in the
|
||||
// incoming message for content types it knows how to handle.
|
||||
Util.dumpLn("long tap on empty selection with SelectionHelperUI active?");
|
||||
SelectionHelperUI.closeEditSession();
|
||||
}
|
||||
} else if (SelectionHelperUI.canHandle(aMessage)) {
|
||||
if (!InputSourceHelper.isPrecise && !SelectionHelperUI.isActive &&
|
||||
SelectionHelperUI.canHandle(aMessage)) {
|
||||
SelectionHelperUI.openEditSession(aMessage);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Check to see if we have context menu item(s) that apply to what
|
||||
// was clicked on.
|
||||
|
|
|
@ -33,6 +33,7 @@ var ContextCommands = {
|
|||
this.clipboard.copyString(ContextMenuUI.popupState.string,
|
||||
this.docRef);
|
||||
this.showToast(Strings.browser.GetStringFromName("selectionHelper.textCopied"));
|
||||
SelectionHelperUI.closeEditSessionAndClear();
|
||||
}
|
||||
} else {
|
||||
// chrome
|
||||
|
@ -52,6 +53,7 @@ var ContextCommands = {
|
|||
let y = ContextMenuUI.popupState.y;
|
||||
let json = {x: x, y: y, command: "paste" };
|
||||
target.messageManager.sendAsyncMessage("Browser:ContextCommand", json);
|
||||
SelectionHelperUI.closeEditSessionAndClear();
|
||||
} else {
|
||||
// chrome
|
||||
target.editor.paste(Ci.nsIClipboard.kGlobalClipboard);
|
||||
|
|
|
@ -419,6 +419,10 @@
|
|||
</deck>
|
||||
</vbox>
|
||||
|
||||
<!-- Selection overlay - this should be below any content that can have selectable text -->
|
||||
<!-- onclick addresses dom bug 835175, str in bug 832957 -->
|
||||
<box onclick="false" class="selection-overlay-hidden" id="selection-overlay"/>
|
||||
|
||||
<flyoutpanel id="about-flyoutpanel" headertext="&aboutHeader.title;">
|
||||
<label id="about-product-label" value="&aboutHeader.product.label;"/>
|
||||
<label value="&aboutHeader.company.label;"/>
|
||||
|
@ -679,10 +683,6 @@
|
|||
<description id="alerts-text" flex="1"/>
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
<!-- Selection overlay - this should be below any content that can have selectable text -->
|
||||
<!-- onclick addresses dom bug 835175, str in bug 832957 -->
|
||||
<box onclick="false" class="selection-overlay-hidden" id="selection-overlay"/>
|
||||
</stack>
|
||||
|
||||
<svg:svg height="0">
|
||||
|
|
|
@ -345,8 +345,8 @@ var SelectionHelperUI = {
|
|||
messageManager.addMessageListener("Content:SelectionDebugRect", this);
|
||||
|
||||
// selection related events
|
||||
window.addEventListener("click", this, true);
|
||||
window.addEventListener("dblclick", this, true);
|
||||
window.addEventListener("click", this, false);
|
||||
window.addEventListener("dblclick", this, false);
|
||||
|
||||
// Picking up scroll attempts
|
||||
window.addEventListener("touchstart", this, true);
|
||||
|
@ -374,8 +374,8 @@ var SelectionHelperUI = {
|
|||
messageManager.removeMessageListener("Content:SelectionFail", this);
|
||||
messageManager.removeMessageListener("Content:SelectionDebugRect", this);
|
||||
|
||||
window.removeEventListener("click", this, true);
|
||||
window.removeEventListener("dblclick", this, true);
|
||||
window.removeEventListener("click", this, false);
|
||||
window.removeEventListener("dblclick", this, false);
|
||||
|
||||
window.removeEventListener("touchstart", this, true);
|
||||
window.removeEventListener("touchend", this, true);
|
||||
|
|
Загрузка…
Ссылка в новой задаче