mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 789889 - Speculatively connect to links if you put your finger down on it. r=mfinkle
This commit is contained in:
parent
9d7ced3202
commit
fcc03d6c72
@ -3505,8 +3505,24 @@ var BrowserEventHandler = {
|
||||
if (!closest)
|
||||
closest = aEvent.target;
|
||||
|
||||
if (closest)
|
||||
if (closest) {
|
||||
let uri = this._getLinkURI(closest);
|
||||
if (uri) {
|
||||
Services.io.QueryInterface(Ci.nsISpeculativeConnect).speculativeConnect(uri, null, null);
|
||||
}
|
||||
this._doTapHighlight(closest);
|
||||
}
|
||||
},
|
||||
|
||||
_getLinkURI: function(aElement) {
|
||||
if (aElement.nodeType == Ci.nsIDOMNode.ELEMENT_NODE &&
|
||||
((aElement instanceof Ci.nsIDOMHTMLAnchorElement && aElement.href) ||
|
||||
(aElement instanceof Ci.nsIDOMHTMLAreaElement && aElement.href))) {
|
||||
try {
|
||||
return Services.io.newURI(aElement.href, null, null);
|
||||
} catch (e) {}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
|
Loading…
Reference in New Issue
Block a user