[Webkit-unassigned] [Bug 52790] REGRESSION (r75555): Safari Reader does not scroll far enough in response to page down and other scrolling actions

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 20 09:34:58 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=52790





--- Comment #2 from Mihai Parparita <mihaip at chromium.org>  2011-01-20 09:34:58 PST ---
This only happens when smooth scrolling is enabled. It looks like Reader tries to do its own smooth scrolling in that case. I've uploaded a copy of Reader's JavaScript (visible in the inspector when pausing JS execution) at http://persistent.info/webkit/test-cases/webkit-52790/reader.js (hope that's OK).

In the smoothScroll function, at line 437, there's a ReaderJSController.useSmoothScrolling() check (presumably ReaderJSController is an object exposed by Safari that queries the smooth scrolling system preference), and we abort if it's not enabled.

Later, at line 447 there's an animation handler that gets invoked periodically, to simulate the smooth scroll:
        scrollEventIsSmoothScroll = true;
        element.scrollTop = current;
        scrollEventIsSmoothScroll = false;

Meanwhile, the page has this scroll event handler:

function articleScrolled() {
    updateFindInPageMarkers();
    if (!scrollEventIsSmoothScroll && smoothScrollingAnimator) abortSmoothScroll();
    updateArticlePaddingAndShadows();
}

However, because the scroll event is now async, by the time articleScrolled runs, scrollEventIsSmoothScroll has been set back to false, so we abort the smooth scroll

For better or worse, this is as expected. The assumption was that since scroll is mostly async in other browsers (https://bugs.webkit.org/show_bug.cgi?id=45631#c8), this would not lead to any compatibility issues.

A workaround would be to wrap scrollEventIsSmoothScroll = false; in a setTimeout 0 call. Due to clamping of setTimeout values, it should always execute after the scroll handler.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list