Images flicker when served by Rails to Chrome or Safari
In performing some cross-browser testing, I noticed that my images flicker when the page is refreshed - but just with Chrome/Safari - not with Firefox or IE. A white area is displayed, then the image is displayed.
I had some identical markup provided by the designer that didn't show this problem. Finally, I narrowed it down to Rails itself. When Rails serves the page, it flickers (in Chrome/Safari). When the same markup is just opened in the browser from the local file system, it doesn't flicker.
Eventually, I decided to see if other Rails sites had this problem开发者_StackOverflow - and they do! basecamphq.com flickers on refresh with Chrome, but doesn't (or at least, it does much less) with Firefox.
Is this a known problem with WebKit? Is there a solution or workaround to this problem?
My experience is that large images that are resized via the html width/height attribute tend to flicker in certain browsers. The solution - have the image resized via ImageMagick or similar before serving
精彩评论