Fix 213250: Autoscroll prevents middle clicking on links in XML (XHTML) docs. Patch by Jon Henry.

This commit is contained in:
blakeross%telocity.com 2004-02-20 02:04:27 +00:00
Родитель 4021f06547
Коммит 240cdc36b1
1 изменённых файлов: 27 добавлений и 8 удалений

Просмотреть файл

@ -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) {