Commit 055c1294 authored by Raine Makelainen's avatar Raine Makelainen

[nemo][embedlite-component] Don't open speculative connection upon press. Fixes JB#38734

Rather open speculative connection upon "touchend" given that we have not
seen "touchmove" events.
parent 1a870c6e
......@@ -617,6 +617,22 @@ EmbedHelper.prototype = {
_handleTouchEnd: function(aEvent) {
this._viewportReadyToChange = true;
this._touchEventDefaultPrevented = (this._touchEventDefaultPrevented || aEvent.defaultPrevented);
// Can only trigger if there have not seen touch moves e.i. we do hae highlight element. Touch move
// cancels tap highlight and also here we call cancel tap highlight at the end.
if (this._highlightElement && !this._touchEventDefaultPrevented) {
let target = aEvent.target;
if (target) {
let uri = this._getLinkURI(target);
if (uri) {
try {
Services.io.QueryInterface(Ci.nsISpeculativeConnect).speculativeConnect(uri, null);
} catch (e) {
dump("Speculative connection error: " + e + "\n")
}
}
}
}
this._cancelTapHighlight();
},
......@@ -635,12 +651,6 @@ EmbedHelper.prototype = {
return;
}
let uri = this._getLinkURI(target);
if (uri) {
try {
Services.io.QueryInterface(Ci.nsISpeculativeConnect).speculativeConnect(uri, null);
} catch (e) {}
}
this._doTapHighlight(target);
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment