Status: Unconfirmed
Owner: ----
Labels: Pri-2 Via-Wizard Type-Compat OS-Mac
New issue 515257 by
itsbusti...@gmail.com: .scrollTo(0, 0) ignored unless
scrollY is read first
https://code.google.com/p/chromium/issues/detail?id=515257
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.15 Safari/537.36
Example URL:
Steps to reproduce the problem:
1. visit scrollable page, scroll down half-way
2. click a link which triggers history.pushState() and causes html to be
replaced
3. set scrollTo(0,0); after DOM is updated
What is the expected behavior?
new scroll position is 0, 0
What went wrong?
scroll position is not updated, old position 0, 1001 is retained
Does it occur on multiple sites: N/A
Is it a problem with a plugin? No
Did this work before? Yes v44
Does this work in other browsers? Yes
Chrome version: 45.0.2454.15 Channel: beta
OS Version: OS X 10.10.4
Flash Version:
i realize this is a fairly vague and unhelpful report but bear with me a
bit here - what i'm seeing is simply hard to explain let alone provide an
isolated test case for.
i have a single page app where i manually manage the main window's scroll
position (le sigh) - allowing me to restore on back / fwd as well as set
the appropriate state on initial click.
basic steps in this case are:
1. user clicks a link
2. app fetches view content (or restores if cached)
3. app draws new view, revealing when done
4. if scroll pos has changed, app sets new position - in this case
scrollTo(0, 0);
prior to v45, this all worked more or less fine - showing the user a new
view scrolled fully to the top when first loaded. with v45, new views are
no longer being scrolled to the top.
stepping thru my code in the debugger, i see that i'm setting the
appropriate scrollTo values at the right time yet those values are not
being respected.
here's the weird part - if i read window.scrollY directly before calling
window.scrollTo(0, 0), everything works as it did in v44.
further, when i pause execution in chrome at the point where i'm
setting .scrollTo(), i see that my new view is not yet painted. when i step
thru my code in firefox (v40) and safari (v8), they work as expected and
when i pause execution at the same point, my new view is rendered and
visible.
i found this perhaps related issue -->
https://code.google.com/p/chromium/issues/detail?id=465574&q=scroll%20position&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Cr%20Status%20Owner%20Summary%20OS%20Modified
i'll be sure to post any additional info as i find it. unfortunately, the
code which triggers this issue isn't live yet but when it gets shipped, i
will update this issue with a live example.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings