Skip navigation

iOS like "rubber band" scrolling in Lion - Safari

20504 Views 132 Replies Latest reply: Mar 6, 2014 9:09 AM by Alex Zavatone RSS
  • Alex Zavatone Level 1 Level 1 (0 points)
    Currently Being Moderated
    Jul 2, 2012 8:59 AM (in response to Király)

    OK Király, maybe you can help out on this then.

     

    Based on a post I made a while ago:

     

    Here is the header info for webKit

     

    Here's the area in the WebKit code where this unholy poison lies:

     

    ScrollableArea.h

     

    lines 212 and 213:

     

        unsigned m_verticalScrollElasticity : 2; // ScrollElasticity,

         unsigned m_horizontalScrollElasticity : 2; // ScrollElasticity

     

    There are also enums (settings or definitions) for ScrollElasticityAutomatic and ScrollElasticityAllowed.

     

    Where these exist in the code can be changed to ScrollElasticityNone and the app rebuilt.  OR, we can find out how to write this to a defaults or Safari preference pList.

     

    In ScrollAnimatorMac.mm, there is a section that responds to ScrollElasticityAutomatic and this can be pulled and simply replaced with return false;

     

    There also is a ScrollElasticityController.h file and it is referenced from ScrollAnimatorMac.mm.  In it is #if ENABLE(RUBBER_BANDING) which handles how to respond to that lameness.

     

    AHA.  This leads me to platform.h (there are more than one of these) which defines ENABLE_RUBBER_BANDING as 1

     

    There might be a few areas in Safari where we need to turn this off and redefining RUBBER_BANDING to 0 might need to happen too.

     

    From the trunk of the webkit source, here is the path to the Mac specific files:

    webkit (trunk)/Source/WebCore/platform/mac

     

    The following files have the term "rubber_banding" in them:

    ScrollElasticityController.h

    ScrollElasticityController.mm

    ScrollbarThemeMac.mm

    ScrollAnimatorMac.h

    ScrollAnimatorMac.mm

    ScrollbarThemeMac.h

     

    These files hare the term "rubberband" in them:

    ScrollAnimatorMac.h

    ScrollAnimatorMac.mm

    ScrollElasticityController.mm

    ScrollElasticityController.h

     

    The following tiles have the term "elastic" in them:

    ScrollElasticityController.h

    ScrollElasticityController.mm

    ScrollAnimatorMac.h

    ScrollAnimatorMac.mm

     

    This gets me thinking.  Are we trying to set in the wrong place?  Should we be trying to turn off elasticity/rubberbanding in WebKit, instead of Safari??

     

    OK.  In ScrollElasticityController.h is this:

    #if ENABLE(RUBBER_BANDING)

     

    This is the evil.  It must be defined somewhere else and if we redefine it to NO, or 0, this should (hopefully) do it.

     

    Inside the AboutDataEnableFeatures.in file are a whole lot of items - including RUBBER_BANDING.

     

    Inside features.gypi is this:

        # We have to nest variables inside variables so that they can be overridden

        # through GYP_DEFINES.

    ...

          ['OS=="mac"', {

            'feature_defines': [

              'ENABLE_RUBBER_BANDING=1',

              '***_USE_SKIA_ON_MAC_CHROMIUM=<(use_skia)',

            ],

     

     

    Try that.  Try setting

    ENABLE_RUBBER_BANDING = 0

    RUBBER_BANDING = 0

     

    For Safari and if it's possible to set it for WebKit or for everything,

     

    defaults write -g ENABLE_RUBBER_BANDING -boolean false

    defaults write -g RUBBER_BANDING -boolean false

    defaults write -g ENABLE_RUBBER_BANDING -boolean false

    defaults write -g RUBBER_BANDING -boolean false

     

     

    My fingers are crossed.

  • Alex Zavatone Level 1 Level 1 (0 points)
    Currently Being Moderated
    Jul 2, 2012 1:22 PM (in response to Király)

    Bad news.  I just tested Safari and Chrome and they both have the stupid rubber banding turned on. 

     

    Firefox currently doesn't, but this certainly harshes my mellow.

  • Alex Zavatone Level 1 Level 1 (0 points)
    Currently Being Moderated
    Jul 2, 2012 2:04 PM (in response to Király)

    FYI, this is a result of a poorly implemented featureset in WebKit.

     

    It's bug 101916.

     

    Please see my write up at the bottom of the page. 

     

    http://code.google.com/p/chromium/issues/detail?id=101916

  • Betagozu Calculating status...

    Anyway, for working toward progress, and succeding (with the sorry exception of Safari ) you have my grateful thanks.

     

    Cheers.

  • rexeveryhting Calculating status...
    Currently Being Moderated
    Feb 28, 2013 4:39 AM (in response to Betagozu)

    You guys talk funny.

    I'm not anywhere near your understanding of all this stuff, except when I'm trying to type in TextEdit on my macbookair running 10.6.8, whatever animal that is, the page creeps all over, bouncing unexplainably, and this is the closest thread I could find to the problem.

     

    Are you talking about texedit's bouncy behavior?

    While typing in an rtfd new file, as I'm on the first line, the page starts creeping down until it's the very bottom line. When I get to the end of the line and it wraps, the page jumps up to about 5 or 6 lines and each few letters I type on the new line cause it to creep back down so it's the bottom line, until I get to the end of the next line, where I get a 5-6-line jump again, and then the creep again. This has to be one of the most annoying things ever, and makes me want to go get a different text editor. I use TextWrangler, but I've become used to TextEdit for quick things, and for a few specific things, but now I'm not loving it anymore.

     

    Am I in the right conversation here? If not, can you direct me to the right place? Or just put your hand inside my mac and make it better again?

     

    This behavior isn't anything I've seen anywhere else except TextEdit.

     

    Thanks, and I didn't mean the opening line as an insult; with all due respect, I just swam through a bunch of talk that was going over my head, but some of it seemed like what I was experiencing; and it's as close as I care to get before giving up and never using TextEdit again.
    And no, I can't afford to upgrade right now.

    Thanks,

    Mitch

  • Lloeki Calculating status...

    Has anyone managed to disable the iOS like "rubber band" scrolling in the Lion version of Safari

    Yes. I built an extension.

  • Alex Zavatone Level 1 Level 1 (0 points)
    Currently Being Moderated
    Feb 27, 2014 4:47 PM (in response to Lloeki)

    You are a wonderful person.

     

    Could you please share how you went about this?

     

    There are many more useless (and distracting) animations I really really really want to disable in Safari and the Mac OS.

     

    If you know how to stop the stupid roll down and rollup of content whenever we click a disclosure triangle, I'd love to know how to do this.

  • Fofer Level 1 Level 1 (115 points)
    Currently Being Moderated
    Feb 27, 2014 5:07 PM (in response to Lloeki)

    Oh wow.  OH WOW.

     

    I have been monitoring this thread for YEARS.  Disappointed, heartbroken yet curious.  Folks confused what we're even referring to, suggesting the wrong settings and unrelated fixes.  All the while I'd scroll, and suffer this horrible, unnecessary "elastic" UI.  Would this issue ever get solved?  Will we ever be able to turn off this horrible rubber-band animation?   Potential solutions have come and gone, and none of them worked.  Until now. 

     

    UNELASTIC, the Safari extension, is here!  And it works!

     

    OUR LONG NATIONAL NIGHTMARE IS OVER!

     

    THANK YOU Lloeki!  My hat's off to you.

  • Király Level 6 Level 6 (9,470 points)
    Currently Being Moderated
    Feb 27, 2014 6:32 PM (in response to Lloeki)

    You are incredible, Lloeki! You don't know how many people you have made happy.

     

    How did you figure out how to do it?

  • Ronald P. Regensburg Calculating status...
    Currently Being Moderated
    Feb 28, 2014 12:29 AM (in response to Lloeki)

    What a relief ! Thank you !

     

    Works fine here in Safari 6.1.2 in OSX 10.8.5.

  • Lloeki Level 1 Level 1 (0 points)

    Folks, be sure to update to 1.1.0 manually: 1.0 does not have automatic updates (but that's fixed starting 1.1.0).

     

    Be sure to file issues on Github should you encounter bugs or incompatible sites (I found a few already and have fixes in progress)

  • Alex Zavatone Level 1 Level 1 (0 points)
    Currently Being Moderated
    Mar 5, 2014 12:06 PM (in response to Lloeki)

    Just tried the extension under Mac OS 10.8.5 and Safari 6.0.5.

     

    I'm using the Magic Mouse and scrolling with the middle scroll area on the mouse.  Flicking up to the top of a pace (extensions.apple.com) still bounces the content when it reaches the end.

     

    So, here's the deal.  Any pages that you open from a previous session will not have the bouncing disabled, but newly loaded pages will have the bounce disabled.

     

    It's a little detail, but nice to know if you install the extension restart Safari, reload your previous session and still see pages bouncing.

     

    Still, it's a shame that we have to disable the bounce through CSS, and can't set up an NSUserDefaults to never ever bounce a web view, scrollView, or whatever on the Mac.

     

    Thanks Lloeki!

  • Alex Zavatone Level 1 Level 1 (0 points)
    Currently Being Moderated
    Mar 6, 2014 9:09 AM (in response to Lloeki)

    Jesus, this is the best thing ever.

     

    No little annoying bounce when scrolling on my work machine in Safari.

1 ... 5 6 7 8 9 Previous Next

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.