[Webkit-unassigned] [Bug 5991] scrollLeft/Top on the root element should scroll the document

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 19 05:59:49 PDT 2014


Diego Perini <diego.perini at gmail.com> changed:

           What    |Removed                     |Added
                 CC|                            |diego.perini at gmail.com

--- Comment #11 from Diego Perini <diego.perini at gmail.com>  2014-09-19 05:59:48 PST ---

The following code may be useful to find out which is the element in charge of scrolling the viewport:

function getScrollingElement() {
  var d = document;
  return  d.documentElement.scrollHeight > d.body.scrollHeight &&
          d.compatMode.indexOf('CSS1') == 0 ?
          d.documentElement :

it must be invoked before performing the actual scroll operation instead of during onload or DOMContentLoaded since the content may change later. See here for a cross browser example using the above code:


This code will work when the bug will be fixed as explained in W3C CSSOM View specifications.

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