Open Bug 1422747 Opened 2 years ago Updated 2 years ago

`moveTabTo` doesn't do the right thing when there is only 1 tab in the window

Categories

(Firefox :: Tabbed Browser, defect, P3)

57 Branch
defect

Tracking

()

People

(Reporter: Gijs, Unassigned)

References

Details

Attachments

(1 obsolete file)

Trivial STR:

1. open new window
2. open browser console
3. run:

gBrowser.moveTabTo(gBrowser.selectedTab, 1)


Expected:

nothing happens

Actual:

new tab button is moved before the tab


You can see this with direct DOM manipulation by using:

gBrowser.selectedTab.parentNode.appendChild(gBrowser.selectedTab)

(or ... insertBefore(gBrowser.selectedTab, null) )

We can guard for this case in the "moveTabTo" implementation, but it would be better to fix the underlying bug, unless fixing the underlying XBL bug is too difficult to bother doing before we get rid of XBL entirely.

Boris, do you have any idea what's going on here or why the fixes from bug 472020 are insufficient here and/or whether it's worth fixing something here over adding a guard to moveTabTo() ?
Flags: needinfo?(bzbarsky)
(This is currently exposed through webextensions, but we're adding a workaround in bug 1422211)
Blocks: 1422211
> or why the fixes from bug 472020 are insufficient here

Those fixes are known to not fix all issues like this.  That's why some of the reftests that bug added are marked as failing....

So it's possible that this situation looks like https://searchfox.org/mozilla-central/source/layout/reftests/bugs/472020-1b.xul or https://searchfox.org/mozilla-central/source/layout/reftests/bugs/472020-2.xul ... or something else along those lines.

Emilio has poked at things like this recently; it's even possible that his in-flight patches fix this.  If not, we'd need to sit down and debug what's really going on here with the insertion points.
Flags: needinfo?(bzbarsky)
I could take a look when I have some free time, whatever that means... :)
Flags: needinfo?(emilio)
Priority: -- → P3
Comment on attachment 8936960 [details]
Bug 1422747: Make 2-level nested insertion points work correctly.

Err, this was supposed to be in bug 1425362. Anyway I don't think it's worth fixing. And to fix this particular case without redistributing the world we should keep track of all the nested insertion points, which we don't, and I don't think we should start doing...
Attachment #8936960 - Attachment is obsolete: true
Flags: needinfo?(emilio)
See Also: 1392352
You need to log in before you can comment on or make changes to this bug.