Closed Bug 1979688 Opened 11 months ago Closed 16 days ago

Use # private fields for tabbrowser's internal state instead of underscore prefixes

Categories

(Firefox :: Tabbed Browser, task)

Desktop
All
task

Tracking

()

RESOLVED FIXED
154 Branch
Tracking Status
firefox153 --- fixed
firefox154 --- fixed

People

(Reporter: Gijs, Assigned: dao)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files)

Per review feedback in https://phabricator.services.mozilla.com/D258876#8946135 , these are pseudo-private right now (_-prefixed) but they could be "really" private in today's glorious new tabbrowser world. Hopefully. We'd need to check that this type of thing still works, also if the class is loaded in a different window.

Type: defect → task

(In reply to :Gijs (he/him) from comment #0)

Per review feedback in https://phabricator.services.mozilla.com/D258876#8946135 , these are pseudo-private right now (_-prefixed) but they could be "really" private in today's glorious new tabbrowser world. Hopefully. We'd need to check that this type of thing still works, also if the class is loaded in a different window.

It won't work because the Tabbrowser class lives on the window, so we'd need to convert it to the system module which may be a good idea; I filed bug 2049770 on this. For now we'll need helper methods to get and set those properties across windows.

Blocks: 2049770
Summary: Make tabFilters and tabListeners properly private elements in tabbrowser → Use # private fields for tabbrowser's internal state instead of underscore prefixes

Convert tabbrowser's truly-private internal fields from _-prefixed
pseudo-private properties to # private fields, and remove dead field
declarations surfaced by the conversion.

Cross-window tab swapping accesses the progress-listener maps on another
window's gBrowser, where # brand checks fail because each window has its
own Tabbrowser class identity, so those sites are routed through
_-prefixed accessor methods. Bug 2049770 tracks moving Tabbrowser to a
shared .sys.mjs module, which would remove the need for those accessors.

Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/989f8c4bd496 https://hg.mozilla.org/integration/autoland/rev/f65098c1aaf2 Use # private fields for tabbrowser's internal state instead of underscore prefixes. r=tabbrowser-reviewers,nsharpley
Status: ASSIGNED → RESOLVED
Closed: 16 days ago
Resolution: --- → FIXED
Target Milestone: --- → 154 Branch

Convert tabbrowser's truly-private internal fields from _-prefixed
pseudo-private properties to # private fields, and remove dead field
declarations surfaced by the conversion.

Cross-window tab swapping accesses the progress-listener maps on another
window's gBrowser, where # brand checks fail because each window has its
own Tabbrowser class identity, so those sites are routed through
_-prefixed accessor methods. Bug 2049770 tracks moving Tabbrowser to a
shared .sys.mjs module, which would remove the need for those accessors.

Original Revision: https://phabricator.services.mozilla.com/D308317

Attachment #9602263 - Flags: approval-mozilla-beta?

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: For easier future uplifts to ESR
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: no
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Trivial refactor
  • String changes made/needed?: none
  • Is Android affected?: no
Attachment #9602263 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: