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

Integrated activation behaviour into event dispatch algorithm #22981

Closed
wants to merge 1 commit into from

Conversation

@aditj
Copy link
Contributor

aditj commented Mar 6, 2019

Trying to update the synthetic mouse click algorithm according to the spec


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #22783 (GitHub issue number if applicable)
  • There are tests for these changes OR
  • These changes do not require tests because ___

This change is Reviewable

@highfive
Copy link

highfive commented Mar 6, 2019

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/document.rs, components/script/dom/activation.rs, components/script/dom/performance.rs, components/script/dom/event.rs, components/script/dom/webidls/MouseEvent.webidl and 2 more
  • @KiChjang: components/script/dom/document.rs, components/script/dom/activation.rs, components/script/dom/performance.rs, components/script/dom/event.rs, components/script/dom/webidls/MouseEvent.webidl and 2 more
@highfive
Copy link

highfive commented Mar 6, 2019

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
@aditj
Copy link
Contributor Author

aditj commented Mar 6, 2019

Help Please! How can I remove the previously approved commit from this pull? :D

@jdm
Copy link
Member

jdm commented Mar 6, 2019

I recommend doing this:

$ git checkout aditj-patch-6
$ git reset --hard de09c8fb6ef87dec5932d5fab4adcb421d291a54
$ git cherry-pick 009db7396362dc4febba4f5bb43d08cd0e6feb9e
$ git push -f origin aditj-patch-6
@aditj aditj force-pushed the aditj:aditj-patch-6 branch 5 times, most recently from 6c090b2 to d0ac174 Mar 6, 2019
target.dispatch_event(event);

// Step 5
event.dispatching();

This comment has been minimized.

@Manishearth

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.

@Manishearth

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.

@aditj

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.

@Manishearth

Manishearth Mar 11, 2019

Member

Ah, I see. Can you implement that part?

This comment has been minimized.

@aditj

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.

@Manishearth

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.

@Manishearth

Manishearth Mar 11, 2019

Member

As mentioned in @jdm's comment, this stuff needs to be moved into the event dispatch code

https://dom.spec.whatwg.org/#concept-event-dispatch

This comment has been minimized.

@aditj

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.

@aditj aditj force-pushed the aditj:aditj-patch-6 branch from d0ac174 to ef8c977 Mar 14, 2019
@aditj aditj force-pushed the aditj:aditj-patch-6 branch 2 times, most recently from ba5a291 to 3493bd5 Mar 14, 2019
@aditj aditj force-pushed the aditj:aditj-patch-6 branch 3 times, most recently from 1f68409 to f132ad3 Mar 14, 2019
@jdm
Copy link
Member

jdm commented Mar 18, 2019

@Manishearth Re-review ping.

@Manishearth
Copy link
Member

Manishearth commented Mar 18, 2019

@jdm The requested changes haven't yet been made

@bors-servo
Copy link
Contributor

bors-servo commented Oct 23, 2019

The latest upstream changes (presumably #24489) made this pull request unmergeable. Please resolve the merge conflicts.

@jdm
Copy link
Member

jdm commented Jan 8, 2020

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

5 participants
You can’t perform that action at this time.