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

Implement user interaction task source #10714

Merged
merged 4 commits into from May 12, 2016

Conversation

@KiChjang
Copy link
Member

KiChjang commented Apr 19, 2016

Part of #7959.


This change is Reviewable

@highfive
Copy link

highfive commented Apr 19, 2016

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/dom/htmltextareaelement.rs, components/script/dom/bindings/global.rs, components/script/dom/htmldetailselement.rs, components/script/task_source/user_interaction.rs, components/script/script_thread.rs, components/script/dom/htmlinputelement.rs, components/script/dom/window.rs, components/script/task_source/dom_manipulation.rs
@highfive
Copy link

highfive commented Apr 19, 2016

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
@@ -175,10 +176,10 @@ impl<'a> GlobalRef<'a> {

/// `ScriptChan` used to send messages to the event loop of this global's
/// thread.
pub fn user_interaction_task_source(&self) -> Box<ScriptChan + Send> {
pub fn user_interaction_task_source(&self) -> Box<TaskSource<UserInteractionTask> + Send> {

This comment has been minimized.

Copy link
@Ms2ger

Ms2ger Apr 21, 2016

Contributor

Let's remove this function.

This comment has been minimized.

Copy link
@KiChjang

KiChjang Apr 22, 2016

Author Member

Why though? Is it because workers are not supposed to have the concept of task sources at all? If so, I might just remove all other task sources for GlobalRoot.

This comment has been minimized.

Copy link
@Ms2ger

Ms2ger Apr 24, 2016

Contributor

Because workers don't have user interaction. The others are likely used by workers as well as the main thread.

@Ms2ger Ms2ger assigned Ms2ger and unassigned KiChjang Apr 22, 2016
@KiChjang KiChjang force-pushed the KiChjang:user-interaction-task branch from ae394d8 to 0ade487 Apr 25, 2016
@KiChjang KiChjang force-pushed the KiChjang:user-interaction-task branch from 0ade487 to 51e7a38 Apr 25, 2016
@KiChjang
Copy link
Member Author

KiChjang commented Apr 25, 2016

User interaction task source removed from global.rs.

@Ms2ger
Copy link
Contributor

Ms2ger commented Apr 25, 2016

-S-awaiting-review +S-needs-code-changes


Reviewed 6 of 8 files at r1, 2 of 2 files at r2.
Review status: all files reviewed at latest revision, 13 unresolved discussions.


components/script/script_thread.rs, line 927 [r2] (raw file):
Unrelated: revert or stick in a separate commit.


components/script/dom/htmldetailselement.rs, line 88 [r2] (raw file):
Unrelated: revert or stick in a separate commit.


components/script/dom/htmlinputelement.rs, line 552 [r2] (raw file):
You're firing an event that we didn't before; this change should go in a separate commit and have a test.


components/script/dom/htmltextareaelement.rs, line 33 [r2] (raw file):
Random unnecessary change; revert.


components/script/dom/htmltextareaelement.rs, line 266 [r2] (raw file):
So much copy/paste around here that you forgot to rename this binding.


components/script/dom/htmltextareaelement.rs, line 268 [r2] (raw file):
You're firing an event that we didn't before; this change should go in a separate commit and have a test.


components/script/dom/htmltextareaelement.rs, line 374 [r2] (raw file):
Definitely too many clone()s here (and everywhere you copy/pasted this code).


components/script/dom/bindings/global.rs, line 29 [r2] (raw file):
Unused?


components/script/task_source/dom_manipulation.rs, line 43 [r2] (raw file):
Unrelated: revert or stick in a separate commit.


components/script/task_source/user_interaction.rs, line 19 [r2] (raw file):
I think in this case I'd prefer having a queue_event method that takes &Node or &EventTarget.


components/script/task_source/user_interaction.rs, line 20 [r2] (raw file):
So to be clear: this commit does not change anything about the scheduling of tasks: every message still ends up in the same queue? (This should be mentioned in the commit message.)


components/script/task_source/user_interaction.rs, line 30 [r2] (raw file):
I think I'd put the target first, rather than between the fields that define the properties of the event.


components/script/task_source/user_interaction.rs, line 32 [r2] (raw file):
Unused, remove


Comments from Reviewable

@KiChjang KiChjang force-pushed the KiChjang:user-interaction-task branch from 51e7a38 to 7557132 Apr 25, 2016
@KiChjang KiChjang force-pushed the KiChjang:user-interaction-task branch 4 times, most recently from 8a69f00 to 6ba0ff4 Apr 25, 2016
@KiChjang
Copy link
Member Author

KiChjang commented Apr 26, 2016

Review status: 1 of 8 files reviewed at latest revision, 13 unresolved discussions.


components/script/task_source/user_interaction.rs, line 19 [r2] (raw file):
Not sure if DOMManipulationTaskSource should be changed as well...


components/script/task_source/user_interaction.rs, line 20 [r2] (raw file):
Yes, every task here is still being routed to the script_thread main loop queue right now, we don't have separate event loops for each task sources yet.


Comments from Reviewable

@KiChjang KiChjang force-pushed the KiChjang:user-interaction-task branch 2 times, most recently from 4cadfb5 to 15c98a4 Apr 26, 2016
@KiChjang
Copy link
Member Author

KiChjang commented Apr 26, 2016

Review status: 1 of 8 files reviewed at latest revision, 13 unresolved discussions.


components/script/dom/htmltextareaelement.rs, line 374 [r2] (raw file):
Not too sure what to do about this... @jdm any thoughts in improving this? This channel is only used for creating a new Trusted struct, so I'm thinking maybe that we allow it to accept a TaskSource as well?


components/script/task_source/user_interaction.rs, line 30 [r2] (raw file):
Should I change the definitions in DOMManipulationTask as well?


Comments from Reviewable

@jdm
Copy link
Member

jdm commented Apr 26, 2016

Review status: 1 of 8 files reviewed at latest revision, 13 unresolved discussions.


components/script/dom/htmltextareaelement.rs, line 374 [r2] (raw file):
This is the state of the art for obtaining a Box<ScriptChan + Send> from the window's main thread sender. Our choices are to 1) add a new API to Window that does this for us (like GlobalRef::script_chan), 2) obtain a GlobalRef value and use GlobalRef::script_chan, 3) modify Trusted::new to use the global of the passed object and do this internally so that callers don't have to.


Comments from Reviewable

@bors-servo
Copy link
Contributor

bors-servo commented Apr 27, 2016

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

@bors-servo
Copy link
Contributor

bors-servo commented May 11, 2016

📌 Commit 9617ca5 has been approved by Ms2ger

bors-servo added a commit that referenced this pull request May 11, 2016
Implement user interaction task source

Part of #7959.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10714)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented May 11, 2016

Testing commit 9617ca5 with merge 2b6cc6f...

@bors-servo
Copy link
Contributor

bors-servo commented May 11, 2016

💔 Test failed - mac-rel-wpt

@highfive
Copy link

highfive commented May 11, 2016

  ▶ TIMEOUT [expected OK] /html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange.html

  ▶ Unexpected subtest result in /html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange.html:
  │ TIMEOUT [expected PASS] input setSelectionRange fires a select event
  └   → Test timed out

  ▶ Unexpected subtest result in /html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange.html:
  │ TIMEOUT [expected PASS] textarea setSelectionRange fires a select event
  └   → Test timed out
@KiChjang
Copy link
Member Author

KiChjang commented May 11, 2016

This is not reassuring, since it looks as if the select event was never fired, causing the tests to time out.

@KiChjang KiChjang force-pushed the KiChjang:user-interaction-task branch from 9617ca5 to f7d5de9 May 12, 2016
@highfive
Copy link

highfive commented May 12, 2016

New code was committed to pull request.

@KiChjang KiChjang force-pushed the KiChjang:user-interaction-task branch from f7d5de9 to a1a2b30 May 12, 2016
@highfive
Copy link

highfive commented May 12, 2016

New code was committed to pull request.

@KiChjang KiChjang force-pushed the KiChjang:user-interaction-task branch from a1a2b30 to f60de52 May 12, 2016
@highfive
Copy link

highfive commented May 12, 2016

New code was committed to pull request.

@KiChjang
Copy link
Member Author

KiChjang commented May 12, 2016

@bors-servo r=Ms2ger

@bors-servo
Copy link
Contributor

bors-servo commented May 12, 2016

📌 Commit f60de52 has been approved by Ms2ger

@bors-servo
Copy link
Contributor

bors-servo commented May 12, 2016

Testing commit f60de52 with merge 4214187...

bors-servo added a commit that referenced this pull request May 12, 2016
Implement user interaction task source

Part of #7959.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10714)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented May 12, 2016

@bors-servo bors-servo merged commit f60de52 into servo:master May 12, 2016
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@KiChjang KiChjang deleted the KiChjang:user-interaction-task branch Oct 19, 2017
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.

None yet

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