New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 740576 link

Starred by 12 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Feature



Sign in to add a comment

Add EventTarget constructor

Project Member Reported by domenic@chromium.org, Jul 10 2017

Issue description

Comment 1 by hayato@chromium.org, Jul 11 2017

Status: Available (was: Untriaged)

Comment 2 by hayato@chromium.org, Jul 11 2017

Labels: OWP-Type-NewAPI
Project Member

Comment 3 by bugdroid1@chromium.org, Jul 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9

commit 550d62d7eb5fc6f269b3568df6ba48d3221fcdc9
Author: Joshua Bell <jsbell@chromium.org>
Date: Wed Jul 26 16:13:36 2017

Add real baselines for new .any.js and .worker.js tests (batch 1 of N)

In a few cases there were obvious bugs in WPT which were fixed.
In most cases baselines were added (expected.txt files with FAIL).

This batch covers: (with commentary where interesting)
* FileAPI: fixes for WPT; update IDL fragments with Exposed
* IndexedDB: fixes for WPT; make DOMStringList untested here
* WebIDL: DOMException bindings (crbug.com/737497)
* background-fetch
* dom: AbortController (NYI in blink?)
* dom: EventTarget constructor (NYI in blink,  crbug.com/740576 )
* fetch/api
* html: dom/interfaces.worker.js is broken upstream [1]
* storage: renamed test with .https infix
* url
* workers

[1] https://github.com/w3c/web-platform-tests/issues/6621

Bug:  748723 , 740576 ,737497
Change-Id: I081412709886e55f2eadd7f21156712060319412
Reviewed-on: https://chromium-review.googlesource.com/585582
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: Jeff Carpenter <jeffcarp@chromium.org>
Commit-Queue: Joshua Bell <jsbell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#489659}
[modify] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/FileAPI/idlharness.html
[modify] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/FileAPI/idlharness.worker.js
[modify] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/IndexedDB/interfaces.html
[modify] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/IndexedDB/interfaces.idl
[modify] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/IndexedDB/interfaces.worker.js
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/WebIDL/ecmascript-binding/es-exceptions/DOMException-custom-bindings.any-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/WebIDL/ecmascript-binding/es-exceptions/DOMException-custom-bindings.any.worker-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces.worker-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/dom/abort/event.any-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/dom/abort/event.any.worker-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/dom/events/EventTarget-constructible.any-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/dom/events/EventTarget-constructible.any.worker-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/fetch/api/basic/request-upload.any-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/fetch/api/basic/request-upload.any.worker-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/fetch/api/basic/scheme-about.any-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/fetch/api/basic/scheme-about.any.worker-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/fetch/api/cors/cors-preflight-redirect.any-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/fetch/api/cors/cors-preflight-redirect.any.worker-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/fetch/api/cors/cors-preflight-referrer.any-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/fetch/api/cors/cors-preflight-referrer.any.worker-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/fetch/api/cors/cors-preflight-star.any-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/fetch/api/cors/cors-preflight-star.any.worker-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces.worker-expected.txt
[rename] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/storage/interfaces.https.worker.js
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/url/historical.any-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/url/historical.any.worker-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/url/interfaces.any-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/url/interfaces.any.worker-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/url/toascii.window-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/workers/constructors/Worker/DedicatedWorkerGlobalScope-members.worker-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/workers/constructors/Worker/expected-self-properties.worker-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/workers/interfaces.worker-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/workers/interfaces/WorkerUtils/importScripts/002.worker-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/workers/semantics/interface-objects/001.worker-expected.txt
[add] https://crrev.com/550d62d7eb5fc6f269b3568df6ba48d3221fcdc9/third_party/WebKit/LayoutTests/external/wpt/workers/semantics/interface-objects/002.worker-expected.txt

Comment 4 by kochi@chromium.org, Oct 26 2017

Cc: -dominicc@chromium.org hayato@chromium.org kochi@chromium.org
Labels: -Pri-3 Pri-2
Owner: rakina@chromium.org
Status: Assigned (was: Available)
Rakina, could you work on this?
Status: Started (was: Assigned)
Project Member

Comment 6 by bugdroid1@chromium.org, Nov 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b37bccc87b840d48ffd2e75a442c67d85f18ab65

commit b37bccc87b840d48ffd2e75a442c67d85f18ab65
Author: Rakina Zata Amni <rakina@chromium.org>
Date: Fri Nov 10 07:22:05 2017

Make EventTarget Constructible & Subclassable in JavaScript

Currently, EventTarget cannot be constructed or be subclassed (in JavaScript).
The spec for EventTarget was updated to allow constructing and
subclassing EventTarget.

A new class, EventTargetImpl, is created as the user-constructable version of
EventTarget. Even though the name is EventTargetImpl, it will be exposed as
EventTarget to JavaScript. We are using a hacky approach by making
EventTarget::Create return an instance of EventTargetImpl, which means an
instance of EventTargetImpl will be returned when the EventTarget object is
constructed in JavaScript.

Spec:
https://dom.spec.whatwg.org/#dom-eventtarget-eventtarget

Design doc:
https://docs.google.com/a/google.com/document/d/1TXMAkLeaNpbbETeqTyJZ57YnmqzgchyhFsANVZ2Ow3Y/edit?usp=sharing

Bug:  740576 
Change-Id: Ia0569ee99c4d856120c387ca6aceed5fbe1491b5
Reviewed-on: https://chromium-review.googlesource.com/754248
Reviewed-by: Hayato Ito <hayato@chromium.org>
Reviewed-by: Yuki Shiino <yukishiino@chromium.org>
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515495}
[modify] https://crrev.com/b37bccc87b840d48ffd2e75a442c67d85f18ab65/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/reporting/securitypolicyviolation-idl.html
[delete] https://crrev.com/a58c8bd608d040102d374322b48aa9055d8fcdbe/third_party/WebKit/LayoutTests/external/wpt/dom/events/EventTarget-constructible.any-expected.txt
[delete] https://crrev.com/a58c8bd608d040102d374322b48aa9055d8fcdbe/third_party/WebKit/LayoutTests/external/wpt/dom/events/EventTarget-constructible.any.worker-expected.txt
[modify] https://crrev.com/b37bccc87b840d48ffd2e75a442c67d85f18ab65/third_party/WebKit/LayoutTests/external/wpt/dom/interfaces-expected.txt
[modify] https://crrev.com/b37bccc87b840d48ffd2e75a442c67d85f18ab65/third_party/WebKit/LayoutTests/external/wpt/eventsource/interfaces.html
[modify] https://crrev.com/b37bccc87b840d48ffd2e75a442c67d85f18ab65/third_party/WebKit/LayoutTests/external/wpt/interfaces/dedicated-workers.idl
[modify] https://crrev.com/b37bccc87b840d48ffd2e75a442c67d85f18ab65/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/interfaces-idls.js
[modify] https://crrev.com/b37bccc87b840d48ffd2e75a442c67d85f18ab65/third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCPeerConnection-idl.html
[modify] https://crrev.com/b37bccc87b840d48ffd2e75a442c67d85f18ab65/third_party/WebKit/LayoutTests/fast/dom/dom-constructors-expected.txt
[modify] https://crrev.com/b37bccc87b840d48ffd2e75a442c67d85f18ab65/third_party/WebKit/LayoutTests/fast/dom/dom-constructors.html
[modify] https://crrev.com/b37bccc87b840d48ffd2e75a442c67d85f18ab65/third_party/WebKit/Source/core/dom/BUILD.gn
[modify] https://crrev.com/b37bccc87b840d48ffd2e75a442c67d85f18ab65/third_party/WebKit/Source/core/dom/events/EventTarget.cpp
[modify] https://crrev.com/b37bccc87b840d48ffd2e75a442c67d85f18ab65/third_party/WebKit/Source/core/dom/events/EventTarget.h
[modify] https://crrev.com/b37bccc87b840d48ffd2e75a442c67d85f18ab65/third_party/WebKit/Source/core/dom/events/EventTarget.idl
[add] https://crrev.com/b37bccc87b840d48ffd2e75a442c67d85f18ab65/third_party/WebKit/Source/core/dom/events/EventTargetImpl.cpp
[add] https://crrev.com/b37bccc87b840d48ffd2e75a442c67d85f18ab65/third_party/WebKit/Source/core/dom/events/EventTargetImpl.h
[modify] https://crrev.com/b37bccc87b840d48ffd2e75a442c67d85f18ab65/third_party/WebKit/Source/core/events/event_target_names.json5

Comment 7 by rakina@chromium.org, Nov 10 2017

Status: Fixed (was: Started)

Comment 8 by denel...@gmail.com, Feb 21 2018

I'm getting "Illegal invocation" when I try to call `dispatchEvent` on a Proxy of EventTarget instance. That is:

```
class A extends EventTarget {}
var a = new A();
var b = new Proxy(a, {});
b.dispatchEvent(new Event('a'));
// => Uncaught TypeError: Illegal invocation
```

Is this how it's supposed to be? We cannot use it proxies?
Yes, proxies do not in general work on any platform objects or built-in ES objects like Map, Set, etc.

Sign in to add a comment