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

Pat Garner
Reported 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.
Attachments
test html file (127 bytes, text/plain)
2009-03-05 12:34 PST, Pat Garner
no flags
first test css file (22 bytes, text/plain)
2009-03-05 12:35 PST, Pat Garner
no flags
second test css file (134 bytes, text/plain)
2009-03-05 12:35 PST, Pat Garner
no flags
Patch (5.95 KB, patch)
2009-09-25 15:13 PDT, Dave Hyatt
no flags
Pat Garner
Comment 1 2009-03-05 12:34:52 PST
Created attachment 28318 [details] test html file
Pat Garner
Comment 2 2009-03-05 12:35:24 PST
Created attachment 28319 [details] first test css file
Pat Garner
Comment 3 2009-03-05 12:35:44 PST
Created attachment 28320 [details] second test css file
Adam Roben (:aroben)
Comment 4 2009-09-08 12:45:37 PDT
Adam Roben (:aroben)
Comment 5 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".
Dave Hyatt
Comment 6 2009-09-25 15:13:44 PDT
Anders Carlsson
Comment 7 2009-09-25 15:20:12 PDT
Comment on attachment 40148 [details] Patch r=me
Dave Hyatt
Comment 8 2009-09-25 15:25:28 PDT
Fixed in r48773.
Dave Hyatt
Comment 9 2010-06-21 12:43:44 PDT
Pat says this actually regressed by the time we shipped Safari 5, so it's broken again. :(
Eric Seidel (no email)
Comment 10 2010-09-02 13:55:55 PDT
Comment on attachment 40148 [details] Patch Clearing Anders' review since this was landed.
Note You need to log in before you can comment on or make changes to this bug.