Multiple alert boxes onmouse[down/up]

NEW
Unassigned

Status

()

10 years ago
8 years ago

People

(Reporter: TNO, Unassigned)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0

While debugging an application I came across some unexpected behavior with the alert dialog box where it didn't act modal as anticipated and launched two dialogs at once.

Reproducible: Always

Steps to Reproduce:
1. Using the HTML page below mousedown on "Click Me", wait a couple seconds and mouseup to see both alerts firing.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>FireFox 3 Alert Issue</title>
	<script type="text/javascript">
		var mouseDown = false;

		function addEvent(obj,type,fn){
			if (obj.attachEvent) {
				obj['e' + type + fn] = fn;
				obj[type + fn] = function(){
					obj['e' + type + fn](window.event);
				};
				obj.attachEvent('on' + type, obj[type + fn]);
			}
			else {
				obj.addEventListener(type, fn, false);
			}
		}
		addEvent(document,"mousedown",function(e){
			e = e || window.event;
			var target = e.target || e.srcElement;
			if (target.nodeType == 3){target = target.parentNode}
			if(target.id == "Foo"){
				mouseDown = true;
				alert("Mouse Down!");
			}
		});
		addEvent(document,"mouseup",function(e){
			if(mouseDown == true){
				mouseDown = false;
				alert("Mouse Up!");
			}
		});
	</script>
</head>
<body>
<span id="Foo">Click Me!</span>
</body>
</html>
Actual Results:  
Two alert dialogs display simultaneously

Expected Results:  
Only one Alert dialog should be seen at a time and should halt all activity within the current Tab(s)
Created attachment 328840 [details]
reporter's testcase

I see this in all Firefox versions I tried, but not in Opera and IE6. They don't show the mouse up alert at all.
Status: UNCONFIRMED → NEW
Component: General → Event Handling
Ever confirmed: true
Product: Firefox → Core
QA Contact: general → events
Version: unspecified → Trunk
(Reporter)

Comment 2

8 years ago
This appears to be working as expected in Fx4.0b6
You need to log in before you can comment on or make changes to this bug.