Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

chrome won't scroll to show wiki pages #147

Closed
WardCunningham opened this Issue · 10 comments

2 participants

@WardCunningham

I'm having trouble making this repeatable. When chrome stops scrolling there is no way to see pages added after the last visible page. Sometimes it will scroll properly but when it stops no amount of reloading will get it going again.

A suspicious symptom is that minX in scrollTo is null. I have not seen this problem in Firefox or Safari. When I just tried Safari I found that minX was 0 as expected.

I was suspicious of the caching of scrollContainer. I disabled this so that findScrollContainer runs every time. No improvement.

Chrome says its up-to-date at version 17.0.963.56 on OSX 10.6.8.

@nrn
Collaborator
nrn commented

Hmm. Is the active class still changing properly?

@WardCunningham

More hints:

Safari (Version 5.1.2) works as expected.

Firefox (Version 10.0.2) ends up where expected but doesn't scroll smoothly when moving with browser forward/back controls.

@WardCunningham

Yes, active class changes properly in all cases.

@nrn
Collaborator
nrn commented

Took a shot at this on my system, but I can't find what would break it in that way.

@WardCunningham

Ok. I'll set a trap for minX going null and see if I can correlate it with anything I do.

@WardCunningham

Found it. Chrome will sometimes report scrollLeft() of 0 after a scrollLeft(1)

This must depend on display scale factor and how numbers might round.

Work around is to probe with a scrollLeft(2) in findScrollContainer.

I'll put together a commit.

@nrn
Collaborator
nrn commented

Aargh. Glad you found it though.

@WardCunningham WardCunningham referenced this issue from a commit
@WardCunningham Issue #147 use larger value to detect proper scrollContainer
Experiments have shown that at the smallest scale
chrome requires a scrollLeft of at least 4 in order
to report a non-zero value of scrollLeft.
76c1314
@WardCunningham

Chrome requires a scrollLeft probe of at least 4 to be detected at the smallest scale. Try it yourself with this in Chrome's console.

for(i=1; i<=10; i++){console.log([i, j=$("body").scrollLeft(i).scrollLeft(), j?'':'trouble']);}
@nrn
Collaborator
nrn commented

That is really odd. None of the versions of chrome/chromium I have access to on linux/windows has that problem.

@WardCunningham

I don't doubt that the problem is in how the particular browser chooses to interact with the particular window system and ultimately how that gets represented back to javascript through the dom. There are a lot of moving parts here. No surprise that there are issues. I'm glad we have a variety of platforms between us. (I'm wondering how we can write an integration test for this. Doesn't sound easy.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.