Closed Bug 850659 Opened 12 years ago Closed 12 years ago

window.scrollTo doesn't work as expected after dynamically changing DOM

Categories

(Firefox for Android Graveyard :: Toolbar, defect)

20 Branch
Other
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: paolo.casciello, Unassigned)

Details

(Keywords: testcase)

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Sabayon Chrome/24.0.1312.56 Safari/537.17 Steps to reproduce: made visible again a big div previously hidden then issued a window.scrollTo() to position in the middle of the div. (also tried launching the scroll function after a timeout but same problem) Actual results: The browser painted as empty(white) the area from 0 to the scroll position i called. The redesigned the page without scrolling it down. Expected results: Same code in the desktop version of the browsers scrolls down after the redraw phase.
OS: Linux → Android
Hardware: x86_64 → Other
Can you attach a test page that demonstrates the issue?
Flags: needinfo?(paolo.casciello)
Sorry for the delay in my response.. :( I have a web app showing the problem. With 20.x branch the bug is even worse. (tested on 20.0.1) I've tried a lot to make a testcase showing it. It's very hard cause i don't know what exactly is causing it. Only the part of the code where it happens. :( The app is private for a customer so i can't make it pubblicly available :( And is very complex to reproduce it entirely. If is there a way to keep this private I could setup a test environment to test it online within the webapp itself. Please let me know.
Flags: needinfo?(paolo.casciello)
Version: Firefox 19 → Firefox 20
Sure, if you have a test environment that reproduces the problem (and has unobfuscated code that I can look at), you can email me the URL/access instructions to kats@mozilla.com and I can try to debug it.
Yup. We sell the entire application source to customers so the frontend code is fully readable :) I'll setup it asap. I'll try to record a video that shows the problem (desktop vs mobile) too. There are 2 different kinds of strange behaviour but i suspect it's the same problem (it kinda like forget the scrolled position) so i'll show you both. :)
Details sent. I'm writing this here just to keep track publicly :)
Just to update the bug, I tried to reproduce the problem using the test site that Paolo sent me, and wasn't able to. He was testing on a 800x480 screen resolution tablet (and the site uses responsive design) so that may be a factor - I didn't have any devices of that resolution on hand. I passed along the details to :mw22 to see if he can reproduce and reduce the test case.
Paolo, thank you for the unminimized testcase and the detailed video of what to look out for! I have something on my Galaxy Nexus that seems to reproduce the issue (sometimes). It's unminimized still, I'll work on it further tomorrow. I haven't been able to reproduce on trunk yet, fwiw.
Attached file testcase
Ok, I can reproduce this with current mobile Firefox release on my Samsung Galaxy Nexus in portrait mode. Steps to reproduce: - Load testcase - Reload testcase Expected result: - Rotating fish (animated gif) should be visible with a green box covering the majority of the page Actual resul: - Blank page, with a static image of the fish. I couldn't reproduce on Firefox beta. On trunk, I couldn't reproduce either, but there I can see a part of the red box, which I think I shouldn't see after the scripted scroll. That being said, the bugs might also be on beta and trunk, it might very well be depending on some subtle combination of circumstances. If one can't reproduce on their device, they could try and changing the initial-scale value and/or the scrollTo value.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: testcase
Sorry for the delay in getting back to this bug; I was on vacation for the last two weeks. On my Nexus 4 I can also reproduce the bug with the minimized test case :mw22 posted in comment 8 (awesome job with that!), but only intermittently on FF 20. I don't see it on FF 21 (current release), 22, 23, or 24 (current nightly). So the bug represented by the minimized test case appears to have been fixed in 21. Paolo, can you check to see if the original bug still happens with Firefox 21, which was just released last week?
Flags: needinfo?(paolo.casciello)
Ok the bug seems fixed! Now the only thing I see is the bouncing effect on top and bottom of rendered page (the one that FF do when draggin down past the end or up past the beginning) really sluggish. In 19 is perfectly smooth. Maybe I'll search and post a different bug report for this. :) I tried 21 and 22b. Really thanks guys!
Status: NEW → RESOLVED
Closed: 12 years ago
Flags: needinfo?(paolo.casciello)
Resolution: --- → WORKSFORME
Awesome, thanks for verifying! :)
I'm still seeing this. I filed bug 951746.
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: