Skip to content

Implement user interaction task source - #10714

Merged
bors-servo merged 4 commits into
servo:masterfrom
KiChjang:user-interaction-task
May 12, 2016
Merged

bors-servo merged 4 commits into
servo:masterfrom
KiChjang:user-interaction-task

Conversation

@KiChjang

Copy link
Copy Markdown
Contributor

Part of #7959.


This change is Reviewable

@highfive

Copy link
Copy Markdown

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
Copy Markdown

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 19, 2016
/// `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> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this function.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@Ms2ger Ms2ger added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Apr 22, 2016
@KiChjang
KiChjang force-pushed the user-interaction-task branch from ae394d8 to 0ade487 Compare April 25, 2016 04:35
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Apr 25, 2016
@KiChjang
KiChjang force-pushed the user-interaction-task branch from 0ade487 to 51e7a38 Compare April 25, 2016 05:58
@KiChjang

Copy link
Copy Markdown
Contributor Author

User interaction task source removed from global.rs.

@Ms2ger

Ms2ger commented Apr 25, 2016

Copy link
Copy Markdown
Contributor

-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

@Ms2ger Ms2ger added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Apr 25, 2016
@KiChjang
KiChjang force-pushed the user-interaction-task branch from 51e7a38 to 7557132 Compare April 25, 2016 23:49
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Apr 25, 2016
@KiChjang
KiChjang force-pushed the user-interaction-task branch 4 times, most recently from 8a69f00 to 6ba0ff4 Compare April 26, 2016 00:11
@KiChjang

Copy link
Copy Markdown
Contributor Author

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 user-interaction-task branch 2 times, most recently from 4cadfb5 to 15c98a4 Compare April 26, 2016 00:39
@KiChjang

Copy link
Copy Markdown
Contributor Author

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

jdm commented Apr 26, 2016

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor

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

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 9617ca5 has been approved by Ms2ger

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels May 11, 2016
bors-servo pushed a commit that referenced this pull request May 11, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 9617ca5 with merge 2b6cc6f...

@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - mac-rel-wpt

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels May 11, 2016
@highfive

Copy link
Copy Markdown
  ▶ 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
Copy Markdown
Contributor Author

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 user-interaction-task branch from 9617ca5 to f7d5de9 Compare May 12, 2016 01:15
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label May 12, 2016
@highfive

Copy link
Copy Markdown

New code was committed to pull request.

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label May 12, 2016
@KiChjang
KiChjang force-pushed the user-interaction-task branch from f7d5de9 to a1a2b30 Compare May 12, 2016 14:41
@highfive

Copy link
Copy Markdown

New code was committed to pull request.

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

Copy link
Copy Markdown

New code was committed to pull request.

@KiChjang

Copy link
Copy Markdown
Contributor Author

@bors-servo r=Ms2ger

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit f60de52 has been approved by Ms2ger

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels May 12, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit f60de52 with merge 4214187...

bors-servo pushed a commit that referenced this pull request May 12, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows

@bors-servo
bors-servo merged commit f60de52 into servo:master May 12, 2016
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label May 12, 2016
@KiChjang
KiChjang deleted the user-interaction-task branch October 19, 2017 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants