-
Notifications
You must be signed in to change notification settings - Fork 297
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
Reset dispatching flags when retargeting to a different target than event's #402
Conversation
…vent's This repeats step 14 in step 4's shortcut of dispatching an event.
This looks good to me. @hayatoito? But maybe we should instead use a "jump to label" thing to avoid introducing more such issues going forward? We'll also need tests. |
Looks good to me. As an alternative idae, how about re-ordering steps 1-4? Moving "1. Set event's dispatch flag" I think that does not change the semantics, and would make our intention more clear. |
Yeah, that is probably best @hayatoito. Thanks! |
It does change the behaviour, what you suggest wouldn't clear the stop propagation flag etc.
|
That is true. I guess the question is whether you expect those to be always unset even if the event didn't really end up dispatching. (The main reason they're unset at the end is because listeners might have set them.) I don't think it matters much what we do since this is new behavior. So we get to decide what makes sense for this edge case (and write tests for it). I kinda like @hayatoito's fix since it's simple, but I'm willing to go for the alternative if there's a good reason. |
Before that new behaviour was introduced, there was not a single code path when dispatching an event that wouldn't clear these flags, even when no listener has actually been invoked. I feel like this property of the algorithm should be preserved.
|
@smaug---- thoughts either way? |
I guess the pr is fine. |
I can try work on a new PR for this after #585 lands. |
Though maybe I should include it there, once that has had some more review. |
This repeats step 14 in step 4's shortcut of dispatching an event.