Closed Bug 1620247 Opened 5 years ago Closed 5 years ago

Making the cursor blink causes too much activity in the browser console

Categories

(DevTools :: Console, enhancement, P3)

enhancement

Tracking

(firefox76 fixed)

RESOLVED FIXED
Firefox 76
Tracking Status
firefox76 --- fixed

People

(Reporter: florian, Assigned: nchevobbe)

References

(Blocks 1 open bug)

Details

(Keywords: perf)

Attachments

(1 file)

The cursor of the browser console blinks using JS code and a setInterval timer. https://searchfox.org/mozilla-central/rev/c79c0d65a183d9d38676855f455a5c6a7f7dadd3/devtools/client/shared/sourceeditor/codemirror/lib/codemirror.js#3264

This causes more activity than needed, which is visible in profiles: https://perfht.ml/2IiHuQ6

For comparison, here's a profile of the cursor blinking in the url bar: https://perfht.ml/2TpApnb

CodeMirror sets a setInterval function in which the cursor element
visibility is toggled on and off. This shows up in profiles, and on
slow hardware or busy situations, this can make the editor feel slow.
This patch sets the cursorBlinkingRate to 0, which won't trigger the
setInterval setup, and reimplement the blinking through CSS animation.

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Priority: -- → P3

Blinking cursors can be blinding and can trigger migraines. Please ensure that if users set ui.caretBlinkTime to 0 on our own, you don't override this and hurt us again.

Attachment #9131910 - Attachment description: Bug 1620247 - Roll our own cursor blinking animation in the Editor. r=gl. → Bug 1620247 - Roll our own cursor blinking animation in the Editor. r=gl!,rcaliman!.
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d467d261a5ab Roll our own cursor blinking animation in the Editor. r=gl,rcaliman.
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 76
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: