hari-akp / browserscope

Automatically exported from code.google.com/p/browserscope
0 stars 0 forks source link

Inline script after stylesheet test (in network) shows non blocking even though browsers block #313

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. Run the test at 
http://www.browserscope.org/network/tests/inline-script-after-stylesheet?t=13179
25224 in Chrome or Firefox
2. You'd see that your browser does not block
3. Run the test in the attached file or at 
http://ssh.weissyoav.com/tests/blocking.html and you'd see that it blocks
4. Browserscope's test does not block because there's a <p> tag before the 
stylesheet link
5. Removing the <p> tag will resolve this issue
6. More details on http://blog.yoav.ws/2011/10/Unblocking-blocking-stylesheets

I'm using Chrome 12 over Ubuntu 11.04.

Original issue reported on code.google.com by yoav.wei...@gmail.com on 6 Oct 2011 at 10:08

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by els...@gmail.com on 11 Oct 2011 at 2:51

GoogleCodeExporter commented 9 years ago
The change is not related to the P tag. Instead, the results vary depending on 
whether the LINK and SCRIPT are in the HEAD or the BODY.

In the original test the LINK and SCRIPT are in the BODY.
In your new test they're in the HEAD. This causes blocking.
Here's your exact test code with the LINK and SCRIPT back in the BODY (but no P 
tag) - note that it doesn't block: http://stevesouders.com/tests/blocking.php

Since it's possible to put the LINK and SCRIPT in the BODY to avoid blocking, I 
wrote the test this way. 

Original comment by stevesou...@gmail.com on 12 Oct 2011 at 4:04

GoogleCodeExporter commented 9 years ago
Since it is recommended that CSS LINK will be in the document head (to avoid 
reflows 
http://code.google.com/speed/page-speed/docs/rendering.html#PutCSSInHead ), it 
might be better to address the "LINK & SCRIPT in head" scenario, perhaps in a 
different test.
I now understand that all that the P tag does is create the body sooner, so if 
the LINK & SCRIPT are already in the BODY it has no effect.
Still, from current BrowserScope results, I was under the impression that LINK 
& SCRIPT no longer block even in HEAD in all modern browsers, and was surprised 
to discover that this is not the case. I think it should be addressed, either 
by adding a comment to this test, or by adding another test.

Original comment by yoav.wei...@gmail.com on 12 Oct 2011 at 6:59