From 428aa75e35f8f75a75de8d8f4f67c9bd9f7906de Mon Sep 17 00:00:00 2001 From: Natalia Csoregi Date: Wed, 9 Aug 2023 15:47:03 +0300 Subject: [PATCH] Backed out 3 changesets (bug 1847584) for causing vsync failures. CLOSED TREE Backed out changeset bdfc3c7388cf (bug 1847584) Backed out changeset 54b34c76db47 (bug 1847584) Backed out changeset 03bf43b4ae07 (bug 1847584) --- .../base/content/test/performance/browser.ini | 1 - .../browser_hidden_browser_vsync.js | 56 ------------------- docshell/base/BrowsingContext.cpp | 8 +-- dom/base/Document.cpp | 8 +-- dom/base/test/test_bug1639328.html | 30 +++------- dom/base/test/test_bug1730284.html | 2 +- dom/ipc/BrowserChild.cpp | 53 ++++++------------ dom/ipc/BrowserChild.h | 6 +- 8 files changed, 31 insertions(+), 133 deletions(-) delete mode 100644 browser/base/content/test/performance/browser_hidden_browser_vsync.js diff --git a/browser/base/content/test/performance/browser.ini b/browser/base/content/test/performance/browser.ini index ab7e6124ffd6..b88e82c7d651 100644 --- a/browser/base/content/test/performance/browser.ini +++ b/browser/base/content/test/performance/browser.ini @@ -29,7 +29,6 @@ skip-if = debug os == "win" # Bug 1775626 os == "linux" && socketprocess_networking # Bug 1382809, bug 1369959 -[browser_hidden_browser_vsync.js] [browser_panel_vsync.js] support-files = !/browser/components/downloads/test/browser/head.js diff --git a/browser/base/content/test/performance/browser_hidden_browser_vsync.js b/browser/base/content/test/performance/browser_hidden_browser_vsync.js deleted file mode 100644 index ffd5ad8adedb..000000000000 --- a/browser/base/content/test/performance/browser_hidden_browser_vsync.js +++ /dev/null @@ -1,56 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -add_task(async function test_hidden_sidebar() { - let b = document.createXULElement("browser"); - for (let [k, v] of Object.entries({ - type: "content", - disablefullscreen: "true", - disablehistory: "true", - flex: "1", - style: "min-width: 300px", - message: "true", - remote: "true", - maychangeremoteness: "true", - })) { - b.setAttribute(k, v); - } - let mainBrowser = gBrowser.selectedBrowser; - let panel = gBrowser.getPanel(mainBrowser); - panel.append(b); - let loaded = BrowserTestUtils.browserLoaded(b); - BrowserTestUtils.loadURIString( - b, - `data:text/html, -
` - ); - await loaded; - ok(b, "Browser was created."); - await SpecialPowers.spawn(b, [], async () => { - await new Promise(r => - content.requestAnimationFrame(() => content.requestAnimationFrame(r)) - ); - }); - b.hidden = true; - ok(b.hidden, "Browser should be hidden."); - // Now the framework will test to see vsync goes away -}); diff --git a/docshell/base/BrowsingContext.cpp b/docshell/base/BrowsingContext.cpp index a46643fd51e5..0d3e064f8164 100644 --- a/docshell/base/BrowsingContext.cpp +++ b/docshell/base/BrowsingContext.cpp @@ -3534,15 +3534,11 @@ void BrowsingContext::DidSet(FieldIndex, if (!shell) { return; } + const bool newValue = IsUnderHiddenEmbedderElement(); if (NS_WARN_IF(aOldValue == newValue)) { return; } - - if (auto* bc = BrowserChild::GetFrom(shell)) { - bc->UpdateVisibility(); - } - if (PresShell* presShell = shell->GetPresShell()) { presShell->SetIsUnderHiddenEmbedderElement(newValue); } @@ -3561,7 +3557,7 @@ void BrowsingContext::DidSet(FieldIndex, } bool embedderFrameIsHidden = true; - if (auto* embedderFrame = embedderElement->GetPrimaryFrame()) { + if (auto embedderFrame = embedderElement->GetPrimaryFrame()) { embedderFrameIsHidden = !embedderFrame->StyleVisibility()->IsVisible(); } diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp index 9edcd2f1eb26..e9e3ca57ae05 100644 --- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp @@ -7098,12 +7098,6 @@ bool Document::ShouldThrottleFrameRequests() const { return true; } - if (mPresShell->IsUnderHiddenEmbedderElement()) { - // For display: none and visibility: hidden we always throttle, for - // consistency with OOP iframes. - return true; - } - Element* el = GetEmbedderElement(); if (!el) { // If we're not in-process, our refresh driver is throttled separately (via @@ -7121,7 +7115,7 @@ bool Document::ShouldThrottleFrameRequests() const { // acceptable / unlikely to be human-perceivable, though we could improve on // it if needed by adding an intersection margin or something of that sort. const IntersectionInput input = DOMIntersectionObserver::ComputeInput( - *el->OwnerDoc(), /* aRoot = */ nullptr, /* aRootMargin = */ nullptr); + *el->OwnerDoc(), /* aRoot = */ nullptr, /* aMargin = */ nullptr); const IntersectionOutput output = DOMIntersectionObserver::Intersect(input, *el); return !output.Intersects(); diff --git a/dom/base/test/test_bug1639328.html b/dom/base/test/test_bug1639328.html index a34326a065ec..f7d88de5a4dd 100644 --- a/dom/base/test/test_bug1639328.html +++ b/dom/base/test/test_bug1639328.html @@ -16,9 +16,6 @@ - - -