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

Redesign ScriptMsg to be more specific to DOMManipulationTaskSource #9217

Merged
merged 1 commit into from Mar 10, 2016

Conversation

KiChjang
Copy link
Contributor

@KiChjang KiChjang commented Jan 9, 2016

This is a large-ish PR that contains the following:

  • A new directory is created under components/script/ called task_source, which houses all the stuff for different task sources. Note that the ones that I have now aren't exhaustive - there are more task sources than just the generic ones.
  • A DOMManipulationTaskMsg which eliminates some usage of Runnables to fire events. Instead, they send event information to the DOMManipulationTaskSource and lets the ScriptTask handle all the event firing.
  • Re-added fn script_chan, since I can't think of any other way to give Trusted values an appropriate sender.
  • Rewrote step 7 of the end to make use of the DOMManipulationTaskSource

Partial #7959

Review on Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jan 9, 2016
@KiChjang
Copy link
Contributor Author

KiChjang commented Jan 9, 2016

r? @jdm

pub fn dom_manipulation_task_source(&self) -> Box<TaskSource<DOMManipulationTaskMsg> + Send> {
match *self {
GlobalRef::Window(ref window) => window.dom_manipulation_task_source(),
GlobalRef::Worker(_) => unimplemented!(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is unimplemented because I have no idea how the Worker handles script channels.

@jdm
Copy link
Member

jdm commented Jan 9, 2016

In my own rebased PRs I've been using the MainThreadScriptChan(window.main_thread_script_chan().clone()).clone() for the target of Trusted operations.

@jdm
Copy link
Member

jdm commented Jan 9, 2016

My main objection with these changes as they stand is that the DocumentLoadsComplete and SendStorageNotification messages are now divorced from the related code, and the implementation of document loading is already complex. It may be worth reinstating the runnable concept for the DOM manipulation task source in order to accommodate this.

@KiChjang KiChjang force-pushed the dom-manipulation-msg branch 6 times, most recently from 4759e53 to 2c4055e Compare January 9, 2016 19:06
@KiChjang
Copy link
Contributor Author

KiChjang commented Jan 9, 2016

Re-added the Runnable stuff, but with a twist. I dislike the fact that we are making a generic RunnableMsg for all different kinds of tasks, so instead I have created new messages that better reflect what the purpose of each Runnable is.

@bors-servo
Copy link
Contributor

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

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Jan 10, 2016
@KiChjang KiChjang force-pushed the dom-manipulation-msg branch 2 times, most recently from 0596b11 to 67d0b5d Compare January 10, 2016 16:03
@KiChjang KiChjang removed the S-needs-rebase There are merge conflict errors. label Jan 10, 2016
@KiChjang KiChjang force-pushed the dom-manipulation-msg branch 4 times, most recently from 86c871f to 1c62bab Compare January 10, 2016 19:17
@bors-servo
Copy link
Contributor

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

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Jan 11, 2016
@KiChjang KiChjang removed the S-needs-rebase There are merge conflict errors. label Jan 12, 2016
@bors-servo
Copy link
Contributor

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

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Jan 12, 2016
@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 Mar 9, 2016
@KiChjang KiChjang 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. S-needs-rebase There are merge conflict errors. labels Mar 9, 2016
@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 Mar 9, 2016
@jdm
Copy link
Member

jdm commented Mar 9, 2016

Great work! There's only one issue that still needs to be addressed, as far as I can tell. I would expect several tests in tests/wpt/web-platform-tests/workers/ to start failing with the current changes.
-S-awaiting-review +S-needs-code-changes


Reviewed 4 of 4 files at r3, 3 of 3 files at r4.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


Comments from the review on Reviewable.io

@jdm jdm 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 Mar 9, 2016
@KiChjang
Copy link
Contributor Author

Yeah... I'll have to figure out a way to fix that last remaining issue.

@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 Mar 10, 2016
Use DOMManipulationTaskSource whenever possible
@KiChjang
Copy link
Contributor Author

Comments addressed.

@jdm
Copy link
Member

jdm commented Mar 10, 2016

@bors-servo: r+
Whee! This is a nice improvement to the status quo.


Reviewed 2 of 2 files at r5.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from the review on Reviewable.io

@bors-servo
Copy link
Contributor

📌 Commit 3f2cbf0 has been approved by jdm

@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 Mar 10, 2016
@bors-servo
Copy link
Contributor

⌛ Testing commit 3f2cbf0 with merge 740965e...

bors-servo pushed a commit that referenced this pull request Mar 10, 2016
Redesign ScriptMsg to be more specific to DOMManipulationTaskSource

This is a large-ish PR that contains the following:
* A new directory is created under `components/script/` called `task_source`, which houses all the stuff for different task sources. Note that the ones that I have now aren't exhaustive - there are more task sources than just the generic ones.
* A `DOMManipulationTaskMsg` which eliminates some usage of `Runnable`s to fire events. Instead, they send event information to the `DOMManipulationTaskSource` and lets the `ScriptTask` handle all the event firing.
* Re-added `fn script_chan`, since I can't think of any other way to give `Trusted` values an appropriate sender.
* Rewrote step 7 of [the end](https://html.spec.whatwg.org/multipage/syntax.html#the-end) to make use of the `DOMManipulationTaskSource`

Partial #7959

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9217)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, status-appveyor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants