[Webkit-unassigned] [Bug 88869] New: renderer should not block on script-inserted stylesheets

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 12 07:04:42 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=88869

           Summary: renderer should not block on script-inserted
                    stylesheets
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebCore Misc.
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: bmcquade at google.com
                CC: tonyg at chromium.org


The HTML5 spec, section 4.2.7, reads:

"A style sheet in the context of the Document of an HTML parser or XML parser is said to be a style sheet that is blocking scripts if the element was created by that Document's parser..."

I read this to mean that script-inserted sheets should not block the parser. Webkit seems to partially follow this, but there are cases where webkit could be more efficient.

For instance, if you look at the network waterfall for http://stevesouders.com/cuzillion/?c0=hc1dfff4_0_f&c1=hj1wfff0_0_f&c2=hb0hfff0_0_f&c3=hj1wfff2_0_f&t=1339507371 in a webkit browser:
http://www.webpagetest.org/result/120612_FQ_M0G/1/details/

You see that the first document-written script after the script-inserted stylesheet is not blocked on the parser, but the second one is. I get the impression that webkit is not immediately marking the sheet as renderer blocking (otherwise the inline script that does the doc-write of the first script would not execute until after the sheet is applied) however webkit does seem to block the second document.write on the sheet being applied, which is unnecessary.

By contrast, the same load in Firefox does not block either script on the sheet:
http://www.webpagetest.org/result/120612_9A_KS7/1/details/

This ends up causing a substantial renderer delay for sites like www.nytimes.com, which inserts a sheet via script which has a series of serialized @imported sheets that cause excess renderer delay due to the serialization of the sheet loads (see homepage.css, which @imports base.css, which @imports tooltip.css). There are other scripts that could be executed during the time these sheets are loading, but they end up getting blocked on each of these sheets getting downloaded serially and finally being applied.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list