Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

A video is worth a thousand words: [20mb .ogv file]

This occurs on Firefox 5, usually after a few messages were posted in my absence. I'm using autoscroll here, but any form of scrolling would result in the chat attempting bravely to stick to the bottom. Hugely annoying, canihazfixplz?

Related chat discussion:

share|improve this question
is this specific to Firefox 5? Does it happen in Firefox 4 or 3.6.x? – Jeff Atwood Jun 29 '11 at 12:11
Can't repro on Firefox 5 or Chrome stable. – Sathya Jun 29 '11 at 12:19
I suddenly started getting this in Chrome Beta this week. – Ben Brocka Jan 19 '12 at 22:31
@BenBrocka: Can you try again? I have just pushed a possible fix for this. – balpha Jan 23 '12 at 12:59
@balpha nope, still happens. Latest Beta chrome version. I didn't notice it happening on my home computer, I'll test and see if I can repro it there too. – Ben Brocka Jan 23 '12 at 15:40
@balpha possibly related, I'm seeing this line above the dropdown arrow in posts, no one else sees it. I only see it in chrome – Ben Brocka Jan 23 '12 at 16:26
Wouldn't a video be worth 1000 words * # of frames? – Grant Thomas Jan 24 '12 at 12:01
status completed? I'm still getting this network wide... – Ben Brocka Jan 26 '12 at 15:22
@BenBrocka, what extensions do you have installed in Chome? I am seeing this too, and I am wondering if it is related to some extension doing something evil? – Zoredache Feb 1 '12 at 19:05
@BenBrocka, btw, I wonder if we should re-ask the chrome problem as a separate question. I suspect the actual chrome problem is different from the firefox issue. – Zoredache Feb 1 '12 at 19:19
@Zoredache Spingpad, AdBlock, Obvious Interest and PAge Speed. Curiously I haven't noticed the problem this week. Do you have any HTML inspection stuff? I had Pendule and an HTML validatior installed but disabled them, don't know if that affected it or not – Ben Brocka Feb 1 '12 at 19:28
up vote 4 down vote accepted

This should be fixed now. Ben Brocka comments that something similar recently started happening in Chrome Beta and still happens, but I assume that's something else.

I've never been able to reproduce the issue you describe, but I was finally able to (more or less consistently) create a similar thing (I sometimes would need to turn the scrollwheel two or three times for that chat to move; it'd bounce back the first time). I assume that's the same issue, just that for some reason it comes out more annoying for you.

So what was happening? The chat tries to be smart about the question whether you want to always have the chat scroll to the bottom (e.g. because you want to see new messages come in) or not (e.g. because you're reading back).

When chat thinks you want to be "always on bottom", and notices that you are not (maybe because a new chat message just came in, or the window was resized, etc.), it'll scroll down. If you already are on the bottom, there's nothing to do.

The question "Are we already on the bottom?" is (or so I thought) easily answered:

notOnBottom = $("body").height() - $(window).scrollTop() - $(window).height() > 0

– if what's visible in the window plus what's hidden above is less then the full document, there must be something below; in other words, we're not on the bottom yet.

So when I had a situation where trying to scroll would bounce back, I scrolled all the way to the bottom and looked at the values.

>>> $("body").height()
>>> $(window).scrollTop()
>>> $(window).height()

With those values, the difference above is 1, and thus notOnBottom is true. No matter how hard I tried to scroll further down, I couldn't get that value to 0. And the chat did the same thing: It tried and tried and tried to scroll, because it never got all the way to the bottom. And that's what sometimes got in the way of your attempt to scroll up.

Here's what turns out to be the reason for this mismatch:

>>> document.body.clientHeight // this is what $("body").height() boils down to
>>> getComputedStyle(document.body).height

– the document's height, in pixels, is not an integer. I don't know the exact rounding behavior Firefox employs here, but essentially this means that you always have 0.7 pixels of document below the window bottom, since you can only scroll by full pixels.

share|improve this answer
That extra 0.7 pixel is space allocated for the Unicorns, by the Unicorns, and of the Unicorns, to secure a free and just chatroom where Unicorns may prance according to their own will and pleasure. – Adam Davis Jan 24 '12 at 8:00
I am still seeing this in chrome. Want to setup some kind of screen sharing session so you can see the problem? – Zoredache Feb 1 '12 at 18:36
@Zoredache: If you can reproduce in released Chrome version without any extensions installed, please post a new report; I'm very certain that it's a different issue. Beta or dev releases aren't supported. – balpha Feb 1 '12 at 19:27
@Zoredache will let you record the issue and easily share it. FWIW I haven't noticed this this week... – Ben Brocka Feb 1 '12 at 19:30
@Zoredache I recall the solution now! I wasn't at Zoom:0. Try hitting ctrl + 0. That caused a visual bug with the arrows and it borks the scrolling. Which it really probably shouldn't... – Ben Brocka Feb 1 '12 at 21:30

You must log in to answer this question.

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