Waiting for a stable state in HTML5 specs
There is a concept of waiting for a stable state in the HTML5 specs ( http://www.w3.org/TR/html5/single-page.html#await-a-stable-state ) Can anyone explain this with an example what is this does means?
source to share
An example of this is the asynchronous XMLHttpRequest . You can make a request like this:
var myRequest = new XMLHttpRequest();
...
At the time of the query, you can see the state myRequest
- in particular myRequest.readyState
. Until the request completes, the request is not in a stable state.
source to share
Basically, this is an internal thing to explain how some algorithms work. Some parts of these algorithms run synchronously, while others wait for a stable state before starting.
When the user agent enforces a stable state , if there are asynchronously executing algorithms waiting for a stable state , then the user agent should start the synchronous section and then resume the asynchronous algorithm execution (if necessary).
For example, images are waiting for a stable state:
When the user agent updates the
img
element image data , it should follow these steps:
- Return the item
img
to an unavailable state.- [...]
- Asynchronously waits for a stable state , allowing tasks that call this algorithm to continue. a synchronous section consists of all the other stages of this algorithm until the algorithm says that the synchronous section is over. (Steps to synchronous sections are marked
⌛
.)⌛
If, after this instance, another instance of this algorithm was started for this elementimg
(even if it was interrupted and did not have a longer run), then abort these steps.⌛
[...]- End the synchronous section , continuing the remaining steps asynchronously, but without any data from the fetch algorithm.
- Move to the first applicable entry from the following list as soon as possible: [...]
source to share