зеркало из https://github.com/mozilla/gecko-dev.git
Fix 213250: Autoscroll prevents middle clicking on links in XML (XHTML) docs. Patch by Jon Henry.
This commit is contained in:
Родитель
4021f06547
Коммит
240cdc36b1
|
@ -538,18 +538,37 @@
|
|||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="isLink">
|
||||
<method name="isAutoscrollBlocker">
|
||||
<parameter name="node"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (!node) return false;
|
||||
var tagName = node.nodeName.toUpperCase();
|
||||
if (tagName == "A" || tagName == "INPUT" || tagName == "TEXTAREA" ||
|
||||
tagName == "AREA") {
|
||||
return true;
|
||||
|
||||
var middleMousePaste;
|
||||
|
||||
try {
|
||||
middleMousePaste = this.mPrefs.getBoolPref("middlemouse.paste");
|
||||
}
|
||||
|
||||
return this.isLink(node.parentNode);
|
||||
catch (ex) {
|
||||
middleMousePaste = false;
|
||||
}
|
||||
|
||||
if (node instanceof HTMLElement) {
|
||||
const xhtml1NS = "http://www.w3.org/1999/xhtml";
|
||||
var tagName = node.nodeName;
|
||||
|
||||
if (node.namespaceURI != xhtml1NS)
|
||||
tagName = tagName.toLowerCase();
|
||||
|
||||
if ((tagName == "a" || tagName == "area") && node.hasAttribute("href"))
|
||||
return true;
|
||||
|
||||
if (middleMousePaste && (tagName == "input" || tagName == "textarea"))
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
return this.isAutoscrollBlocker(node.parentNode);
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
@ -697,7 +716,7 @@
|
|||
</handler>
|
||||
<handler event="mousedown">
|
||||
<![CDATA[
|
||||
if (!this.autoscrollEnabled || this.isLink(event.originalTarget))
|
||||
if (!this.autoscrollEnabled || this.isAutoscrollBlocker(event.originalTarget))
|
||||
return;
|
||||
|
||||
if (!this._isScrolling) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче