Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upIntegrated activation behaviour into event dispatch algorithm #22981
Conversation
highfive
commented
Mar 6, 2019
|
Heads up! This PR modifies the following files:
|
highfive
commented
Mar 6, 2019
|
Help Please! How can I remove the previously approved commit from this pull? :D |
|
I recommend doing this:
|
6c090b2
to
d0ac174
| target.dispatch_event(event); | ||
|
|
||
| // Step 5 | ||
| event.dispatching(); |
This comment has been minimized.
This comment has been minimized.
Manishearth
Mar 11, 2019
Member
this does nothing, please remove this line
the spec asks us to return the result of dispatching, that would mean returning the EventStatus returned by dispatch_event (however I don't see anything in the spec that uses this right now)
| @@ -169,6 +170,9 @@ impl Event { | |||
| // Step 3-4. | |||
| let path = self.construct_event_path(&target); | |||
| rooted_vec!(let event_path <- path.into_iter()); | |||
| if self.type_() == atom!("click") { | |||
| is_activation_event = true; | |||
This comment has been minimized.
This comment has been minimized.
Manishearth
Mar 11, 2019
Member
This variable isn't used, also you can fire manual click events that aren't activation events. Please remove the is_activation_event stuff.
This comment has been minimized.
This comment has been minimized.
aditj
Mar 11, 2019
Author
Contributor
I think is_activition_event will be used in Steps 9.6.1 and Steps 9.8.1 of the spec
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
aditj
Mar 12, 2019
•
Author
Contributor
@Manishearth I can certainly try!
But how do I check if an event target has Activation behaviour?
This comment has been minimized.
This comment has been minimized.
Manishearth
Mar 21, 2019
Member
Downcast it to an element, and if that succeeds, call .as_maybe_activatable() on it.
| // Step 2 | ||
| element.set_click_in_progress(true); | ||
| // Step 3 | ||
| // Step 12 of https://dom.spec.whatwg.org/#concept-event-dispatch | ||
| let activatable = element.as_maybe_activatable(); | ||
| if let Some(a) = activatable { | ||
| a.pre_click_activation(); |
This comment has been minimized.
This comment has been minimized.
Manishearth
Mar 11, 2019
Member
As mentioned in @jdm's comment, this stuff needs to be moved into the event dispatch code
This comment has been minimized.
This comment has been minimized.
aditj
Mar 12, 2019
Author
Contributor
I'll remove this from here.
Coming to implementation in the event dispatch code there's a comment mentioning step 12 of the spec . Although I am unsure of the correctness of this implementation.
ba5a291
to
3493bd5
1f68409
to
f132ad3
|
@Manishearth Re-review ping. |
|
@jdm The requested changes haven't yet been made |
|
|
|
Closing due to inactivity. |
aditj commentedMar 6, 2019
•
edited by CYBAI
Trying to update the synthetic mouse click algorithm according to the spec
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is