[Webkit-unassigned] [Bug 45228] window.scrollBy() scrolls incorrectly when zoomed in/out

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 12 19:02:52 PDT 2011


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


Martin Bouladour <martin.bouladour at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |martin.bouladour at gmail.com




--- Comment #1 from Martin Bouladour <martin.bouladour at gmail.com>  2011-04-12 19:02:52 PST ---
I confirm David Chambers' report: window.scrollBy() doesn't respect the scaling factor when zoomed in/out (full zoom, not text-only zoom).

Example code:

  var former_offset = document.body.scrollTop
  window.scrollBy(0, 300)
  if (former_offset + 300 != document.body.scrollTop) {
    // Bad. This is the case when zoomed in/out.
  }

However, the behaviour of window.scrollTo() is fine. Thus it can be used as a workaround:

  window.scrollTo(0, 300 + document.body.scrollTop)

This is equivalent to the right behaviour of:

  window.scrollBy(0, 300)


Tested in webkit r83584

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