Closed
Bug 67535
Opened 24 years ago
Closed 24 years ago
Event capture does not work for body decendants
Categories
(Core :: DOM: Events, defect)
Tracking
()
People
(Reporter: pbwiz, Assigned: joki)
Details
(Keywords: dom2)
I have entered the following code. It should capture the click event at the
<p> element, then the <b> element, then the <u> element, then it should
trigger the bubbleing events. The bubblinge event listeners are fired OK,
but none of the event captures occur. After re-writing it I have found that
it works if I capture AT THE document or body elements, but not for the other
three elements. This may be related to bugs #53640 and/or 56302. I am using
build number 2001010901 on a Win2K Intel platform.
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<script type="text/javascript">
function init(){
var one = document.getElementById("One");
var two = document.getElementById("Two");
var three = document.getElementById("Three");
one.addEventListener("click", clickOneBubble, false);
two.addEventListener("click", clickTwoBubble, false);
three.addEventListener("click", clickThreeBubble, false);
one.addEventListener("click", clickOneCapture, true);
two.addEventListener("click", clickTwoCapture, true);
three.addEventListener("click", clickThreeCapture, true);
};
setTimeout(init, 1);
function clickOneCapture( e ){ alert("one capture"); };
function clickTwoCapture( e ){ alert("two capture"); };
function clickThreeCapture( e ){ alert("three capture"); };
function clickOneBubble( e ){ alert("one bubble"); };
function clickTwoBubble( e ){ alert("two bubble"); };
function clickThreeBubble( e ){ alert("three bubble"); };
</script>
</HEAD>
<BODY>
<P id="Three"><b id="Two"><u id="One">Click Me</u></b></P>
</BODY>
</HTML>
Jeff.
Well bug 53640 is about setting and removing eventHandlers, and I don't have a
problem with that. The way the events get trough is something different it
seems. If you use alerts, your events may being eaten by the alert. And if you
click behind that </p> element, then you will see an capture event message, but
only there.
note: it seems that events on #text are not passed through.
| Reporter | ||
Comment 3•24 years ago
|
||
I modified the event handler to set a timeout to call up the alerts, and it
still does not capture the events, so I would say the alert is not interfearing
with the event capture.
Any suggestions?
Jeff.
It is the same core problem at the end. But if nobody is going to confirm or
comment on this issue...
Updated•24 years ago
|
Component: DOM Level 2 → DOM Events
Comment 6•24 years ago
|
||
Marking NEW, I think this is slightly different. Feel free to dupe it if you
believe I am wrong.
Status: UNCONFIRMED → NEW
Ever confirmed: true
| Assignee | ||
Comment 7•24 years ago
|
||
It is indeed a dupe of 53640 which has happily been fixed. This works now.
*** This bug has been marked as a duplicate of 53640 ***
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•