Fix 345521: "return 0" in handler cancels events, r/sr=bz

This commit is contained in:
mhammond%skippinet.com.au 2006-08-06 09:29:10 +00:00
Родитель 66a0729c97
Коммит 9f72d8ece4
2 изменённых файлов: 15 добавлений и 7 удалений

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

@ -243,13 +243,7 @@ nsJSEventListener::HandleEvent(nsIDOMEvent* aEvent)
vrv->GetAsDOMString(beforeUnload->text);
}
}
} else if (dataType == nsIDataType::VTYPE_BOOL ||
dataType == nsIDataType::VTYPE_INT8 ||
dataType == nsIDataType::VTYPE_INT16 ||
dataType == nsIDataType::VTYPE_INT32 ||
dataType == nsIDataType::VTYPE_UINT8 ||
dataType == nsIDataType::VTYPE_UINT16 ||
dataType == nsIDataType::VTYPE_UINT32) {
} else if (dataType == nsIDataType::VTYPE_BOOL) {
// If the handler returned false and its sense is not reversed,
// or the handler returned true and its sense is reversed from
// the usual (false means cancel), then prevent default.

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

@ -3,6 +3,20 @@
The link below has an onmousedown, an onmouseup, and an onmousemove handler.
Mouseover or click for event info in debug console.
<a href="jshandlers.html">Link back to this page</a>
<p>The link below has an event that should open www.mozilla.org when
clicked
</p>
<!-- The link does 'return 0' - as per bug 345521 this should *not* be
interpreted as false
-->
<a href="http://www.mozilla.org" onclick="return 0">Click me</a>
<p>The link below has an event that is cancelled - nothing should happen when
clicked
</p>
<a href="http://www.mozilla.org" onclick="return false">Click me<a/>
</body>
<script>
function findElementByTagName(start, tag)