Closed
Bug 64742
Opened 25 years ago
Closed 25 years ago
addEventListener buggy with capture events
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
People
(Reporter: asreddy_74, Assigned: joki)
Details
Attachments
(1 file)
|
1.11 KB,
text/html
|
Details |
The example below demonstrates the problem:
<HTML>
<HEAD>
<TITLE>Event handling</TITLE>
<script>
function check1(event) {
alert("div");
alert("eventPhase " + event.eventPhase);
}
function check2(event) {
alert("span");
alert("eventPhase " + event.eventPhase);
}
function check3(event) {
alert("span");
alert("eventPhase " + event.eventPhase);
}
function check4(event) {
alert("span");
alert("eventPhase " + event.eventPhase);
}
function test() {
document.getElementById("myDiv").addEventListener("click",check1,true);
document.getElementById("mySpan1").addEventListener("click",check2,true);
document.getElementById("mySpan2").addEventListener("click",check3,true);
document.getElementById("mySpan3").addEventListener("click",check4,false);
}
</script>
</HEAD>
<BODY onload="test()">
<DIV id="myDiv" style="background-color:red; width:300">
this is a div
<SPAN id="mySpan1" style="background-color:blue;">
span
</SPAN>
div continued
</DIV>
<SPAN id="mySpan2" style="background-color:green;">
span with capture event
</SPAN>
<SPAN id="mySpan3" style="background-color:yellow;">
span with bubble event
</SPAN>
</BODY>
</HTML>
Comment 1•25 years ago
|
||
Reporter, what build are you using? Could you please describe the expected
behavior in that testcase and the actual behavior so that it's clearer what the
bug is?
Comment 2•25 years ago
|
||
I have tested it on
Mozilla/5.0 (Windows; U; WinNT4.0; en-US; m18) Gecko/20001108 Netscape6/6.0
The problem as can be seen in the example :
1. When capture event (onclick) attached to div - the event is fired only when
div clicked outside text and the eventphase is 2
2. Capture event on span contained in div not fired at all
3. Capture event on stand alone span also not fired
Regards
Srinivas
Comment 4•25 years ago
|
||
*** This bug has been marked as a duplicate of 53640 ***
Status: UNCONFIRMED → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
Updated•6 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•