Backed out changeset 7fa771d9f62d (bug 1695472) for causing bc failures in browser_bug1620341.js (Bug 1714691)

This commit is contained in:
Alexandru Michis 2021-06-05 11:03:34 +03:00
parent abbada0553
commit f2f6bad653
2 changed files with 9 additions and 26 deletions

View File

@ -85,16 +85,7 @@
GetDynamicShortcutTooltipText("tabs-newtab-button")
);
let handleResize = () => {
this._updateCloseButtons();
this._handleTabSelect(true);
};
this._resizeObserver = new ResizeObserver(handleResize);
this._resizeObserver.observe(document.documentElement);
this._fullscreenMutationObserver = new MutationObserver(handleResize);
this._fullscreenMutationObserver.observe(document.documentElement, {
attributeFilter: ["inFullscreen", "inDOMFullscreen"],
});
window.addEventListener("resize", this);
this.boundObserve = (...args) => this.observe(...args);
Services.prefs.addObserver("privacy.userContext", this.boundObserve);
@ -1739,6 +1730,14 @@
handleEvent(aEvent) {
switch (aEvent.type) {
case "resize":
if (aEvent.target != window) {
break;
}
this._updateCloseButtons();
this._handleTabSelect(true);
break;
case "mouseout":
// If the "related target" (the node to which the pointer went) is not
// a child of the current document, the mouse just left the window.

View File

@ -27,12 +27,6 @@ add_task(async function test_fullscreen_cross_origin() {
() => !document.documentElement.hasAttribute("inDOMFullscreen")
);
let tabbrowser = browser.ownerDocument.querySelector("#tabbrowser-tabs");
ok(
!tabbrowser.hasAttribute("closebuttons"),
"Close buttons should be visible on every tab"
);
// Request fullscreen from iframe
await SpecialPowers.spawn(browser, [], async function() {
let frame = content.document.getElementById("frameAllowed");
@ -58,11 +52,6 @@ add_task(async function test_fullscreen_cross_origin() {
await TestUtils.waitForCondition(() =>
document.documentElement.hasAttribute("inDOMFullscreen")
);
ok(
tabbrowser.hasAttribute("closebuttons"),
"Close buttons should be visible only on the active tab (tabs have width=0 so closebuttons gets set on them)"
);
});
}
@ -96,11 +85,6 @@ add_task(async function test_fullscreen_cross_origin() {
() => !document.documentElement.hasAttribute("inDOMFullscreen")
);
ok(
!gBrowser.tabContainer.hasAttribute("closebuttons"),
"Close buttons should come back to every tab"
);
// Remove the remaining tab and leave the test.
let tabClosed = BrowserTestUtils.waitForTabClosing(tab1);
BrowserTestUtils.removeTab(tab1);