Closed Bug 1609567 Opened 6 years ago Closed 5 years ago

Style Editor ignores ui.caretBlinkTime 0

Categories

(DevTools :: Style Editor, enhancement, P2)

72 Branch
enhancement

Tracking

(firefox76 fixed)

RESOLVED FIXED
Firefox 76
Tracking Status
firefox76 --- fixed

People

(Reporter: erwinm, Assigned: rcaliman)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:72.0) Gecko/20100101 Firefox/72.0

Steps to reproduce:

I tried to use the Style Editor, to see of it wiould help me block some of Firefox's animation.

Actual results:

I got hit with an animated blinking cursor. I can't read near a blinking cursor and can have trouble seeing near one.

Expected results:

The Style Editor should follow ui.caretBlinkTime settings.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Style Editor
Product: Firefox → DevTools

Hi MarjaE,

Can you please let me know where in Firefox you found that ui.caretBlinkTime setting? I looked in about:config but didn't find it.

Flags: needinfo?(erwinm)

I think I figured it. The ui.caretBlinkTime pref isn't defined in about:config, therefore it doesn't have a default exposed.
But if it is defined by the user, there are code paths in Firefox which will take it into account:
https://searchfox.org/mozilla-central/search?path=&q=caretBlinkTime

The CodeMirror instance of the Style Editor isn't one of them.

Assignee: nobody → rcaliman
Status: UNCONFIRMED → ASSIGNED
Type: defect → enhancement
Ever confirmed: true
Flags: needinfo?(erwinm)
Priority: -- → P2

Adds the ability to set the cursror blink rate for CodeMirror editors if the ui.caretBlinkTime pref is defined. The pref is not defined by default in about:config, but there are code paths in Firefox which will make use of it (ex: input fields).
See: https://searchfox.org/mozilla-central/search?q=caretBlinkTime&path=

Yes, I have to create the setting since it doesn't exist by default.

Pushed by rcaliman@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d85d1a9cb70f Configure CodeMirror instance in DevTools to use custom cursor blink rate if defined. r=pbro

Backed out changeset d85d1a9cb70f (Bug 1609567) for debugger complaining about ConditionalPanel&createEditor

Push with failure: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=pending%2Crunning%2Csuccess%2Ctestfailed%2Cbusted%2Cexception&fromchange=f4b83061fc6001c274891a2fffbbe207feed6139&searchStr=linux%2Cx64%2Copt%2Cnode%2Ctests%2Csource-test-node-debugger-tests%2Cnode%28debugger%29&tochange=d2aedb356c5f81771c1b88ea051d4b3eb7a99d15&selectedJob=288894709

Backout link: https://hg.mozilla.org/integration/autoland/rev/d2aedb356c5f81771c1b88ea051d4b3eb7a99d15

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=288894709&repo=autoland&lineNumber=903

[task 2020-02-14T10:19:02.907Z]     Received value does not match stored snapshot "ConditionalPanel it should render with condition at selected breakpoint location 1".
[task 2020-02-14T10:19:02.907Z] 
[task 2020-02-14T10:19:02.907Z]     - Snapshot
[task 2020-02-14T10:19:02.908Z]     + Received
[task 2020-02-14T10:19:02.908Z] 
[task 2020-02-14T10:19:02.908Z]     @@ -31,10 +31,11 @@
[task 2020-02-14T10:19:02.908Z]                   Array [
[task 2020-02-14T10:19:02.908Z]                     <textarea>
[task 2020-02-14T10:19:02.908Z]                       I'm a condition
[task 2020-02-14T10:19:02.909Z]                     </textarea>,
[task 2020-02-14T10:19:02.909Z]                     Object {
[task 2020-02-14T10:19:02.909Z]     +                 "cursorBlinkRate": 530,
[task 2020-02-14T10:19:02.909Z]                       "mode": "javascript",
[task 2020-02-14T10:19:02.910Z]                       "placeholder": "Breakpoint condition, e.g. items.length > 0",
[task 2020-02-14T10:19:02.910Z]                       "theme": "mozilla",
[task 2020-02-14T10:19:02.910Z]                     },
[task 2020-02-14T10:19:02.910Z]                   ],
[task 2020-02-14T10:19:02.911Z] 
[task 2020-02-14T10:19:02.911Z]       84 |   it("it should render with condition at selected breakpoint location", () => {
[task 2020-02-14T10:19:02.911Z]       85 |     const { wrapper } = render(false, 3, 3, "I'm a condition", "not a log");
[task 2020-02-14T10:19:02.911Z]     > 86 |     expect(wrapper).toMatchSnapshot();
[task 2020-02-14T10:19:02.912Z]          |                     ^
[task 2020-02-14T10:19:02.912Z]       87 |   });
[task 2020-02-14T10:19:02.912Z]       88 |   it("it should render with logpoint at selected breakpoint location", () => {
[task 2020-02-14T10:19:02.912Z]       89 |     const { wrapper } = render(true, 4, 4, "not a condition", "I'm a log");
[task 2020-02-14T10:19:02.913Z] 
[task 2020-02-14T10:19:02.913Z]       at Object.toMatchSnapshot (src/components/Editor/tests/ConditionalPanel.spec.js:86:21)
[task 2020-02-14T10:19:02.913Z] 
[task 2020-02-14T10:19:02.913Z]   ● ConditionalPanel › it should render with logpoint at selected breakpoint location
[task 2020-02-14T10:19:02.914Z] 
[task 2020-02-14T10:19:02.914Z]     expect(value).toMatchSnapshot()
[task 2020-02-14T10:19:02.914Z] 
[task 2020-02-14T10:19:02.914Z]     Received value does not match stored snapshot "ConditionalPanel it should render with logpoint at selected breakpoint location 1".
[task 2020-02-14T10:19:02.915Z] 
[task 2020-02-14T10:19:02.915Z]     - Snapshot
[task 2020-02-14T10:19:02.915Z]     + Received
[task 2020-02-14T10:19:02.915Z] 
[task 2020-02-14T10:19:02.915Z]     @@ -31,10 +31,11 @@
[task 2020-02-14T10:19:02.915Z]                   Array [
[task 2020-02-14T10:19:02.916Z]                     <textarea>
[task 2020-02-14T10:19:02.916Z]                       I'm a log
[task 2020-02-14T10:19:02.916Z]                     </textarea>,
[task 2020-02-14T10:19:02.916Z]                     Object {
[task 2020-02-14T10:19:02.916Z]     +                 "cursorBlinkRate": 530,
[task 2020-02-14T10:19:02.916Z]                       "mode": "javascript",
[task 2020-02-14T10:19:02.916Z]                       "placeholder": "Log message, e.g. displayName",
[task 2020-02-14T10:19:02.916Z]                       "theme": "mozilla",
[task 2020-02-14T10:19:02.916Z]                     },
[task 2020-02-14T10:19:02.916Z]                   ],
[task 2020-02-14T10:19:02.916Z] 
[task 2020-02-14T10:19:02.916Z]       88 |   it("it should render with logpoint at selected breakpoint location", () => {
[task 2020-02-14T10:19:02.916Z]       89 |     const { wrapper } = render(true, 4, 4, "not a condition", "I'm a log");
[task 2020-02-14T10:19:02.916Z]     > 90 |     expect(wrapper).toMatchSnapshot();
[task 2020-02-14T10:19:02.916Z]          |                     ^
[task 2020-02-14T10:19:02.916Z]       91 |   });
[task 2020-02-14T10:19:02.916Z]       92 | });
[task 2020-02-14T10:19:02.916Z]       93 | 
[task 2020-02-14T10:19:02.916Z] 
[task 2020-02-14T10:19:02.916Z]       at Object.toMatchSnapshot (src/components/Editor/tests/ConditionalPanel.spec.js:90:21)
[task 2020-02-14T10:19:02.916Z] 
[task 2020-02-14T10:19:02.916Z] FAIL src/utils/editor/tests/create-editor.spec.js
[task 2020-02-14T10:19:02.916Z]   ● createEditor › Returns a SourceEditor
[task 2020-02-14T10:19:02.916Z] 
[task 2020-02-14T10:19:02.916Z]     expect(value).toMatchSnapshot()
[task 2020-02-14T10:19:02.916Z] 
[task 2020-02-14T10:19:02.916Z]     Received value does not match stored snapshot "createEditor Returns a SourceEditor 1".
[task 2020-02-14T10:19:02.916Z] 
[task 2020-02-14T10:19:02.916Z]     - Snapshot
[task 2020-02-14T10:19:02.916Z]     + Received
[task 2020-02-14T10:19:02.916Z] 
[task 2020-02-14T10:19:02.916Z]     @@ -1,6 +1,7 @@
[task 2020-02-14T10:19:02.916Z]       Object {
[task 2020-02-14T10:19:02.916Z]     +   "cursorBlinkRate": 530,
[task 2020-02-14T10:19:02.916Z]         "enableCodeFolding": false,
[task 2020-02-14T10:19:02.916Z]         "extraKeys": Object {
[task 2020-02-14T10:19:02.916Z]           "Cmd-F": false,
[task 2020-02-14T10:19:02.916Z]           "Cmd-G": false,
[task 2020-02-14T10:19:02.916Z]           "Ctrl-F": false,
[task 2020-02-14T10:19:02.916Z] 
[task 2020-02-14T10:19:02.916Z]       14 |     const editor = createEditor();
[task 2020-02-14T10:19:02.916Z]       15 |     expect(editor).toBeInstanceOf(SourceEditor);
[task 2020-02-14T10:19:02.916Z]     > 16 |     expect(editor.opts).toMatchSnapshot();
[task 2020-02-14T10:19:02.916Z]          |                         ^
[task 2020-02-14T10:19:02.917Z]       17 |     expect(editor.opts.gutters).not.toContain("CodeMirror-foldgutter");
[task 2020-02-14T10:19:02.917Z]       18 |   });
[task 2020-02-14T10:19:02.917Z]       19 | 
[task 2020-02-14T10:19:02.917Z] 
[task 2020-02-14T10:19:02.917Z]       at Object.toMatchSnapshot (src/utils/editor/tests/create-editor.spec.js:16:25)
[task 2020-02-14T10:19:02.917Z] 
[task 2020-02-14T10:19:02.917Z]   ● createEditor › Adds codeFolding
[task 2020-02-14T10:19:02.917Z] 
[task 2020-02-14T10:19:02.917Z]     expect(value).toMatchSnapshot()
[task 2020-02-14T10:19:02.917Z] 
[task 2020-02-14T10:19:02.917Z]     Received value does not match stored snapshot "createEditor Adds codeFolding 1".
[task 2020-02-14T10:19:02.917Z] 
[task 2020-02-14T10:19:02.917Z]     - Snapshot
[task 2020-02-14T10:19:02.917Z]     + Received
[task 2020-02-14T10:19:02.917Z] 
[task 2020-02-14T10:19:02.917Z]     @@ -1,6 +1,7 @@
[task 2020-02-14T10:19:02.917Z]       Object {
[task 2020-02-14T10:19:02.917Z]     +   "cursorBlinkRate": 530,
[task 2020-02-14T10:19:02.917Z]         "enableCodeFolding": true,
[task 2020-02-14T10:19:02.917Z]         "extraKeys": Object {
[task 2020-02-14T10:19:02.917Z]           "Cmd-F": false,
[task 2020-02-14T10:19:02.917Z]           "Cmd-G": false,
[task 2020-02-14T10:19:02.917Z]           "Ctrl-F": false,
[task 2020-02-14T10:19:02.917Z] 
[task 2020-02-14T10:19:02.917Z]       22 |     const editor = createEditor();
[task 2020-02-14T10:19:02.917Z]       23 |     expect(editor).toBeInstanceOf(SourceEditor);
[task 2020-02-14T10:19:02.917Z]     > 24 |     expect(editor.opts).toMatchSnapshot();
[task 2020-02-14T10:19:02.917Z]          |                         ^
[task 2020-02-14T10:19:02.917Z]       25 |     expect(editor.opts.gutters).toContain("CodeMirror-foldgutter");
[task 2020-02-14T10:19:02.917Z]       26 |   });
[task 2020-02-14T10:19:02.917Z]       27 | });
[task 2020-02-14T10:19:02.917Z] 
[task 2020-02-14T10:19:02.918Z]       at Object.toMatchSnapshot (src/utils/editor/tests/create-editor.spec.js:24:25)
[task 2020-02-14T10:19:02.918Z] 
[task 2020-02-14T10:19:02.918Z] 
[task 2020-02-14T10:19:02.918Z] Snapshot Summary
[task 2020-02-14T10:19:02.918Z]  › 5 snapshots failed from 2 test suites. Inspect your code changes or run `yarn run test-ci -u` to update them.
[task 2020-02-14T10:19:02.918Z] 
[task 2020-02-14T10:19:02.918Z] Test Suites: 2 failed, 204 passed, 206 total
[task 2020-02-14T10:19:02.918Z] Tests:       5 failed, 8 skipped, 1760 passed, 1773 total
[task 2020-02-14T10:19:02.918Z] Snapshots:   5 failed, 452 passed, 457 total
[task 2020-02-14T10:19:02.918Z] Time:        104.495s
[task 2020-02-14T10:19:02.918Z] Ran all test suites in 5 projects.
[task 2020-02-14T10:19:02.918Z] error Command failed with exit code 1.
[task 2020-02-14T10:19:02.918Z] TEST-UNEXPECTED-FAIL jest |   ● ConditionalPanel › it should render at location of selected breakpoint
[task 2020-02-14T10:19:02.918Z] TEST-UNEXPECTED-FAIL jest |   ● ConditionalPanel › it should render with condition at selected breakpoint location
[task 2020-02-14T10:19:02.918Z] TEST-UNEXPECTED-FAIL jest |   ● ConditionalPanel › it should render with logpoint at selected breakpoint location
[task 2020-02-14T10:19:02.918Z] TEST-UNEXPECTED-FAIL jest |   ● createEditor › Returns a SourceEditor
[task 2020-02-14T10:19:02.918Z] TEST-UNEXPECTED-FAIL jest |   ● createEditor › Adds codeFolding
[task 2020-02-14T10:19:02.918Z] TEST START | Stylelint
Flags: needinfo?(rcaliman)

The snapshots for the Jest tests for the debugger needed to be updated as well. Done that, attempting to push again.

Flags: needinfo?(rcaliman)

Before we proceed, I think we might have a conflict with Bug 1620247. We should align about what we want to do since we are making cursorBlinkRate to 0 in the other bug and rolling our own animated cursor blink

Thanks for the heads-up, Gabriel! Nicolas and I know about this and we'll coordinate.

Pushed by rcaliman@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ec62da61aa2c Configure CodeMirror instance in DevTools to use custom cursor blink rate if defined. r=pbro
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 76

Hi MarjaE,

This bug and bug 1620247 have landed in Firefox Nightly and they should address the request (no blinking cursor when the ui.caretBlinkTime pref is set to 0 in about:config). Sorry it took so long. It will make its way to Beta then Release in a few weeks.

Flags: needinfo?(erwinm)
Flags: needinfo?(erwinm)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: