Open Bug 1389818 Opened 7 years ago Updated 2 years ago

enable smooth scroll on DevTools code editor

Categories

(DevTools :: Debugger, task, P5)

task

Tracking

(firefox57 fix-optional)

Tracking Status
firefox57 --- fix-optional

People

(Reporter: zcyzcy88888, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0
Build ID: 20170810180547

Steps to reproduce:

Open a DevTools code editor (example: debugger, stylish)
Scroll


Actual results:

Jump, no smooth scroll


Expected results:

Have smooth scroll

When pointer hover on scrollbar and scroll, there are smooth scroll.
In face you are `preventdefault` and manually change scrollTop.
Don't do this, let Firefox native handle scroll.
Component: Untriaged → Developer Tools: Debugger
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
BuildID: 20170813100233

I can confirm this behaviour in the latest Nightly. All parts of the DevTools editor except Debugger and Style Editor are smooth scrolling.
Status: UNCONFIRMED → NEW
Ever confirmed: true
:honza is this something we can fix with codemirror?
Priority: -- → P2
If this is about mouse wheel scrolling (`wheel` event), it could be related to this hack:

http://searchfox.org/mozilla-central/rev/15ce5cb2db0c85abbabe39a962b0e697c9ef098f/devtools/client/sourceeditor/editor.js#335-356

we added to avoid tearing with APZ.

Potentially you get smooth scroll by removing that, but then tearing happens again (I assume).
Can you confirm that main process actually has APZ; I heard that it doesn't. Also APZ & code mirror evolved a lot since then so maybe this can be revisited even without that.
Flags: needinfo?(jryans)
(In reply to :Harald Kirschner :digitarald from comment #4)
> Can you confirm that main process actually has APZ; I heard that it doesn't.
> Also APZ & code mirror evolved a lot since then so maybe this can be
> revisited even without that.

:kats confirmed on IRC that APZ is enabled in parent process for all desktop platforms.

I commented out the hack mentioned above as a test.  This does indeed enable smooth scroll by mouse wheel, but the problems with tearing also re-appear when using a touch pad to scroll.

So, it sounds like we need to first solve the issues with editor and APZ (bug 1160601).  As I understand it, Codemirror would need a new platform API before it can draw the gutter correctly in the presence of APZ.  More details in the bug just mentioned.
Depends on: 1160601
Flags: needinfo?(jryans)
Product: Firefox → DevTools

kats, what is status of this is?

Flags: needinfo?(kats)

Per https://github.com/codemirror/CodeMirror/issues/3705#issuecomment-419147793 the CodeMirror folks are working on a rewrite that will use position:sticky. Once that's done and devtools switches to use that, it should solve the issue we were seeing with the jumpy line numbers, and allow us to re-enable APZ here.

Additionally we might need to implement bug 1232491 to allow CodeMirror to pre-render more of the content in order to reduce checkerboarding. However that sort of depends on what the CodeMirror code ends up doing after the rewrite, it's not clear to me if it will need this or not.

Flags: needinfo?(kats)
Priority: P2 → P3
Type: defect → task
Blocks: dbg-frontend
Priority: P3 → P5
Blocks: 1565711
Blocks: 1565713
No longer blocks: 1565711
No longer blocks: 1565713
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.