[Webkit-unassigned] [Bug 52988] REGRESSION (r75555): Safari RSS sidebar jiggles when scrolling

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 16 13:19:31 PST 2011


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





--- Comment #22 from Mihai Parparita <mihaip at chromium.org>  2011-02-16 13:19:30 PST ---
As far as how to solve this regression with Safari RSS's sidebar, using requestAnimationFrame (http://webstuff.nfshost.com/anim-timing/Overview.html) may be an option. That way you can invoke the custom sidebar sizing/moving logic before painting. In your scroll event handler you'd just set a flag indicating that scrolling is happening, and start requesting callbacks before paintaing (this does mean that the first frame after scrolling starts will not have the new logic, but I doubt that's observable).

Something like:

var isScrolling = false;
var isScrollingTimeout = 0;

// scroller is the div with ID apple-rss-scroller, which currently has slipDiffScroll as its scroll event listener

scroller.onscroll = function() {
  if (!isScrolling) {
    isScrolling = true;
    window.requestAnimationFrame(slipDiffScroll, scroller);
  }

  if (isScrollingTimeout) {
    window.clearTimeout(isScrollingTimeout);
  }

  // Keep updating for some time after the scroll event was received, in the case of smooth scrolling and other scenarios where we don't fire a scroll event for every frame
  isScrollingTimeout = window.setTimeout(function() {
    isScrolling = false;
  }, 100);
};


function slipDiffScroll() {
  // Current implementation of slipDiffScroll

  if (isScrolling) {
    window.requestAnimationFrame(slipDiffScroll, scroller);
  }
}

-- 
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