Closed Bug 1388069 Opened 7 years ago Closed 7 years ago

Support createEvent("FocusEvent")


(Core :: DOM: Events, enhancement)

Not set



Tracking Status
firefox57 --- fixed


(Reporter: ayg, Assigned: ayg)



(Keywords: dev-doc-complete)


(1 file)

After a lot of discussion at <>, we agreed to remove support for a bunch of event types from the list supported in createEvent().  The new list in the spec matches our own exactly, except that it includes FocusEvent, because Chrome usage counters show high usage: <>  Currently about 0.04% of pages do createEvent("FocusEvent") in Chrome, which is high enough they'd prefer not to drop support.  Possibly these pages break somehow in Firefox as well.  Either way, I think it's fine for us to add support for this one event type.
Sorry, we actually still support some events that the spec doesn't, just FocusEvent is the only type that the spec says to support that we don't.
So when creating the event with createEvent(), it initializes the .type to "focus" instead of "", which causes test failures.  I tried looking through the source code a lot until I gave up.  Do you know how to fix it?
Flags: needinfo?(bugs)
I forgot to add, I deliberately didn't add telemetry for this, because I think the decision to add the event is final.  If we ever want to consider dropping it and are worried about usage, we could always add telemetry then.
Comment on attachment 8894577 [details]
Bug 1388069 - Support createEvent("FocusEvent");

Sorry, but this has tons of unrelated stuff. Could you just upload a patch for this particular bug.
Attachment #8894577 - Flags: review?(bugs) → review-
Comment on attachment 8894577 [details]
Bug 1388069 - Support createEvent("FocusEvent");
Attachment #8894577 - Flags: review?(bugs) → review+
Pushed by
Support createEvent("FocusEvent"); r=smaug
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
On MDN, we have a createEvent() page:

However, we don't cover the different types of event in detail; we just say how the method is used, link to the DOM standard for the full list of event types that can be created, and then recommend that developers use event object constructors instead. This being the case, I don't think there is all that much update in the docs.

I have however added a note to the Fx57 rel notes to cover it:
Duplicate of this bug: 882165
You need to log in before you can comment on or make changes to this bug.