Closed Bug 2063561 Opened 3 months ago Closed 3 months ago

[DevTools Release Tasks - Cycle 156] Remove backward compatibility code

Categories

(DevTools :: General, task)

task

Tracking

(firefox156 fixed)

RESOLVED FIXED
156 Branch
Tracking Status
firefox156 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

Details

Attachments

(1 external file)

Removes the 4 remaining @backward-compat { version 154 } sites in devtools, all
related to toggling global highlighters (rulers / measuring tool) through the
target actor configuration's enabledHighlighters option:

  • devtools/client/definitions.js, createHighlightButton():
    • onClick: drop the targetConfigurationCommand.supports("enabledHighlighters")
      check and the legacy branch which created/showed/hid the highlighters
      client-side through the InspectorFront.
    • isChecked: drop the "enabledHighlighters" in configuration heuristic and the
      legacy fallback based on getKnownHighlighter(type)?.isShown(). The checked
      state now always comes from the pushed configuration.
  • devtools/client/fronts/inspector.js: drop the DOCUMENT_EVENT watcher and its
    will-navigate listener which cleared the _highlighters cache (the backend now
    owns the lifecycle of the globally enabled highlighters across navigations),
    as well as the matching unwatchResources call in destroy(). hasHighlighter()
    is removed with it: it was the only consumer of that cache invalidation and has
    no callers left in the tree. getKnownHighlighter() is kept (still used by
    highlighters-overlay.js and several tests).

One extra hunk, easy to split out if you'd rather land it separately:
Toolbox.updateToolboxButtonsVisibility() gated "hide the highlighters when the
button is disabled from the options panel" on a cached InspectorFront. That
requirement only existed for the legacy client-side path. With the configuration
path, enabling the rulers from e.g. the console panel and then hiding the button
from the settings panel left the highlighters painted on the page with no way to
turn them off, because no InspectorFront had ever been created. The guard is
dropped; button.isChecked is now the only signal needed, and it cannot throw
(targetConfigurationCommand is always available and configuration defaults to {}).

Testing: no test changes. The legacy branches were only reachable when connecting
to a pre-154 server and had no automated coverage; the surviving configuration path
is covered by
devtools/client/framework/test/browser_toolbox_rulers_button_highlighter_reload.js,
browser_toolbox_measure_button_highlighter_destroy.js,
browser_toolbox_options_disable_buttons.js and
devtools/client/inspector/test/highlighter/browser_inspector_highlighter-viewport-size.js.
Note that these mochitests could not be executed in the environment this patch was
prepared in (no build/objdir available), so please rely on CI for them.

Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Attachment #9626653 - Attachment description: Bug 2063561 - [devtools] Remove backward compatibility code for Firefox 154 (global highlighters via target configuration). r=devtools-reviewers → Bug 2063561 - [devtools] Remove backward compatibility code for Firefox 154 r=#devtools-reviewers
Blocks: 2063982
Pushed by jdescottes@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/9087106f59a5 https://hg.mozilla.org/integration/autoland/rev/936176683d2e [devtools] Remove backward compatibility code for Firefox 154 r=devtools-reviewers,nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 156 Branch
QA Whiteboard: [qa-triage-done-c157/b156]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: