Bug 1625464 - Invert the logic of the `notoverflowing` attribute. r=ntim

Differential Revision: https://phabricator.services.mozilla.com/D68563

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Dão Gottwald 2020-03-27 14:24:10 +00:00
Родитель 9b911ee291
Коммит 44b994fa2c
4 изменённых файлов: 12 добавлений и 15 удалений

Просмотреть файл

@ -24,7 +24,7 @@ add_task(async function withoutLWT() {
"tab container not overflowing"
);
ok(
win.gBrowser.tabContainer.arrowScrollbox.hasAttribute("notoverflowing"),
!win.gBrowser.tabContainer.arrowScrollbox.hasAttribute("overflowing"),
"arrow scrollbox not overflowing"
);
await BrowserTestUtils.closeWindow(win);
@ -38,7 +38,7 @@ add_task(async function withLWT() {
"tab container not overflowing"
);
ok(
win.gBrowser.tabContainer.arrowScrollbox.hasAttribute("notoverflowing"),
!win.gBrowser.tabContainer.arrowScrollbox.hasAttribute("overflowing"),
"arrow scrollbox not overflowing"
);
await BrowserTestUtils.closeWindow(win);

Просмотреть файл

@ -50,7 +50,7 @@ add_task(async function() {
});
ok(
!scrollbox.hasAttribute("notoverflowing"),
arrowScrollbox.hasAttribute("overflowing"),
"Tab strip should be overflowing"
);

Просмотреть файл

@ -143,7 +143,7 @@
);
}
this.setAttribute("notoverflowing", "true");
this.removeAttribute("overflowing");
this.initializeAttributeInheritance();
this._updateScrollButtonsDisabledState();
}
@ -557,7 +557,7 @@
}
_updateScrollButtonsDisabledState() {
if (this.hasAttribute("notoverflowing")) {
if (!this.hasAttribute("overflowing")) {
this.setAttribute("scrolledtoend", "true");
this.setAttribute("scrolledtostart", "true");
return;
@ -582,7 +582,7 @@
let scrolledToStart = false;
let scrolledToEnd = false;
if (this.hasAttribute("notoverflowing")) {
if (!this.hasAttribute("overflowing")) {
scrolledToStart = true;
scrolledToEnd = true;
} else {
@ -645,7 +645,7 @@
on_wheel(event) {
// Don't consume the event if we can't scroll.
if (this.hasAttribute("notoverflowing")) {
if (!this.hasAttribute("overflowing")) {
return;
}
@ -750,10 +750,7 @@
// Ignore underflow events:
// - from nested scrollable elements
// - corresponding to an overflow event that we ignored
if (
event.target != this.scrollbox ||
this.hasAttribute("notoverflowing")
) {
if (event.target != this.scrollbox || !this.hasAttribute("overflowing")) {
return;
}
@ -771,7 +768,7 @@
return;
}
this.setAttribute("notoverflowing", "true");
this.removeAttribute("overflowing");
this._updateScrollButtonsDisabledState();
}
@ -796,7 +793,7 @@
return;
}
this.removeAttribute("notoverflowing");
this.setAttribute("overflowing", "true");
this._updateScrollButtonsDisabledState();
}

Просмотреть файл

@ -6,8 +6,8 @@
:host([scrolledtostart=true])::part(overflow-start-indicator),
:host([scrolledtoend=true])::part(overflow-end-indicator),
:host([notoverflowing=true]) .scrollbutton-up,
:host([notoverflowing=true]) .scrollbutton-down {
:host(:not([overflowing=true])) .scrollbutton-up,
:host(:not([overflowing=true])) .scrollbutton-down {
visibility: collapse;
}