Introduce read-only index property as a replacement for pseudo-private _tPos
Categories
(Firefox :: Tabbed Browser, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox156 | --- | fixed |
People
(Reporter: dao, Assigned: dao, Mentored)
References
(Blocks 1 open bug, Regressed 1 open bug)
Details
(Keywords: good-next-bug, Whiteboard: [lang=js])
Attachments
(2 files)
_tPos is used quite a bit by external code, so there's no point in pretending it's private anymore. We should add a proper public, read-only property on tabs, perhaps index or position.
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
Comment 1•3 months ago
•
|
||
The tricky bit is that assignments to _tPos are done in tabbrowser.js, but MozTabbrowserTab (the tab object) itself is defined in tab.js. So, it is not a simple matter of making a private setter + public getter.
I think we should leave the _tPos assignments as is, and create a public getter (called tabIndex) in MozTabbrowserTab which returns this._tPos. Then replace all outside references to _tPos accordingly.
Nonetheless, this seems like a good fit for a mentored bug.
| Assignee | ||
Updated•6 days ago
|
| Assignee | ||
Comment 2•6 days ago
|
||
Not tabIndex as the bug's summary suggests: every element inherits that one from Element. The underscored _index stays as the write path, since the tabbrowser sets it from outside the tab's own class, and the session store's check for a tab that never got a position becomes a read of the getter.
Updated•6 days ago
|
| Assignee | ||
Comment 3•6 days ago
|
||
Comment 5•4 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/2472454448e4
https://hg.mozilla.org/mozilla-central/rev/2a60e54ede11
Description
•