Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

iOS like "rubber band" scrolling in Lion - Safari

Has anyone managed to disable the iOS like "rubber band" scrolling in the Lion version of Safari ? For instance when you scroll all the way up or down, a blank space is created, like on iOS , and releasing the scroll rubber bands the content to the top (or bottom).

MacBook Pro, Mac OS X (10.7)

Posted on Jul 29, 2011 11:20 PM

Reply
127 replies

Jun 16, 2012 6:38 PM in response to Fofer

In most cases boolean "false" is interpreted as or translated to a 0, and "true" is interpreted as a 1 or non-zero value, so you can use them interchangeably by using a zero value to represent false and a non-zero value to represent true; however, as Alex mentioned this is only true if the varible's use supports it. In this case, the variable can take either, so it will work.

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.

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

iOS like "rubber band" scrolling in Lion - Safari

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.