DOM initEvent(): final invocation should take precedence

RESOLVED FIXED

Status

()

Core
DOM: Events
--
minor
RESOLVED FIXED
13 years ago
13 years ago

People

(Reporter: shutdown, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

13 years ago
According to the DOM Level 2 Events spec, the following code
should alert "true/true", but I get "false/false".

javascript:e=document.createEvent("Events");e.initEvent("x",false,false);
e.initEvent("x",true,true);alert(e.bubbles+"/"+e.cancelable);

http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-Event-initEvent
> The initEvent method is used to initialize the value of an Event created
> through the DocumentEvent interface. This method may only be called before
> the Event has been dispatched via the dispatchEvent method, though it may be
> called multiple times during that phase if necessary. If called multiple
> times the final invocation takes precedence.
This is probably fall-out from our fix to prevent reinitialization of events after they've been dispatched.
Status: UNCONFIRMED → NEW
Ever confirmed: true
I thought so too, but it's not. Patch coming up...
Created attachment 201896 [details] [diff] [review]
Make sure to set the internal flag bits correctly if an event is re-initialized.
Attachment #201896 - Flags: superreview?(bzbarsky)
Attachment #201896 - Flags: review?(bzbarsky)
Comment on attachment 201896 [details] [diff] [review]
Make sure to set the internal flag bits correctly if an event is re-initialized.

r+sr=bzbarsky
Attachment #201896 - Flags: superreview?(bzbarsky)
Attachment #201896 - Flags: superreview+
Attachment #201896 - Flags: review?(bzbarsky)
Attachment #201896 - Flags: review+
Fix checked in.
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.