Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"has dispatched input event" should only be set for trusted events #121

Open
yoavweiss opened this issue Jul 4, 2022 · 3 comments
Open
Assignees

Comments

@yoavweiss
Copy link
Contributor

yoavweiss commented Jul 4, 2022

"has dispatched input event" is a flag used by LargestContentfulPaint to stop taking candidates into account.
It should be limited to trusted events, to avoid web content from stopping LCP registration by dispatching such events programatically.

@mmocny
Copy link
Contributor

mmocny commented Jul 4, 2022

Is this meant to be an Event TIming issue?

(Event timing is already constrained to trusted events see https://w3c.github.io/event-timing/#sec-events-exposed)

@mmocny
Copy link
Contributor

mmocny commented Jul 4, 2022

I see now, LCP spec patches HTML to add "has dispatched scroll event" and DOM to set it. But LCP spec relies on Event timing to do likewise for "has dispatched input event"

My read is that Event Timing is already doing what is expected here.

Specifically, the value of "has dispatched input event" is set from Step 6 of https://w3c.github.io/event-timing/#set-event-timing-entry-duration but that is already filtered on isTrusted at that point.

See: https://w3c.github.io/event-timing/#sec-modifications-DOM which calls https://w3c.github.io/event-timing/#initialize-event-timing from step 2, which calls https://w3c.github.io/event-timing/#considered-for-event-timing from step 1

@yoavweiss
Copy link
Contributor Author

I could be wrong but my read is that isTrusted is taken into account in two places: in considered for EventTiming and in compute interactionId.
But that's not sufficient as the setting of "has dispatched input event" is happening in dispatch pending event timing entries, which is called directly from the update the rendering monkeypatch, without being filtered on isTrusted.

@mmocny mmocny self-assigned this Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants