Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement HTML5 task sources #7959
Comments
|
https://html.spec.whatwg.org/multipage/webappapis.html#generic-task-sources |
|
Sounds interesting, I'm taking a look into this. |
|
This would be super valuable! |
|
I recommend we start by defining methods on Window/ScriptTask/GlobalRef for specific task sources (DOM, network, user input, etc.) and making them return the existing script channel, then finding callers of |
|
Yes, that sounds like a good first PR with a lot of elbow-grease. After that, I was thinking that we may want to create new message enums (similar to the style for the constellation) for each individual task source. Does that sound good to you? |
|
Yep! |
Split fn script_chan into 5 different task channel fn Partial #7959. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8853) <!-- Reviewable:end -->
Split fn script_chan into 5 different task channel fn Partial #7959. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8853) <!-- Reviewable:end -->
Split script_chan into 5 different task source channels This is **not** complete. I really need feedback right away since I felt that the direction I'm heading is very wrong. Partial #7959. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8871) <!-- Reviewable:end -->
Add 5 different task source channels This is **not** complete. I really need feedback right away since I felt that the direction I'm heading is very wrong. Partial #7959. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8871) <!-- Reviewable:end -->
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 -->
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 -->
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 -->
Implement file reading task source Implement the task source API for the File Reader task source, enabling using task sources from non-main threads. --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix (partially) #7959 (github issue number if applicable). - [X] These changes do not require tests because they're refactoring existing code <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12448) <!-- Reviewable:end -->
|
I think this is essentially done except for HistoryTraversalTaskSource (which is still currently a stub using the ScriptChan trait) which is tracked in #10994 and other various small task sources littered around the spec. |
Currently there's a generic script event loop sender for all non-specialized script events (ie. those that do not come from devtools, constellation, etc.) Like #503 we should add additional senders for each task source the spec defines and provide convenient APIs to allow people implementing DOM specs to do the right thing.
Note that this will likely be more complex than the generic select mechanism we currently use in the script event loop, due to ordering concerns about queued events in multiple task sources.