Skip to content

Redesign ScriptMsg to be more specific to DOMManipulationTaskSource - #9217

Merged
bors-servo merged 1 commit into
servo:masterfrom
KiChjang:dom-manipulation-msg
Mar 10, 2016
Merged

bors-servo merged 1 commit into
servo:masterfrom
KiChjang:dom-manipulation-msg

Conversation

@KiChjang

@KiChjang KiChjang commented Jan 9, 2016

Copy link
Copy Markdown
Contributor

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
KiChjang force-pushed the dom-manipulation-msg branch from ff54a69 to 9bb1a2e Compare January 9, 2016 11:31
@KiChjang

KiChjang commented Jan 9, 2016

Copy link
Copy Markdown
Contributor Author

r? @jdm

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.

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

@jdm

jdm commented Jan 9, 2016

Copy link
Copy Markdown
Member

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

jdm commented Jan 9, 2016

Copy link
Copy Markdown
Member

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

KiChjang commented Jan 9, 2016

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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
Copy Markdown
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 force-pushed the dom-manipulation-msg branch from 1c62bab to 3a3d012 Compare January 12, 2016 00:23
@KiChjang KiChjang removed the S-needs-rebase There are merge conflict errors. label Jan 12, 2016
@bors-servo

Copy link
Copy Markdown
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
@KiChjang
KiChjang force-pushed the dom-manipulation-msg branch from 0323f1a to 2f3c96b Compare February 22, 2016 12:43
@jdm jdm removed the S-needs-rebase There are merge conflict errors. label Feb 22, 2016
@jdm

jdm commented Feb 25, 2016

Copy link
Copy Markdown
Member

As an extension of my earlier request about the runnables, I think we can do better. While reading through these changes, I wasn't thrilled by all of the data definitions and business logic moving into dom_manipulation.rs, because it separates the places that actually implement parts of the specification from each other. I propose the variants of DOMManipulationTaskMsg be simple wrappers around inner types that are defined in the original modules, so all dom_manipulation.rs is in charge of doing is collecting variants and invoking variant-specific processing code that it doesn't need to know anything about. It's like what you've done for StorageNotificationRunnable & co. but I don't believe any traits are necessary.

@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 Feb 25, 2016
@KiChjang

Copy link
Copy Markdown
Contributor Author

Just to be sure, DocumentLoadsComplete and PlannedNavigation should follow the format of SendStorageNotification, and the FireSimpleEvent can stay as-is, correct? I don't see much value of having event firing being implemented in different Runnables in different DOM files.

@jdm

jdm commented Feb 25, 2016

Copy link
Copy Markdown
Member

Yes, for common actions like firing a simple event we can stick with general ones like that.

@KiChjang
KiChjang force-pushed the dom-manipulation-msg branch from 2f3c96b to d7711d9 Compare February 27, 2016 04:20
@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 Feb 27, 2016
@KiChjang

Copy link
Copy Markdown
Contributor Author

Haven't addressed DocumentProgressHandler yet.

@KiChjang
KiChjang force-pushed the dom-manipulation-msg branch 2 times, most recently from d321db2 to 5dad80b Compare February 27, 2016 14:14
@KiChjang

Copy link
Copy Markdown
Contributor Author

As soon as it passes Travis CI, I believe this is ready to be reviewed.

@KiChjang
KiChjang force-pushed the dom-manipulation-msg branch from 5dad80b to 599c9cc Compare February 27, 2016 14:37
@jdm

jdm commented Mar 2, 2016

Copy link
Copy Markdown
Member

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


Reviewed 1 of 15 files at r1, 16 of 17 files at r2.
Review status: all files reviewed at latest revision, 5 unresolved discussions.


components/script/dom/worker.rs, line 149 [r2] (raw file):
https://html.spec.whatwg.org/multipage/#handler-worker-onmessage


components/script/dom/bindings/global.rs, line 149 [r2] (raw file):
This will break any code that creates a Worker and calls postMessage, given the earlier changes.


components/script/task_source/dom_manipulation.rs, line 56 [r2] (raw file):
I don't think any of the .r() lines are necessary.


components/script/task_source/dom_manipulation.rs, line 68 [r2] (raw file):
I know it's small, but I'd really like FireToggleEvent to use a runnable as well to keep any special logic out of this file.


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 2, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

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

@jdm

jdm commented Mar 9, 2016

Copy link
Copy Markdown
Member

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

@KiChjang

Copy link
Copy Markdown
Contributor Author

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

Use DOMManipulationTaskSource whenever possible
@KiChjang

Copy link
Copy Markdown
Contributor Author

Comments addressed.

@jdm

jdm commented Mar 10, 2016

Copy link
Copy Markdown
Member

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

📌 Commit 3f2cbf0 has been approved by jdm

@bors-servo

Copy link
Copy Markdown
Contributor

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

@bors-servo

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

4 participants