-
Notifications
You must be signed in to change notification settings - Fork 17
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
Need a new DOM concept for user-driven events rather than using isTrusted
#105
Comments
Thanks for filing this, @sefeng211! /cc @noamr @domenic for thoughts on the above. Any objections to adding such a concept? |
@domenic The navigation API seems to have a user initiated concept that may be close in spirit to what we want here. Do you think it'd make sense to pull that into DOM and generalize it beyond navigations? |
I don't think that concept (defined more fully here) is really related to what you're looking for here. |
Looking at the definition of the scroll event, I'm not sure a new concept is needed. Perhaps that spec can be modified to preserve in the list of pending scroll event targets whether the event was user-initiated or programmatic, and LCP can refer to that. Are there other places where this is needed? |
The same concept is something we need for has dispatched input event, for "click", "mousedown" and "keydown". We could create something specific for each one of these events (or two concepts, one for scroll and one for input). |
Seems like |
... using |
The special behavior of isTrusted for click(), although theoretically impure, is probably still what you want for cases like this. That is, we set isTrusted to false for both click() and dispatchEvent(), reserving isTrusted true for "actual" clicks. |
Ah got it, thanks for the clarification. So |
At least for scrolling, |
So perhaps we can add a boolean to scroll events in particular (an isACTUALLYTrusted sort of thing, perhaps |
We have been using the isTrusted attribute to check if the event comes from a user interaction, however this attribute only indicates that the event was dispatched by user agents.
For instance, user agents fire a scroll event with
isTrusted=true
forscrollLeft
, and apparently we don't want to stop creating LCP when we see this scroll event.So we need a new concept that we can use in the spec.
The text was updated successfully, but these errors were encountered: