Bug 24399

Summary: Imported user style sheets fail to display
Product: WebKit Reporter: Pat Garner <pg>
Component: CSSAssignee: Dave Hyatt <hyatt>
Status: ASSIGNED ---    
Severity: Normal CC: aroben, hyatt, jberlin
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
test html file
none
first test css file
none
second test css file
none
Patch none

Description Pat Garner 2009-03-05 12:32:25 PST
If a user defined style sheet imports additional style sheets, the imported style sheets will only be displayed on first load.

To reproduce: (Please see the example attached html and css file)
1) Create a style sheet that does nothing but import another style sheet
2) Define a second style sheet imported by the first style sheet with some simple style definitions
3) In Safari, set your user style sheet to be the first style sheet which import  the second one
4) Quit and relaunch Safari
4) Create simple html page which will show the style definitions you added to the second style sheet
5) Load the simple html page in Safari - the styles will be show
6) Reload the page - the styles will vanish

Though this is not likely to often be a major issue for average users, the real problem is when a non-webbrowser based app is using WebKit and user defined style sheets to display content.  In some cases the content will be rendered completely blank after first being displayed.  The work around for this has been to override the cache policy to reload ignoring cache when loading content.  This was recently broken and still is in the version of WebKit shipping with Safari 4 beta.
Comment 1 Pat Garner 2009-03-05 12:34:52 PST
Created attachment 28318 [details]
test html file
Comment 2 Pat Garner 2009-03-05 12:35:24 PST
Created attachment 28319 [details]
first test css file
Comment 3 Pat Garner 2009-03-05 12:35:44 PST
Created attachment 28320 [details]
second test css file
Comment 4 Adam Roben (:aroben) 2009-09-08 12:45:37 PDT
<rdar://problem/7206000>
Comment 5 Adam Roben (:aroben) 2009-09-08 12:49:34 PDT
Hyatt thinks this is happening because "user stylesheets don't hold up the display of the document or prevent onload from firing, but they need to".
Comment 6 Dave Hyatt 2009-09-25 15:13:44 PDT
Created attachment 40148 [details]
Patch
Comment 7 Anders Carlsson 2009-09-25 15:20:12 PDT
Comment on attachment 40148 [details]
Patch

r=me
Comment 8 Dave Hyatt 2009-09-25 15:25:28 PDT
Fixed in r48773.
Comment 9 Dave Hyatt 2010-06-21 12:43:44 PDT
Pat says this actually regressed by the time we shipped Safari 5, so it's broken again. :(
Comment 10 Eric Seidel (no email) 2010-09-02 13:55:55 PDT
Comment on attachment 40148 [details]
Patch

Clearing Anders' review since this was landed.