Re: [whatwg/dom] Should EventInit contain 'timestamp'? (#76)

>So https://codereview.chromium.org/2834183002 landed without intent to ship? Is it not web-exposed or some such?

I believe it is not web-exposed yet as it is not in the IDL file: https://codesearch.chromium.org/chromium/src/third_party/WebKit/Source/core/events/EventInit.idl

> if we add this to the constructor, due to the way event dispatch is defined that would mean that each call site ends up defaulting this to the default value, which is not what we want, so adding this might be more involved than you think.

I am not sure if I understand the above correctly. The way I was thinking to do this was as follow:
Add timestamp to EventInitDic and  have it default to equivalent of "performance.now()"
This means that we will use this default value when 1) [create an event](https://dom.spec.whatwg.org/#concept-event-create) is used and 2) when [Event constructor is invoked](https://dom.spec.whatwg.org/#concept-event-constructor) 

AFAICT those are the two places where EventInit is used so not sure how the definition of event dispatch algorithm changes this behavior.  So this is what I expect to happen:
```
let e = new MouseEvent(); // N = performance.now
$target1.dispatchEvent(e); // e.timestamp == N
$target2.dispatchEvent(e); // e.timestamp == N
```

If this makes sense I can start a patch or event better fold this change in #420 (I think using EventInit default value makes #420 wording simpler)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/76#issuecomment-310208962

Received on Wednesday, 21 June 2017 21:22:40 UTC