18

I'm quite amazed that Safari is the only browser in OS X that manages to get (nearly) perfect inertial scrolling.

  • Even with lots of flash content on a website, Safari's scrolling is smooth.
  • There are websites with lots of content to load and Safari will continue to scroll smoothly while the content is being loaded and rendered.
  • Installing several extensions does not have an effect on the scrolling performance.

The major competitors to the Safari browser on OS X are Chrome and Firefox. Both don't manage to deliver the same smooth scrolling like one is used to in Safari:

  • Enabling flags like GPU compositing on all pages in Google Chrome (chrome://flags) or ...
  • smooth scrolling in Firefox (Options > Advanced) don't deliver the scrolling performance that Safari delivers per default.

Question

Is Safari using private API to deliver smooth scrolling that the Chrome/Firefox developers's can't access? How come Safari's scrolling is so much better and competitors don't manage to deliver non-broken scrolling.

I'm wondering especially about Chrome because it usually adapts to new OS X features really fast.

15
  • 1
    I disagree. Firefox's scrolling is far superior to Safari's (I am on 10.7.4 on a mid-2011 Macbook Air): It is almost always smooth 60Hz while Safari always "snags" a little bit. I tend to still use Safari though because of the nice zooming and "cover" effect when two-finger-swiping sideways to go back or forward.
    – Steven Lu
    Jul 1, 2012 at 23:06
  • 2
    Dammit. Ever since you pointed it out I'm noticing Firefox tearing a lot more now. It does it all over the place. Text (like on this site) flicker and shudder as they move inconsistently across consecutive frames.
    – Steven Lu
    Jul 2, 2012 at 6:18
  • 2
    At any rate, Safari on Lion, combined with Apple's touch input devices (touchpad/magic mouse) probably the most user friendly and nicest rendering web experience available anywhere. It correctly applies vsync and so no animations tear, and I can't get enough of the tight pinch-zoom and scroll-left-to-go-back features. Sometimes scrolling hiccups slightly, but I think we would need access to internal tools to be able to profile what is causing those issues. If I ever get a job at Apple I'd want to work on this.
    – Steven Lu
    Jul 2, 2012 at 6:44
  • 1
    Wow, loads of comments. I'm adding another, as it's speculation, not an answer... Ignoring the fact that Safari is available on Windows (Why not, everyone else does..), I think it's a simple matter of Safari being written for the Mac, and the rest of the browsers necessarily sharing, to some extent, codebase with multiple platforms, making it hard to get it perfect on each one.
    – stuffe
    Jul 10, 2012 at 17:37
  • 1
    It's hard to imagine that Safari would not use private APIs: such APIs exist for no other reason than to provide features to Apple's software. But that's just conjecture, and I don't see any other way to actually answer this question...
    – Dan J
    Jul 15, 2012 at 3:13

1 Answer 1

6

The difference is likely to do with the architecture and interprocess communication choices of each browser.

Modern web browsers render pages in separate processes. Apple has a framework called IOSurface that provides a streamlined way for one process to pass an image to another process. This framework was introduced in Mac OS X 10.6, aka Snow Leopard, for the latest iteration of QuickTime.

QuickTime uses IOSurface to offload movie decoding to separate processes. With no decoding to do, the QuickTime Player application is left dealing solely with the user interface and showing images provided by the decoding processes.

I suspect Safari has learned from QuickTime and is using the same techniques. Web pages are offloaded to other processes, rendered, and passed back.

Could Chrome and Firefox do the same thing, absolutely. The challenge is ensuring the thread dealing with the user responds quickly and is not delayed waiting for the rendering to update.

Chrome does use separate processes and appears to use IOSurface on the Mac; this bug talks about improving Chrome's use of IOSurface.

IOSurface is a public framework available to any Mac OS X 10.6+ application. However there is little documentation and it is Mac specific.

This is all conjecture.

4
  • 1
    Chrome does use separate processes to render content, fwiw. Jul 19, 2012 at 14:57
  • 1
    Thank you for your answer! It's sad that there's so little resonance to this question so far. But I can understand this if one cannot refer to primary sources.
    – gentmatt
    Jul 24, 2012 at 13:15
  • @gentmatt how do you find the scrolling experience on browsers that use WebKit? This may help separate out impact of the browser's rendering engine from the surrounding browser interface implementation. I believe OmniWeb uses WebKit. Jul 24, 2012 at 15:36
  • @GrahamMiln Chrome uses Webkit as well. But Chrome's scrolling is quite far from perfect, IMO. It really depends on the content of the website. Generally, the performance is not so well.
    – gentmatt
    Jul 24, 2012 at 15:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .