Closed Bug 1586680 Opened 6 years ago Closed 6 years ago

Fix devtools issues when toolbox uses a <browser> element instead of a content <iframe>

Categories

(DevTools :: General, task, P1)

task

Tracking

(firefox71 fixed)

RESOLVED FIXED
Firefox 71
Tracking Status
firefox71 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

(Blocks 1 open bug)

Details

(Whiteboard: dt-fission-m1)

Attachments

(3 files)

For Bug 1581925, the devtools toolbox will use a <browser> element instead of an <iframe> with type="content". For now, when devtools.toolbox.content-frame is set to false, we will still use an <iframe>, but this is being removed in Bug 1585747.

When applying the patches from Bug 1581925, there are a few issues:

  • default html context menus appear when right clicking in HTML DevTools panels
  • scroll-lock feature is enabled when doing middle click
  • shift+F7 triggers the caret browsing popup instead of toggling the style editor

With the removal of ContextMenuSpecialProcessChild.jsm in Bug 1581925, the default HTML context menu will start showing up when right clicking in empty areas of the HTML based DevTools panels.
The toolbox is will catch and stop all context menu events when they are coming from HTML documents.
For XUL panels, we still want context menu events to trigger their default behavior which we use to display custom context menus in those panels.

Depends on D48312

When the DevTools toolbox is using a <browser> element, middle click will start the scroll lock feature on macos and windows.
Catch all middleclick events from the toolbox and preventDefault to avoid this.

Depends on D48313

caret browsing is enabled by the F7 shortcut, and devtools style editor is toggled via shift+F7.
When the DevTools toolbox is using a browser element, using shift+F7 in the toolbox will first trigger caret browsing and then toggle the style-editor.
The DevTools shortcut is added via a XUL key in DevToolsStartup.jsm but I didn't manage to prevent the shift+F7 event from triggering the caret-browsing keypress callback.
So instead, check if shiftKey is true in the caret-browsing callback and bail out.
In theory, unless explicitly supported, the callback should bailout if any modifier is pressed.

Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7d309560313a prevent default contextmenu events from DevTools html panels r=nchevobbe https://hg.mozilla.org/integration/autoland/rev/73deef02af0c prevent scroll lock from middle click events in DevTools toolbox r=nchevobbe https://hg.mozilla.org/integration/autoland/rev/fc5adc9d81ef Prevent showing caret browsing prompt when using StyleEditor shortcut r=bgrins
Whiteboard: dt-fission → dt-fission dt-fission-m1
Whiteboard: dt-fission dt-fission-m1 → dt-fission-m1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: