This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
spec:async-algos [2014/05/28 12:24] – [Making Author-Observable Changes to Page State] tabatkins | spec:async-algos [2014/05/28 12:26] – [Making Author-Observable Changes to Page State] tabatkins | ||
---|---|---|---|
Line 25: | Line 25: | ||
> | > | ||
> 6. Otherwise, font face now represents the loaded font; fulfill font face’s %%[[FontStatusPromise]] with font face and set font face’s status attribute to " | > 6. Otherwise, font face now represents the loaded font; fulfill font face’s %%[[FontStatusPromise]] with font face and set font face’s status attribute to " | ||
+ | |||
+ | **Important Note: The above code is slightly broken for simplicity. | ||
Note how Step 3 is clearly the last synchronous step. If possible, use that exact wording: " | Note how Step 3 is clearly the last synchronous step. If possible, use that exact wording: " | ||
Line 52: | Line 54: | ||
> 5. Once the attempt to load either completes with either success or failure, await a stable state, then synchronously execute the following steps: | > 5. Once the attempt to load either completes with either success or failure, await a stable state, then synchronously execute the following steps: | ||
> | > | ||
- | > a. If the attempt to load failed, set font face's status attribute to " | + | > 5a. If the attempt to load failed, set font face's status attribute to " |
- | > b. Otherwise, set font face's status attribute to " | + | > |
+ | > 5b. Otherwise, set font face's status attribute to " | ||
The "await a stable state" language ensures that author code has reached a point where other code can run, and that nothing else is in the queue to be run. This ensures that, for example, the promise' | The "await a stable state" language ensures that author code has reached a point where other code can run, and that nothing else is in the queue to be run. This ensures that, for example, the promise' |