chrome won't scroll to show wiki pages #147

Closed
WardCunningham opened this Issue Mar 2, 2012 · 10 comments

Comments

Projects
None yet
2 participants
Owner

WardCunningham commented Mar 2, 2012

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.

Collaborator

nrn commented Mar 2, 2012

Hmm. Is the active class still changing properly?

Owner

WardCunningham commented Mar 2, 2012

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.

Owner

WardCunningham commented Mar 2, 2012

Yes, active class changes properly in all cases.

Collaborator

nrn commented Mar 2, 2012

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

Owner

WardCunningham commented Mar 2, 2012

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

Owner

WardCunningham commented Mar 2, 2012

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.

Collaborator

nrn commented Mar 2, 2012

Aargh. Glad you found it though.

@WardCunningham WardCunningham added a commit that referenced this issue Mar 3, 2012

@WardCunningham 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
Owner

WardCunningham commented Mar 3, 2012

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']);}
Collaborator

nrn commented Mar 4, 2012

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

Owner

WardCunningham commented Mar 4, 2012

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