Repository navigation
Conversation
e8d9ba6 to
6b53081
Compare
mukilan
left a comment
There was a problem hiding this comment.
There are some lint failures because of spec link formats being different. You can follow the suggestion in the lint and replace it with the one in the message.
Also there are some long spec comments in the code that need to be reformatted to span multiple lines.
9448a32 to
ffe3180
Compare
| // global object to perform the following steps: | ||
| // 6.4.5.1 If pendingTasks is not −1: | ||
| // 6.4.5.1.1 Set pendingTasks to pendingTasks − 1. | ||
| // 6.4.5.1.2 If pendingTasks is 0, then resolve promise. |
There was a problem hiding this comment.
It's part of this note above:
// NOTE: The specification for AddModule does not use the promise returned by "run a module script",
// therefore an exception thrown when executing a module will not be propagated.
// <https://html.spec.whatwg.org/multipage/#dom-worklet-addmodule
It feels unintuitive that addModule will resolve the promise even when there is a syntax error while loading a module.
I think I initially added the steps to serve as extra context to explain the behavior the specification expects. Although looking back at it, I think maybe mentioning the step number in the NOTE comment maybe sufficient.
Relevant issue: w3c/css-houdini-drafts#407
There was a problem hiding this comment.
@Taym95 I think the issue I referenced above was closed accidentally and the specification might change in the future. So it might be good to know what the spec said to justify the test in the future.
Are you okay with the steps?
ffe3180 to
91e5363
Compare
91e5363 to
e05bc6c
Compare
Signed-off-by: Niya <niyabits@disroot.org>
Signed-off-by: Niya <niyabits@disroot.org>
Signed-off-by: Niya <niyabits@disroot.org>
…k_manager Signed-off-by: Niya <niyabits@disroot.org>
Signed-off-by: Niya <niyabits@disroot.org>
Signed-off-by: Niya <niyabits@disroot.org>
Signed-off-by: Niya <niyabits@disroot.org>
Signed-off-by: Niya <niyabits@disroot.org>
Signed-off-by: Niya <niyabits@disroot.org>
Signed-off-by: Niya <niyabits@disroot.org>
Signed-off-by: Niya <niyabits@disroot.org>
Signed-off-by: Niya <niyabits@disroot.org>
Signed-off-by: Niya <niyabits@disroot.org>
e05bc6c to
eeba2ee
Compare
| // Step 6. Run the following steps in parallel: | ||
| // Step 6.1. If workletInstance's global scopes is empty: | ||
| // Step 6.1.1. Create a worklet global scope given workletInstance. | ||
| let global_scope = self.window.as_global_scope(); |
There was a problem hiding this comment.
The steps are still attached to this line, which makes them seem like they are related. You probably separate them by blank line and also add a note after the steps that they are implemented in those other functions. The comment block should probably include steps 6.1.2 and 6.1.3 below.
Signed-off-by: Niya <niyabits@disroot.org>
|
I have moved the steps let global_scope = self.window.as_global_scope();As I don't think there is a good reason to keep the steps after that line. I have added a note for the steps as well: // Step 5. Let workletInstance be this.
// Step 6. Run the following steps in parallel:
// Step 6.1. If workletInstance's global scopes is empty:
// Step 6.1.1. Create a worklet global scope given workletInstance.
// Step 6.1.2. Optionally, create additional global scope instances given workletInstance, depending on the specific worklet in question and its specification.
// Step 6.1.3. Wait for all steps of the creation process(es) — including those taking place within the worklet agents — to complete, before moving on.
// NOTE: Step 6 is implemented by WorkletThread's run method.
// Step 6.1, Step 6.1.1, and Step 6.1.3 are implemented in the `get_worklet_global_scope` method.
let global_scope = self.window.as_global_scope();I believe I do not need a longer explanation for the steps. edit: I have removed space between each individual step. |
9625f66 to
25c4583
Compare
Signed-off-by: Niya <niyabits@disroot.org>
25c4583 to
1ee5753
Compare
…c scripts (servo#46856) Fix the existing Worklet implementation by adding the necessary infrastructure for fetching modules (e.g., implementing task manager on Worklet) and using our implementation of `fetch a worklet/module worker script graph` instead of fetching classic scripts using `load_whole_resource`. Testing: Tests in `tests/wpt/mozilla/tests/mozilla/worklets` already cover the changes, some fixes were made to comply with the specs. Fixes: servo#45306 --------- Signed-off-by: Niya <niyabits@disroot.org>
Fix the existing Worklet implementation by adding the necessary infrastructure for fetching modules (e.g., implementing task manager on Worklet) and using our implementation of
fetch a worklet/module worker script graphinstead of fetching classic scripts usingload_whole_resource.Testing: Tests in
tests/wpt/mozilla/tests/mozilla/workletsalready cover the changes, some fixes were made to comply with the specs.Fixes: #45306