1
1
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
2
- index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c44f52556e 100644
2
+ index 84d633471c89230b981d8a07babef4e0c76c0338..ac51c64014b805e2130ffe6698b439b5df1b6d78 100644
3
3
--- a/browser/components/tabbrowser/content/tabs.js
4
4
+++ b/browser/components/tabbrowser/content/tabs.js
5
5
@@ -83,7 +83,7 @@
@@ -85,16 +85,22 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
85
85
if (draggedTab && dropEffect == "copy") {
86
86
let duplicatedDraggedTab;
87
87
let duplicatedTabs = [];
88
- @@ -1116,7 +1133,7 @@
88
+ @@ -1116,10 +1133,11 @@
89
89
}
90
90
} else {
91
91
let isPinned = draggedTab.pinned;
92
92
- let numPinned = gBrowser.pinnedTabCount;
93
93
+ let numPinned = gBrowser._numVisiblePinTabsWithoutCollapsed;
94
+ + let essential = draggedTab.hasAttribute("zen-essential");
94
95
let tabs = this.ariaFocusableItems.slice(
95
- isPinned ? 0 : numPinned,
96
- isPinned ? numPinned : undefined
97
- @@ -1135,8 +1152,14 @@
96
+ - isPinned ? 0 : numPinned,
97
+ - isPinned ? numPinned : undefined
98
+ + isPinned ? (essential ? 0 : gBrowser._numZenEssentials) : numPinned,
99
+ + isPinned ? (essential ? gBrowser._numZenEssentials : numPinned) : undefined
100
+ );
101
+ let size = this.verticalMode ? "height" : "width";
102
+ let screenAxis = this.verticalMode ? "screenY" : "screenX";
103
+ @@ -1135,8 +1153,14 @@
98
104
(lastMovingTabScreen + tabSize);
99
105
100
106
if (this.verticalMode) {
@@ -110,15 +116,15 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
110
116
lastBound
111
117
);
112
118
} else {
113
- @@ -1337,6 +1360 ,7 @@
119
+ @@ -1337,6 +1361 ,7 @@
114
120
115
121
let nextItem = this.ariaFocusableItems[newIndex];
116
122
let tabGroup = isTab(nextItem) && nextItem.group;
117
123
+ if (gZenViewSplitter.handleTabDrop(event, urls, replace, inBackground)) return;
118
124
gBrowser.loadTabs(urls, {
119
125
inBackground,
120
126
replace,
121
- @@ -1369,6 +1393 ,17 @@
127
+ @@ -1369,6 +1394 ,17 @@
122
128
123
129
this.finishMoveTogetherSelectedTabs(draggedTab);
124
130
this.finishAnimateTabMove();
@@ -136,7 +142,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
136
142
this.#expandGroupOnDrop(draggedTab);
137
143
138
144
if (
139
- @@ -1597,7 +1632 ,7 @@
145
+ @@ -1597,7 +1633 ,7 @@
140
146
}
141
147
142
148
get newTabButton() {
@@ -145,7 +151,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
145
151
}
146
152
147
153
get verticalMode() {
148
- @@ -1621,29 +1656 ,54 @@
154
+ @@ -1621,29 +1657 ,54 @@
149
155
if (this.#allTabs) {
150
156
return this.#allTabs;
151
157
}
@@ -208,7 +214,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
208
214
}
209
215
210
216
/**
211
- @@ -1698,23 +1758 ,18 @@
217
+ @@ -1698,23 +1759 ,18 @@
212
218
}
213
219
214
220
let elementIndex = 0;
@@ -236,7 +242,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
236
242
let visibleTabsInGroup = child.tabs.filter(tab => tab.visible);
237
243
visibleTabsInGroup.forEach(tab => {
238
244
tab.elementIndex = elementIndex++;
239
- @@ -1724,10 +1779 ,7 @@
245
+ @@ -1724,10 +1780 ,7 @@
240
246
}
241
247
}
242
248
@@ -248,15 +254,15 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
248
254
249
255
return this.#focusableItems;
250
256
}
251
- @@ -1735,6 +1787 ,7 @@
257
+ @@ -1735,6 +1788 ,7 @@
252
258
_invalidateCachedTabs() {
253
259
this.#allTabs = null;
254
260
this._invalidateCachedVisibleTabs();
255
261
+ gZenWorkspaces._allStoredTabs = null;
256
262
}
257
263
258
264
_invalidateCachedVisibleTabs() {
259
- @@ -1749,8 +1802 ,8 @@
265
+ @@ -1749,8 +1803 ,8 @@
260
266
#isContainerVerticalPinnedGrid(tab) {
261
267
return (
262
268
this.verticalMode &&
@@ -267,7 +273,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
267
273
!this.expandOnHover
268
274
);
269
275
}
270
- @@ -1766,7 +1819 ,7 @@
276
+ @@ -1766,7 +1820 ,7 @@
271
277
272
278
if (node == null) {
273
279
// We have a container for non-tab elements at the end of the scrollbox.
@@ -276,7 +282,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
276
282
}
277
283
278
284
node.before(tab);
279
- @@ -1861,7 +1914 ,7 @@
285
+ @@ -1861,7 +1915 ,7 @@
280
286
// There are separate "new tab" buttons for horizontal tabs toolbar, vertical tabs and
281
287
// for when the tab strip is overflowed (which is shared by vertical and horizontal tabs);
282
288
// Attach the long click popup to all of them.
@@ -285,7 +291,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
285
291
const newTab2 = this.newTabButton;
286
292
const newTabVertical = document.getElementById(
287
293
"vertical-tabs-newtab-button"
288
- @@ -1956,10 +2009 ,12 @@
294
+ @@ -1956,10 +2010 ,12 @@
289
295
290
296
_handleTabSelect(aInstant) {
291
297
let selectedTab = this.selectedItem;
@@ -298,15 +304,15 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
298
304
selectedTab._notselectedsinceload = false;
299
305
}
300
306
301
- @@ -2132,6 +2187 ,7 @@
307
+ @@ -2132,6 +2188 ,7 @@
302
308
}
303
309
304
310
_positionPinnedTabs() {
305
311
+ if (true) return;
306
312
let tabs = this.visibleTabs;
307
313
let numPinned = gBrowser.pinnedTabCount;
308
314
let absPositionHorizontalTabs =
309
- @@ -2206,7 +2262 ,7 @@
315
+ @@ -2206,7 +2263 ,7 @@
310
316
return;
311
317
}
312
318
@@ -315,7 +321,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
315
321
316
322
let directionX = screenX > dragData.animLastScreenX;
317
323
let directionY = screenY > dragData.animLastScreenY;
318
- @@ -2215,6 +2271 ,8 @@
324
+ @@ -2215,6 +2272 ,8 @@
319
325
320
326
let { width: tabWidth, height: tabHeight } =
321
327
draggedTab.getBoundingClientRect();
@@ -324,7 +330,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
324
330
let shiftSizeX = tabWidth * movingTabs.length;
325
331
let shiftSizeY = tabHeight;
326
332
dragData.tabWidth = tabWidth;
327
- @@ -2244,7 +2302 ,7 @@
333
+ @@ -2244,7 +2303 ,7 @@
328
334
let translateX = screenX - dragData.screenX;
329
335
let translateY = screenY - dragData.screenY;
330
336
translateY +=
@@ -333,7 +339,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
333
339
let firstBoundX = firstTabInRow.screenX - firstMovingTabScreenX;
334
340
let firstBoundY = firstTabInRow.screenY - firstMovingTabScreenY;
335
341
let lastBoundX =
336
- @@ -2389,12 +2447 ,16 @@
342
+ @@ -2389,12 +2448 ,16 @@
337
343
338
344
this.#clearDragOverCreateGroupTimer();
339
345
@@ -354,7 +360,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
354
360
355
361
if (this.#rtlMode) {
356
362
tabs.reverse();
357
- @@ -2408,7 +2470 ,7 @@
363
+ @@ -2408,7 +2471 ,7 @@
358
364
let size = this.verticalMode ? "height" : "width";
359
365
let translateAxis = this.verticalMode ? "translateY" : "translateX";
360
366
let scrollDirection = this.verticalMode ? "scrollTop" : "scrollLeft";
@@ -363,7 +369,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
363
369
let translateX = event.screenX - dragData.screenX;
364
370
let translateY = event.screenY - dragData.screenY;
365
371
366
- @@ -2422,12 +2484 ,21 @@
372
+ @@ -2422,12 +2485 ,21 @@
367
373
let lastTab = tabs.at(-1);
368
374
let lastMovingTab = movingTabs.at(-1);
369
375
let firstMovingTab = movingTabs[0];
@@ -386,7 +392,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
386
392
translate +=
387
393
this.arrowScrollbox.scrollbox[scrollDirection] - dragData.scrollPos;
388
394
} else if (isPinned && this.verticalMode) {
389
- @@ -2446,6 +2517 ,9 @@
395
+ @@ -2446,6 +2518 ,9 @@
390
396
// Shift the `.tab-group-label-container` to shift the label element.
391
397
item = item.parentElement;
392
398
}
@@ -396,7 +402,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
396
402
item.style.transform = `${translateAxis}(${translate}px)`;
397
403
}
398
404
399
- @@ -2583,6 +2657 ,9 @@
405
+ @@ -2583,6 +2658 ,9 @@
400
406
break;
401
407
}
402
408
let element = tabs[mid];
@@ -406,7 +412,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
406
412
let elementForSize = isTabGroupLabel(element)
407
413
? element.parentElement
408
414
: element;
409
- @@ -2605,6 +2682 ,10 @@
415
+ @@ -2605,6 +2683 ,10 @@
410
416
if (!dropElement) {
411
417
dropElement = this.ariaFocusableItems[oldDropElementIndex];
412
418
}
@@ -417,7 +423,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
417
423
let newDropElementIndex = dropElement
418
424
? dropElement.elementIndex
419
425
: oldDropElementIndex;
420
- @@ -2613,7 +2694 ,7 @@
426
+ @@ -2613,7 +2695 ,7 @@
421
427
let shouldCreateGroupOnDrop;
422
428
let dropBefore;
423
429
if (dropElement) {
@@ -426,7 +432,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
426
432
? dropElement.parentElement
427
433
: dropElement;
428
434
429
- @@ -2675,12 +2756 ,12 @@
435
+ @@ -2675,12 +2757 ,12 @@
430
436
}
431
437
}
432
438
@@ -441,7 +447,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
441
447
dropElement != draggedTab &&
442
448
isTab(dropElement) &&
443
449
!dropElement?.group &&
444
- @@ -2720,7 +2801 ,7 @@
450
+ @@ -2720,7 +2802 ,7 @@
445
451
// Dropping right before the tab group.
446
452
dropElement = dropElementGroup;
447
453
colorCode = undefined;
@@ -450,7 +456,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
450
456
// Dropping right after the collapsed tab group.
451
457
dropElement = dropElementGroup;
452
458
colorCode = undefined;
453
- @@ -2750,7 +2831 ,7 @@
459
+ @@ -2750,7 +2832 ,7 @@
454
460
// Shift background tabs to leave a gap where the dragged tab
455
461
// would currently be dropped.
456
462
for (let item of tabs) {
@@ -459,7 +465,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
459
465
continue;
460
466
}
461
467
462
- @@ -2759,6 +2840 ,9 @@
468
+ @@ -2759,6 +2841 ,9 @@
463
469
if (isTabGroupLabel(item)) {
464
470
// Shift the `.tab-group-label-container` to shift the label element.
465
471
item = item.parentElement;
@@ -469,7 +475,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
469
475
}
470
476
item.style.transform = transform;
471
477
}
472
- @@ -2811,8 +2895 ,9 @@
478
+ @@ -2811,8 +2896 ,9 @@
473
479
);
474
480
}
475
481
@@ -481,7 +487,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
481
487
return;
482
488
}
483
489
484
- @@ -2824,6 +2909 ,12 @@
490
+ @@ -2824,6 +2910 ,12 @@
485
491
item = item.parentElement;
486
492
}
487
493
item.style.transform = "";
@@ -494,7 +500,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
494
500
item.removeAttribute("dragover-createGroup");
495
501
}
496
502
this.removeAttribute("movingtab-createGroup");
497
- @@ -2870,7 +2961 ,7 @@
503
+ @@ -2870,7 +2962 ,7 @@
498
504
let postTransitionCleanup = () => {
499
505
movingTab._moveTogetherSelectedTabsData.animate = false;
500
506
};
@@ -503,7 +509,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
503
509
postTransitionCleanup();
504
510
} else {
505
511
let onTransitionEnd = transitionendEvent => {
506
- @@ -3043,7 +3134 ,7 @@
512
+ @@ -3043,7 +3135 ,7 @@
507
513
}
508
514
509
515
_notifyBackgroundTab(aTab) {
@@ -512,7 +518,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..7cef57d99eca61f49968a128378d71c4
512
518
return;
513
519
}
514
520
515
- @@ -3169,6 +3260 ,9 @@
521
+ @@ -3169,6 +3261 ,9 @@
516
522
return null;
517
523
}
518
524
}
0 commit comments