"first-input" event timing "event name" is decided incorrectly compared to the web platform tests
Categories
(Core :: DOM: Performance APIs, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox138 | --- | fixed |
People
(Reporter: canova, Assigned: canova)
References
Details
Attachments
(1 file)
I was looking at the wpt failures and saw a pattern, that usually says !EQ("pointerdown", "mousedown").
That is interesting because we have first-input implemented, but apparently we were getting the first input event name incorrectly and this check was failing when we were comparing the event with the first input event.
This is where we dispatch the first-input event timing in the spec: https://w3c.github.io/event-timing/#sec-dispatch-pending (in step 6).
I was comparing it with our implementation and it seems like it matches it. But then I looked at Chrome's implementation and it looks like it's slightly different than the spec (step 6.2.2). And wpt tests follow that implementation instead of the spec
Chrome's implementation shows:
else if ((event_timing_entry->name() == event_type_names::kMousedown ||
event_timing_entry->name() == event_type_names::kClick ||
event_timing_entry->name() == event_type_names::kKeydown) &&
!first_pointer_down_event_timing_) {
(dispatch the event..)
}
And in Firefox:
case ePointerClick:
case eKeyDown:
case eMouseDown: {
(dispatch the event..)
break;
}
Notice the missing !mPendingPointerDown check there (or the extra first_pointer_down_event_timing_ check in Chromium).
I will file a spec bug shortly. But I guess it means that we need to update our implementation + the spec.
| Assignee | ||
Comment 1•1 year ago
•
|
||
I filed this bug in the spec: https://github.com/w3c/event-timing/issues/142
| Assignee | ||
Comment 2•1 year ago
|
||
The spec for dispatching the first-input event can be found here:
https://w3c.github.io/event-timing/#sec-dispatch-pending
Specifically step 6.2.2 handles this part of the code change.
The old code was following the spec, but some web-platform-tests were failing
because of it. After looking at the Chromium's codebase, I noticed that it
doesn't match the spec and it has this additional check. After adding it to our
code, it passes the tests as well. So it's clear that the spec doesn't match
the web platform tests or the Chromium implementation. It's more likely that
the spec needs to be updated.
Filed a spec bug here:
https://github.com/w3c/event-timing/issues/142
Updated•1 year ago
|
| Assignee | ||
Comment 3•1 year ago
|
||
Discussed the issue with a spec author, in the bug I filed. It looks like we want to always take the first input event that is part of an interaction. It means that if a pointercancel comes, we should invalidate it. Otherwise always use the pointerdown event for the first-input. I'm updating the patch to match that behavior as well.
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 4•1 year ago
|
||
The severity field is not set for this bug.
:bas.schouten, could you have a look please?
For more information, please visit BugBot documentation.
Updated•1 year ago
|
Comment 6•1 year ago
|
||
| bugherder | ||
Description
•