Please sign in to comment.
Use unload+polling to trigger removal of old <link> [#198]
Previously we had a fixed 200ms delay before removing the old stylesheet on live CSS refresh. Problem is that Sprockets asset pipeline often takes more time to produce a CSS file, causing a flash of unstyled content for Rails developers. Most browsers have recently started to support onload event for CSS, so it makes sense to switch to that, plus polling every 50 ms. Tested in Safari, Chrome, Firefox and Opera. (Current stable Safari is the only major browser that uses polling; Safari 5.2 on 10.8 should support onload too.)
- Loading branch information...
Showing with 9,199 additions and 15 deletions.
Oops, something went wrong.