Closed
Bug 1308775
Opened 8 years ago
Closed 8 years ago
scroll-behavior: smooth interacts badly with auto scroll
Categories
(Toolkit :: General, defect)
Tracking
()
RESOLVED
FIXED
mozilla52
Tracking | Status | |
---|---|---|
firefox52 | --- | fixed |
People
(Reporter: 5silentrain, Assigned: arai)
References
()
Details
Attachments
(2 files, 1 obsolete file)
542 bytes,
text/html
|
Details | |
3.19 KB,
patch
|
Felipe
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:49.0) Gecko/20100101 Firefox/49.0 Build ID: 20160922113459 Steps to reproduce: Activate autoscrolling on the forum: http://nightmarish-dream.ru/forum/ Actual results: Something strange is happening with the autoscroll on this forum Expected results: Autoscroll on this forum should work just like on all other sites
Reporter | ||
Updated•8 years ago
|
OS: Unspecified → Windows 7
Hardware: Unspecified → x86_64
Assignee | ||
Comment 1•8 years ago
|
||
The website has the following style on body: scroll-behavior: smooth; it interacts badly with auto scroll.
Status: UNCONFIRMED → NEW
Component: Untriaged → Layout
Ever confirmed: true
Product: Firefox → Core
Summary: Strange problem with Autoscroll on the forum: nightmarish-dream.ru/forum/ → scroll-behavior: smooth interacts badly with auto scroll
Assignee | ||
Comment 2•8 years ago
|
||
simplified testcase with |scroll-behavior: smooth| style on body, and long content
Assignee | ||
Comment 3•8 years ago
|
||
the issue is that, setting scrollTop or scrollLeft doesn't actually change the value until it gets scrolled visually. console.log(document.documentElement.scrollTop); /// 0 document.documentElement.scrollTop = 1000; console.log(document.documentElement.scrollTop); /// 0 https://dxr.mozilla.org/mozilla-central/rev/7a7ba250bb2f5a7cc7acf4b97145425c5292e894/toolkit/content/browser-content.js#221-222 > this._scrollable.scrollLeft += actualScrollX; > this._scrollable.scrollTop += actualScrollY; auto scroll is implemented by adding diff to scrollTop and scrollLeft incrementally. it means, if scrollTop doesn't return the value that is set last time, the value is not updated correctly.
Reporter | ||
Comment 4•8 years ago
|
||
(In reply to Tooru Fujisawa [:arai] from comment #2) > Created attachment 8799228 [details] > simplified testcase > > simplified testcase with |scroll-behavior: smooth| style on body, and long > content Can you confirm this bug? https://bugzilla.mozilla.org/show_bug.cgi?id=1306925
Assignee | ||
Comment 5•8 years ago
|
||
(In reply to 5silentrain from comment #4) > Can you confirm this bug? > https://bugzilla.mozilla.org/show_bug.cgi?id=1306925 I cannot.
Assignee | ||
Comment 6•8 years ago
|
||
on Chrome, setting scrollTop or scrollLeft doesn't start smooth scroll, but just changes the scroll position, when #smooth-scrolling flag is enabled. kip, which behavior matches to the spec? If Firefox's behavior matches to the spec, this might be a bug in auto scroll.
Flags: needinfo?(kgilbert)
Comment 7•8 years ago
|
||
It seems to me CSSOM View spec is mostly written according to Gecko's behavior. Setting scrollTop on Chrome doesn't really works. But autoscroll should not be affected by scroll-behavior anyway, as it is a scrolling performed by user. Then it comes to me that it should actually be a bug of toolkit that, toolkit should always use "scrollBy" even for elements, with "behavior" set to "instant" (or "smooth" if it looks better, but should never be "auto" since that would depend on value of scroll-behavior from the page).
Comment 8•8 years ago
|
||
Given comment 7, clear ni? for kip, and move this bug to Toolkit component.
Component: Layout → General
Flags: needinfo?(kgilbert)
Product: Core → Toolkit
Assignee | ||
Comment 9•8 years ago
|
||
Changed to use Element.scrollBy instead of scrollTop/scrollLeft. I choose |behavior: "instant"| as |behavior: "smooth"| makes it more like *delayed* instead of smooth, and I cannot stop at the point that I want to stop. Added somewhat corresponding testcase to browser_bug295977_autoscroll_overflow.js, but the test will be passed even without this patch. actually it's hard to test this fix, as this bug is about smoothness, and checking smoothness will cause intermittent failure...
Assignee: nobody → arai.unmht
Attachment #8799289 -
Flags: review?(dtownsend)
Comment 10•8 years ago
|
||
Comment on attachment 8799289 [details] [diff] [review] Use Element.scrollBy with behavior: "instant" in auto scroll. Mike might be a better reviewer here
Attachment #8799289 -
Flags: review?(dtownsend) → review?(mconley)
Comment 11•8 years ago
|
||
Comment on attachment 8799289 [details] [diff] [review] Use Element.scrollBy with behavior: "instant" in auto scroll. Review of attachment 8799289 [details] [diff] [review]: ----------------------------------------------------------------- I'm going to redirect this to felipe who originally reviewed the e10s middle-sclick autoscroll behaviour added by billm in bug 938359. If felipe is overloaded, I guess you can send it back to me and I can try to swap in how all of this stuff works.
Attachment #8799289 -
Flags: review?(mconley) → review?(felipc)
Comment 12•8 years ago
|
||
Comment on attachment 8799289 [details] [diff] [review] Use Element.scrollBy with behavior: "instant" in auto scroll. Review of attachment 8799289 [details] [diff] [review]: ----------------------------------------------------------------- Looks good. Since this changes behavior, it's hard to predict how it can affect webpages, so let's pay extra attention for possible fall out from this. But the change and the rationale for it are reasonable.
Attachment #8799289 -
Flags: review?(felipc) → review+
Assignee | ||
Comment 13•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/9d11e38b5fcfd0573945b810ceb49e83e0ba5386 Bug 1308775 - Use Element.scrollBy with behavior: "instant" in auto scroll. r=felipe
Assignee | ||
Comment 14•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/e3cf8325bf7530f13c331298f1ed1be7ce92ce38 Backed out changeset 9d11e38b5fcf for bc test failure (bug 1308775)
Assignee | ||
Comment 15•8 years ago
|
||
Looks like the testcase wasn't working as expected. will investigate shortly.
Assignee | ||
Comment 16•8 years ago
|
||
apparently I should set middlemousepastepref to false to make the test does autoscroll on linux, after the other tests. triggered try run https://treeherder.mozilla.org/#/jobs?repo=try&revision=732e0e1d1474
Assignee | ||
Comment 17•8 years ago
|
||
so, the pref for middle click affects the tests, and it should be better testing this before that part. moved the test before tests with middlemousepastepref.
Attachment #8799289 -
Attachment is obsolete: true
Attachment #8802164 -
Flags: review?(felipc)
Updated•8 years ago
|
Attachment #8802164 -
Flags: review?(felipc) → review+
Comment 18•8 years ago
|
||
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/b63951fa8add Use Element.scrollBy with behavior: "instant" in auto scroll. r=felipe
Assignee | ||
Comment 19•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/b63951fa8addd9dd1011a1d95319437a364512a2 Bug 1308775 - Use Element.scrollBy with behavior: "instant" in auto scroll. r=felipe
Comment 21•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/b63951fa8add
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox52:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in
before you can comment on or make changes to this bug.
Description
•