Merge remote-tracking branch 'origin/tracking' into custom

This commit is contained in:
roytam1 2023-03-02 14:52:54 +08:00
commit 33981efb44
15 changed files with 231 additions and 70 deletions

View file

@ -39,12 +39,24 @@
display: -moz-box;
}
.tab-label[pinned] {
.tab-label {
white-space: nowrap;
}
.tab-label-container {
overflow: hidden;
}
.tab-label-container[pinned] {
width: 0;
margin-left: 0 !important;
margin-right: 0 !important;
padding-left: 0 !important;
padding-right: 0 !important;
}
.tab-label-container[textoverflow]:not([pinned]) {
mask-image: linear-gradient(to left, transparent, black 1em);
}
.tab-label-container[textoverflow]:not([pinned]):-moz-locale-dir(rtl) {
mask-image: linear-gradient(to right, transparent, black 1em);
}
.tab-stack {

View file

@ -1400,8 +1400,7 @@
<body>
<![CDATA[
aTab.label = this.mStringBundle.getString("tabs.connecting");
aTab.crop = "end";
this._tabAttrModified(aTab, ["label", "crop"]);
this._tabAttrModified(aTab, ["label"]);
]]>
</body>
</method>
@ -1411,7 +1410,6 @@
<body>
<![CDATA[
var browser = this.getBrowserForTab(aTab);
var crop = "end";
var title = browser.contentTitle;
if (!title) {
@ -1433,9 +1431,6 @@
.getService(Components.interfaces.nsITextToSubURI);
title = textToSubURI.unEscapeNonAsciiURI(characterSet, title);
} catch (ex) { /* Do nothing. */ }
crop = "center";
} else if (aTab.hasAttribute("customizemode")) {
let brandBundle = document.getElementById("bundle_brand");
let brandShortName = brandBundle.getString("brandShortName");
@ -1445,13 +1440,11 @@
title = this.mStringBundle.getString("tabs.emptyTabTitle");
}
if (aTab.label == title &&
aTab.crop == crop)
if (aTab.label == title)
return false;
aTab.label = title;
aTab.crop = crop;
this._tabAttrModified(aTab, ["label", "crop"]);
this._tabAttrModified(aTab, ["label"]);
if (aTab.selected)
this.updateTitlebar();
@ -2151,7 +2144,6 @@
ContextualIdentityService.setTabStyle(t);
}
t.setAttribute("crop", "end");
t.setAttribute("onerror", "this.removeAttribute('image');");
if (aSkipBackgroundNotify) {
@ -5175,6 +5167,9 @@
<handlers>
<handler event="underflow" phase="capturing"><![CDATA[
if (event.target != this)
return;
if (event.detail == 0)
return; // Ignore vertical events
@ -5190,6 +5185,9 @@
tabs._positionPinnedTabs();
]]></handler>
<handler event="overflow"><![CDATA[
if (event.target != this)
return;
if (event.detail == 0)
return; // Ignore vertical events
@ -5243,7 +5241,6 @@
var tab = this.firstChild;
tab.label = this.tabbrowser.mStringBundle.getString("tabs.emptyTabTitle");
tab.setAttribute("crop", "end");
tab.setAttribute("onerror", "this.removeAttribute('image');");
window.addEventListener("resize", this, false);
@ -6545,10 +6542,15 @@
anonid="overlay-icon"
class="tab-icon-overlay"
role="presentation"/>
<xul:label flex="1"
xbl:inherits="value=label,crop,accesskey,fadein,pinned,selected=visuallyselected,attention"
class="tab-text tab-label"
role="presentation"/>
<xul:hbox class="tab-label-container"
xbl:inherits="pinned,selected=visuallyselected"
onoverflow="this.setAttribute('textoverflow', 'true');"
onunderflow="this.removeAttribute('textoverflow');"
flex="1">
<xul:label class="tab-text tab-label"
xbl:inherits="xbl:text=label,accesskey,fadein,pinned,selected=visuallyselected,attention"
role="presentation"/>
</xul:hbox>
<xul:image xbl:inherits="soundplaying,soundplaying-scheduledremoval,pinned,muted,blocked,selected=visuallyselected"
anonid="soundplaying-icon"
class="tab-icon-sound"
@ -6925,7 +6927,7 @@
<parameter name="aTab"/>
<body><![CDATA[
aMenuitem.setAttribute("label", aTab.label);
aMenuitem.setAttribute("crop", aTab.getAttribute("crop"));
aMenuitem.setAttribute("crop", "end");
if (aTab.hasAttribute("busy")) {
aMenuitem.setAttribute("busy", aTab.getAttribute("busy"));