Bug 183629
Summary: | Allow extending of event objects | ||
---|---|---|---|
Product: | WebKit | Reporter: | Jake Archibald <jaffathecake> |
Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED CONFIGURATION CHANGED | ||
Severity: | Normal | CC: | ashvayka |
Priority: | P2 | ||
Version: | Safari Technology Preview | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=174313 |
Jake Archibald
class Foo extends Event {}
console.log(new Foo('bar').constructor);
Chrome & Firefox say Foo, Edge & Safari say Event.
The Chrome/Firefox behaviour is preferable, as it allows you to create custom event objects, which is especially useful when developing custom elements.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Jake Archibald
Tests: http://w3c-test.org/dom/events/Event-subclasses-constructors.html
Lucas Forschler
Mass move bugs into the DOM component.
Alexey Shvayka
(In reply to Jake Archibald from comment #1)
> Tests: http://w3c-test.org/dom/events/Event-subclasses-constructors.html
As of r256716, extending Event (as well as other DOM constructors) works as expected.
Provided test file is 100% passing.