Merged
Conversation
a4a1e01 to
b6d695b
Compare
Signed-off-by: sagudev <[email protected]>
Member
Author
|
I think it's enough baking for first round. |
Member
|
Reviewing now :) |
delan
previously requested changes
Jun 25, 2025
Member
|
Thanks for writing this new chapter, it’s very useful! For new content I think it makes sense to edit and polish before landing, so I’ve done some copyediting. Let me know if I’ve made any mistakes, since script and canvas are not my areas of expertise. |
Co-authored-by: shuppy <[email protected]> Signed-off-by: sagudev <[email protected]>
Signed-off-by: sagudev <[email protected]>
jdm
reviewed
Jun 25, 2025
Co-authored-by: Josh Matthews <[email protected]> Signed-off-by: sagudev <[email protected]>
Signed-off-by: sagudev <[email protected]>
Signed-off-by: sagudev <[email protected]>
sagudev
commented
Jun 25, 2025
src/architecture/canvas.md
Outdated
Comment on lines
+52
to
+59
| As part of HTML event loop, script thread runs a task (parsing, script evaluating, callbacks, events, ...) and after that it [performs a microtask checkpoint](https://html.spec.whatwg.org/multipage/#perform-a-microtask-checkpoint) that drains microtasks queue. | ||
| In [window event loop](https://html.spec.whatwg.org/multipage/webappapis.html#event-loop-processing-model:window-event-loop-3) we queue a global task to [updates the rendering](https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering) if there is an [rendering opportunity](https://html.spec.whatwg.org/multipage/webappapis.html#rendering-opportunity) (usually driven by compositor based on hardware refresh rate). | ||
| In servo we do not actually queue a task, but instead we [run updates the rendering on any IPC messages in the ScriptThread](https://github.com/servo/servo/blob/d970584332a3761009f672f975bfffa917513b85/components/script/script_thread.rs#L1418) and [then perform a microtask checkpoint to as event loop would done after a task is completed](https://github.com/servo/servo/blob/d970584332a3761009f672f975bfffa917513b85/components/script/script_thread.rs#L1371). | ||
| [Updates the rendering](https://github.com/servo/servo/blob/d970584332a3761009f672f975bfffa917513b85/components/script/script_thread.rs#L1201) does various resize, scroll and animations steps (which also includes performing a microtask checkpoint; to resolve promises) and then [run the animation frame callbacks](https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#run-the-animation-frame-callbacks) (callbacks added with [`requestAnimationFrame`](https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame)). | ||
| Here draw commands are issued to painters to create new frame of animation. | ||
| Then we update the rendering of those that do not require a reflow (animated images and WebGPU). | ||
| Finally we triggers reflow (layout), which takes the DOM and its styles, builds a `DisplayList`, and sends that to WebRender for rendering. | ||
| Dirty WebGL and 2D canvases are flushed as part of a reflow. |
Member
Author
There was a problem hiding this comment.
@gterzian could you check if my understanding is correct.
Also driving force of rendering opportunities is not just compositor (via any script msg), but also script itself, at least for now.
Signed-off-by: sagudev <[email protected]>
807ba53 to
dc25c23
Compare
Signed-off-by: sagudev <[email protected]>
Signed-off-by: sagudev <[email protected]>
jdm
approved these changes
Sep 5, 2025
Signed-off-by: Josh Matthews <[email protected]>
Signed-off-by: Josh Matthews <[email protected]>
Signed-off-by: Josh Matthews <[email protected]>
Signed-off-by: Josh Matthews <[email protected]>
Signed-off-by: Josh Matthews <[email protected]>
Signed-off-by: Josh Matthews <[email protected]>
Signed-off-by: Josh Matthews <[email protected]>
Signed-off-by: Josh Matthews <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.