Skip to content

Commit f8bdfa2

Browse files
authored
Copyediting/proofreading (#128)
1 parent a8c59ab commit f8bdfa2

13 files changed

+23
-23
lines changed

src/architecture/canvas.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ flowchart TB
5353

5454
As part of the HTML event loop, the 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 the microtasks queue.
5555
In the [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 [update the rendering](https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering) if there is a [rendering opportunity](https://html.spec.whatwg.org/multipage/webappapis.html#rendering-opportunity) (usually driven by compositor based on hardware refresh rate).
56-
In Servo we do not actually queue a task, but instead we [run `update the rendering` after 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 too](https://github.com/servo/servo/blob/d970584332a3761009f672f975bfffa917513b85/components/script/script_thread.rs#L1371) as the event loop would have done after a task is completed.
56+
In Servo, we do not actually queue a task, but instead we [run `update the rendering` after 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 too](https://github.com/servo/servo/blob/d970584332a3761009f672f975bfffa917513b85/components/script/script_thread.rs#L1371) as the event loop would have done after a task is completed.
5757
[Update 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 outstanding 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)).
5858
At this point draw commands are issued to painters to create a new frame of animation.
59-
Finally we trigger reflow (layout), which first updates the rendering of canvases (by flushing dirty canvases) and animated images, then traverses the DOM and its styles, builds a `DisplayList`, and sends that to WebRender for rendering.
59+
Finally, we trigger reflow (layout), which first updates the rendering of canvases (by flushing dirty canvases) and animated images, then traverses the DOM and its styles, builds a `DisplayList`, and sends that to WebRender for rendering.
6060

6161
When canvas context creation is requested (`canvas.getContext('2d')`), the script thread blocks on the painter thread as it initializes and creates a new WebRender image (`CreateImage`), finally sending the associated `ImageKey` back to script.
6262

src/architecture/concurrency-and-parallelism.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ Here are some ways that we take advantage of both:
3434
Decoding multiple images in parallel is straightforward.
3535
* _Decoding of other resources_.
3636
This is probably less important than image decoding, but anything that needs to be loaded by a page can be done in parallel, e.g. parsing entire style sheets or decoding videos.
37-
* _GC JS concurrent with layout_ - Under most any design with concurrent JS and layout, JS is going to be waiting to query layout sometimes, perhaps often.
37+
* _GC JS concurrent with layout_ - Under almost any design with concurrent JS and layout, JS is going to be waiting to query layout sometimes, perhaps often.
3838
This will be the most opportune time to run the GC.
3939

4040
For information on the design of WebXR see the [in-tree documentation](./webxr.md).
4141

4242
## Challenges
4343

4444
* _Parallel-hostile libraries_.
45-
Some third-party libraries we need don't play well in multi-threaded environments.
45+
Some third-party libraries we need don't play well in multithreaded environments.
4646
Fonts in particular have been difficult.
4747
Even if libraries are technically thread-safe, often thread safety is achieved through a library-wide mutex lock, harming our opportunities for parallelism.
4848
* _Too many threads_.

src/architecture/further-reading.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
## References
66

7-
Important research and accumulated knowledge about browser implementation, parallel layout, etc:
7+
Important research and accumulated knowledge about browser implementation, parallel layout, etc.:
88

99
* [How Browsers Work](http://ehsan.github.io/how-browsers-work/#1) - basic explanation of the common design of modern web browsers by long-time Gecko engineer Ehsan Akhgari
1010
* [More how browsers work](http://taligarsiel.com/Projects/howbrowserswork1.htm) article that is dated, but has many more details
1111
* [Webkit overview](https://web.archive.org/web/20150804185551/https://www.webkit.org/coding/technical-articles.html)
1212
* [Fast and parallel web page layout (2010)](https://lmeyerov.github.io/projects/pbrowser/pubfiles/paper.pdf) - Leo Meyerovich's influential parallel selectors, layout, and fonts.
13-
It advocates seperating parallel selectors from parallel cascade to improve memory usage.
13+
It advocates separating parallel selectors from parallel cascade to improve memory usage.
1414
See also the [2013 paper for automating layout](https://lmeyerov.github.io/projects/pbrowser/pubfiles/synthesizer2012.pdf) and the [2009 paper that touches on speculative lexing/parsing](http://lmeyerov.github.io/projects/pbrowser/hotpar09/paper.pdf).
1515
* [Servo layout on mozilla wiki](https://wiki.mozilla.org/Servo/StyleUpdateOnDOMChange)
1616
* [Robert O'Callahan's mega-presentation](http://robert.ocallahan.org/2012/04/korea.html) - Lots of information about browsers

src/architecture/microtasks.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# Microtasks
44

55
According the HTML spec, a microtask is: "a colloquial way of referring to a task that was created via the queue a microtask algorithm"([source](https://html.spec.whatwg.org/multipage/#microtask-queue)).
6-
Each [event-loop](https://html.spec.whatwg.org/multipage/webappapis.html#event-loop)--meaning window, worker, or worklet--has it's own microtask queue.
7-
The tasks queued on it are run as part of the [perform a microtask checkpoint](https://html.spec.whatwg.org/multipage/#perform-a-microtask-checkpoint) algorithm, which is called into from various places, the main one being [after running a task](https://html.spec.whatwg.org/multipage/#event-loop-processing-model:perform-a-microtask-checkpoint) from an task queue that isn't the microtask queue, and each call to this algorithm drains the microtask queue--running all tasks that have been enqueued up to that point([without re-entrancy](https://html.spec.whatwg.org/multipage/#performing-a-microtask-checkpoint)).
6+
Each [event-loop](https://html.spec.whatwg.org/multipage/webappapis.html#event-loop)--meaning window, worker, or worklet--has its own microtask queue.
7+
The tasks queued on it are run as part of the [perform a microtask checkpoint](https://html.spec.whatwg.org/multipage/#perform-a-microtask-checkpoint) algorithm, which is called into from various places, the main one being [after running a task](https://html.spec.whatwg.org/multipage/#event-loop-processing-model:perform-a-microtask-checkpoint) from a task queue that isn't the microtask queue, and each call to this algorithm drains the microtask queue--running all tasks that have been enqueued up to that point([without re-entrancy](https://html.spec.whatwg.org/multipage/#performing-a-microtask-checkpoint)).
88

99
## The microtask queue in Servo
1010

@@ -18,7 +18,7 @@ Dedicated workers [use a child runtime](https://github.com/servo/servo/blob/4357
1818
A task can be enqueued on the microtask queue from both Rust, and from the JS engine.
1919

2020
- From JS: the JS engine will call into [`enqueue_promise_job`](https://github.com/servo/servo/blob/7eac599aa1d6bcf8858c51d90763373f0dd5f289/components/script/script_runtime.rs#L196) whenever it needs to queue a microtask to call into promise handlers.
21-
This callback mechanism is setup [once per runtime](https://github.com/servo/servo/blob/7eac599aa1d6bcf8858c51d90763373f0dd5f289/components/script/script_runtime.rs#L520).
21+
This callback mechanism is set up [once per runtime](https://github.com/servo/servo/blob/7eac599aa1d6bcf8858c51d90763373f0dd5f289/components/script/script_runtime.rs#L520).
2222
This means that resolving a promise, either [from Rust](https://github.com/servo/servo/blob/7eac599aa1d6bcf8858c51d90763373f0dd5f289/components/script/dom/promise.rs#L173) or from JS, will result in this callback being called into, and a microtask being enqueued.
2323
Strictly speaking, the microtask is [still enqueued from Rust](https://github.com/servo/servo/blob/7eac599aa1d6bcf8858c51d90763373f0dd5f289/components/script/script_runtime.rs#L222).
2424
- From Rust, there are various places from which microtask are explicitly enqueued by "native" Rust:

src/architecture/web_api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
- Add an appropriate member to the struct(s) added at 4.
2222
- If this requires defining other structs or enums, these should derive `JSTraceable` and `MallocSizeOf`([example](https://github.com/servo/servo/pull/34844/commits/7d73370b0c41a1b00f4b25b7e1b8bf9b67430708#diff-2e7f6e100fdbd73318de2dda9b3d3883700be9ebfd028d4412a207e93cb02892R53)).
2323
- All `JSTraceable` structs added above that contain members that must be rooted because they are either [JS values](https://github.com/servo/mozjs/blob/87cabf4e9ddf9fafe19713a3d6bc8c5e6105544c/mozjs/src/gc/collections.rs#L94) or [DOM objects](https://github.com/servo/servo/blob/9887ad369d65eb362db21c778ae5f00aad74db6c/components/script/dom/bindings/root.rs#L5) should be marked with `#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]`. [Example](https://github.com/gterzian/servo/blob/b7688fe916d105ae9023cd2429068f16ecba3574/components/script/dom/readablestreamdefaultcontroller.rs#L120), where the lint is needed due to the presence of a `JSVal`.
24-
- If such a struct is assigned to a variable, `impl js::gc::Rootable` for the and use `rooted!` to root the variable([example](https://github.com/servo/servo/pull/34844/commits/94867eec21e06d59c5479bdaa92ef422bc7b21f9)).
24+
- If such a struct is assigned to a variable, `impl js::gc::Rootable` for the struct and use `rooted!` to root the variable([example](https://github.com/servo/servo/pull/34844/commits/94867eec21e06d59c5479bdaa92ef422bc7b21f9)).
2525
- All of this can be changed later, so simply use your best judgement at this stage.
2626
- Add methods for [construction](https://github.com/servo/servo/blob/4a5ff01e060293721d10289ec56dbd4c58a0969e/components/script/dom/mod.rs#L91)(not to be confused with a `Constructor` that is part of the Web API).
2727
- [Example result](https://github.com/servo/servo/pull/34844/commits/7d73370b0c41a1b00f4b25b7e1b8bf9b67430708).
2828

2929
### Part 2: Writing a First Draft
30-
1. For each methods of the bindings trait referred to at 3 in Part 1:
30+
1. For each method of the bindings trait referred to at 3 in Part 1:
3131
- In general, follow the structure of the spec: if a method calls into another named algorithm, implement that named algorithm as a separate private method of your struct, that the trait methods calls into. If you later realize this private method can be used from other structs, make it `pub(crate)`.
3232
- For each algorithm step in the spec:
3333
- Copy the line from the spec.

src/contributing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This is to prevent duplicated efforts from contributors on the same issue.
1616
Sending the message "@servo-highfive assign me" will assign the issue to you.
1717

1818
Head over to [Servo Starters](https://starters.servo.org/) to find good tasks to start with.
19-
If you find any unfamiliar words or jargon, please check the [the glossary](old/glossary.md) first.
19+
If you find any unfamiliar words or jargon, please check [the glossary](old/glossary.md) first.
2020
If there's no matching entry, please make a pull request to add one with the content `TODO` so we can correct that!
2121

2222
See [Hacking on Servo](hacking/mach.md) for more information on how to start working on Servo.
@@ -35,7 +35,7 @@ Contributions should adhere to the [style guide](style-guide.md).
3535
- Commits should be accompanied by a [Developer Certificate of Origin](http://developercertificate.org) sign-off, which indicates that you (and your employer if applicable) agree to be bound by the terms of the [project license](https://github.com/servo/servo/blob/main/LICENSE).
3636
In git, this is the `-s` option to `git commit`.
3737

38-
- If your patch is not getting reviewed or you need a specific person to review it, you can @-reply a reviewer asking for a review in the pull request or a comment, or you can ask for a review in [the Servo chat](https://servo.zulipchat.com/).
38+
- If your patch is not getting reviewed, or you need a specific person to review it, you can @-reply a reviewer asking for a review in the pull request or a comment, or you can ask for a review in [the Servo chat](https://servo.zulipchat.com/).
3939

4040
- Add tests relevant to the fixed bug or new feature.
4141
For a DOM change this will usually be a web platform test; for layout, a reftest.

src/hacking/building-and-running-on-wsl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ To run non-headless servo shell on WSL, you will most likely need to be on Windo
77
Servo can be built on WSL as if you are building on any other Linux distribution.
88

99
1. Setup WSL v2. See [Microsoft's guidelines for setting up GUI apps in WSL](https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps).
10-
2. Setup the environment depending on the WSL distribution that you are using (e.g. Ubuntu, OpenSuse, etc)
10+
2. Set up the environment depending on the WSL distribution that you are using (e.g. Ubuntu, OpenSuse, etc.)
1111
3. Build
1212

1313
## Running

src/hacking/building-for-android.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ANDROID_NDK_ROOT="/path/to/ndk"
2626
PATH=$PATH:$ANDROID_SDK/platform-tools
2727
```
2828

29-
NOTE: If you are using Nix, you don't need to install the tools or setup the ANDROID_* environment variables manually.
29+
NOTE: If you are using Nix, you don't need to install the tools or set up the ANDROID_* environment variables manually.
3030
Simply enable the Android build support running:
3131
```
3232
export SERVO_ANDROID_BUILD=1
@@ -160,7 +160,7 @@ You will be able to catch your breakpoints during execution.
160160

161161
## x86 build
162162

163-
To build a x86 version, follow the above instructions, but replace `--android` with `--target=i686-linux-android`.
163+
To build an x86 version, follow the above instructions, but replace `--android` with `--target=i686-linux-android`.
164164
The x86 emulator will need to support GLES v3 (use AVS from Android Studio v3+).
165165

166166
## WebVR support

src/hacking/building-for-openharmony.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The minimum version of SDK that Servo currently supports is v5.0.2 (API-14).
1919
#### Downloading via DevEco Studio
2020

2121
[DevEco Studio] is an IDE for developing applications for HarmonyOS NEXT and OpenHarmony.
22-
It supports Windows and MacOS.
22+
It supports Windows and macOS.
2323
You can manage installed OpenHarmony SDKs by clicking File->Settings and selecting "OpenHarmony SDK".
2424
After setting a suitable installation path, you can select the components you want to install for each available API version.
2525
DevEco Studio will automatically download and install the components for you.
@@ -80,7 +80,7 @@ care to install the hvigor version matching the requirements of your project.
8080
For HarmonyOS NEXT Node 18 is shipped. Ensure that the `node` binary is in PATH.
8181
2. Install Java using the recommended installation method for your OS.
8282
The build steps are known to work with OpenJDK v17, v21 and v23.
83-
On MacOS, if you install Homebrew's [OpenJDK formula], the following additional command may need to be run after the installation:
83+
On macOS, if you install Homebrew's [OpenJDK formula], the following additional command may need to be run after the installation:
8484
```
8585
# For the system Java wrappers to find this JDK, symlink it with
8686
sudo ln -sfn $HOMEBREW_PREFIX/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk

src/hacking/debugging-on-openharmony.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Whether log statements are visible depends on multiple conditions:
5050
2. The runtime `log` global filter per module filters set in servoshell. Since environment variables aren't an
5151
option to customize the log level, `servoshell` has the `--log-filter` option on ohos targets, which allows
5252
customizing the log filter of the `log` crate.
53-
By default servoshell sets a log filter which hides log statements from many crates, so you likely will need to
53+
By default, servoshell sets a log filter which hides log statements from many crates, so you likely will need to
5454
set a custom log-filter if you aren't seeing the logs from the crate you are debugging.
5555
3. The `hilog` base log filter. `hdc shell hilog --base-level=<log_level>`. Can be combined with `--domain` and `--tag`
5656
options to customize **which logs are saved**.

0 commit comments

Comments
 (0)