[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


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


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 :
          d.body;
}

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:

https://dl.dropboxusercontent.com/u/598365/scrollTo/scrollTo.html

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