Navigation Menu

Skip to content

Commit

Permalink
[e] (0) Explain why browsers shouldn't give up and should block scrip…
Browse files Browse the repository at this point in the history
…ts on style sheets even though they don't have to.

git-svn-id: http://svn.whatwg.org/webapps@6582 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 23, 2011
1 parent 22d0fa1 commit 2cfb7e2
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
13 changes: 13 additions & 0 deletions complete.html
Expand Up @@ -15147,6 +15147,19 @@ <h4 id=styling><span class=secno>4.2.7 </span><dfn title="styling processing mod
and the user agent hasn't given up on that particular style sheet
yet. A user agent may give up on a style sheet at any time.</p>

<p class=note>Giving up on a style sheet before the style sheet
loads, if the style sheet eventually does still load, means that the
script might end up operating with incorrect information. For
example, if a style sheet sets the color of an element to green, but
a script that inspects the resulting style is executed before the
sheet is loaded, the script will find that the element is black (or
whatever the default color is), and might thus make poor choices
(e.g. deciding to use black as the color elsewhere on the page,
instead of green). Implementors have to balance the likelihood of a
script using incorrect information with the performance impact of
doing nothing while waiting for a slow network request to
finish.</p>

<p>A <code><a href=#document>Document</a></code> <dfn id=has-a-style-sheet-that-is-blocking-scripts>has a style sheet that is blocking
scripts</dfn> if there is either <a href=#a-style-sheet-that-is-blocking-scripts>a style sheet that is
blocking scripts</a> in the context of that
Expand Down
13 changes: 13 additions & 0 deletions index
Expand Up @@ -15011,6 +15011,19 @@ c-end = "--&gt;"</pre>
and the user agent hasn't given up on that particular style sheet
yet. A user agent may give up on a style sheet at any time.</p>

<p class=note>Giving up on a style sheet before the style sheet
loads, if the style sheet eventually does still load, means that the
script might end up operating with incorrect information. For
example, if a style sheet sets the color of an element to green, but
a script that inspects the resulting style is executed before the
sheet is loaded, the script will find that the element is black (or
whatever the default color is), and might thus make poor choices
(e.g. deciding to use black as the color elsewhere on the page,
instead of green). Implementors have to balance the likelihood of a
script using incorrect information with the performance impact of
doing nothing while waiting for a slow network request to
finish.</p>

<p>A <code><a href=#document>Document</a></code> <dfn id=has-a-style-sheet-that-is-blocking-scripts>has a style sheet that is blocking
scripts</dfn> if there is either <a href=#a-style-sheet-that-is-blocking-scripts>a style sheet that is
blocking scripts</a> in the context of that
Expand Down
13 changes: 13 additions & 0 deletions source
Expand Up @@ -16043,6 +16043,19 @@ c-end = "-->"</pre>
and the user agent hasn't given up on that particular style sheet
yet. A user agent may give up on a style sheet at any time.</p>

<p class="note">Giving up on a style sheet before the style sheet
loads, if the style sheet eventually does still load, means that the
script might end up operating with incorrect information. For
example, if a style sheet sets the color of an element to green, but
a script that inspects the resulting style is executed before the
sheet is loaded, the script will find that the element is black (or
whatever the default color is), and might thus make poor choices
(e.g. deciding to use black as the color elsewhere on the page,
instead of green). Implementors have to balance the likelihood of a
script using incorrect information with the performance impact of
doing nothing while waiting for a slow network request to
finish.</p>

<p>A <code>Document</code> <dfn>has a style sheet that is blocking
scripts</dfn> if there is either <span>a style sheet that is
blocking scripts</span> in the context of that
Expand Down

0 comments on commit 2cfb7e2

Please sign in to comment.