3
edits
Line 321: | Line 321: | ||
What I would like to happen is that once I detach the leftmost tab, the rightmost tab (on which I was most recently focused) would be the tab that pops back into focus. | What I would like to happen is that once I detach the leftmost tab, the rightmost tab (on which I was most recently focused) would be the tab that pops back into focus. | ||
Implementation issues: | |||
We don't want to slow down the browser by maintaining a potentially very deep list of focus. So what we can do is create a fixed-depth stack that only stores (at most) the N most recent tabs with focus. There are many acceptable ways to implement this, but the most lightweight would probably be to use an array with an index that is incremented/modulo-N. When we pop off an tab id, we can set the slot in the array corresponding to the current index to a null or -1 and then decrement our index. | |||
Realistically, however, even a very deep stack of integers will not be a bottleneck. |
edits