Backed out 5 changesets (bug 1941175) for causing reftest failures @ details-display-inline.html CLOSED TREE
Backed out changeset e908e40ae014 (bug 1941175) Backed out changeset f0ddddc22390 (bug 1941175) Backed out changeset 7e16ac152467 (bug 1941175) Backed out changeset e5ff999da3c5 (bug 1941175) Backed out changeset 1509d43843a0 (bug 1941175)
This commit is contained in:
@@ -4176,9 +4176,8 @@ nsDOMWindowUtils::GetContentAPZTestData(
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMWindowUtils::GetCompositorAPZTestData(
|
||||
Element* aElement, JSContext* aContext,
|
||||
JS::MutableHandle<JS::Value> aOutCompositorTestData) {
|
||||
if (nsIWidget* widget = GetWidgetForElement(aElement)) {
|
||||
JSContext* aContext, JS::MutableHandle<JS::Value> aOutCompositorTestData) {
|
||||
if (nsIWidget* widget = GetWidget()) {
|
||||
WindowRenderer* renderer = widget->GetWindowRenderer();
|
||||
if (!renderer) {
|
||||
return NS_OK;
|
||||
@@ -4817,12 +4816,16 @@ nsDOMWindowUtils::IsCoepCredentialless(bool* aResult) {
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMWindowUtils::GetLayersId(Element* aElement, uint64_t* aOutLayersId) {
|
||||
nsIWidget* widget = GetWidgetForElement(aElement);
|
||||
nsDOMWindowUtils::GetLayersId(uint64_t* aOutLayersId) {
|
||||
nsIWidget* widget = GetWidget();
|
||||
if (!widget) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
*aOutLayersId = (uint64_t)widget->GetLayersId();
|
||||
BrowserChild* child = widget->GetOwningBrowserChild();
|
||||
if (!child) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
*aOutLayersId = (uint64_t)child->GetLayersId();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -2007,12 +2007,7 @@ interface nsIDOMWindowUtils : nsISupports {
|
||||
* The return values are of type APZTestData (see APZTestData.webidl).
|
||||
*/
|
||||
[implicit_jscontext] jsval getContentAPZTestData();
|
||||
|
||||
/*
|
||||
* |aElement| is an optional argument for popup window where APZ is enabled.
|
||||
* |aElement| would be a popup element for popup
|
||||
*/
|
||||
[implicit_jscontext] jsval getCompositorAPZTestData([optional] in Element aElement);
|
||||
[implicit_jscontext] jsval getCompositorAPZTestData();
|
||||
|
||||
/**
|
||||
* Posts an RestyleHint::RESTYLE_SELF restyle event for the given element.
|
||||
@@ -2314,9 +2309,7 @@ interface nsIDOMWindowUtils : nsISupports {
|
||||
|
||||
void syncFlushCompositor();
|
||||
|
||||
// |aElement| is an optional argument for popup window where APZ is enabled.
|
||||
// |aElement| would be a popup element for popup.
|
||||
unsigned long long getLayersId([optional] in Element aElement);
|
||||
unsigned long long getLayersId();
|
||||
|
||||
// Returns true if we are effectively throttling frame requests.
|
||||
readonly attribute boolean effectivelyThrottlesFrameRequests;
|
||||
|
||||
@@ -1215,12 +1215,11 @@ async function cancelScrollAnimation(aElement, aWindow = window) {
|
||||
await aWindow.promiseApzFlushedRepaints();
|
||||
}
|
||||
|
||||
function collectSampledScrollOffsets(aElement, aPopupElement = null) {
|
||||
let data =
|
||||
SpecialPowers.DOMWindowUtils.getCompositorAPZTestData(aPopupElement);
|
||||
function collectSampledScrollOffsets(aElement) {
|
||||
let data = SpecialPowers.DOMWindowUtils.getCompositorAPZTestData();
|
||||
let sampledResults = data.sampledResults;
|
||||
|
||||
const layersId = SpecialPowers.DOMWindowUtils.getLayersId(aPopupElement);
|
||||
const layersId = SpecialPowers.DOMWindowUtils.getLayersId();
|
||||
const scrollId = SpecialPowers.DOMWindowUtils.getViewId(aElement);
|
||||
|
||||
return sampledResults.filter(
|
||||
|
||||
@@ -54,12 +54,6 @@ skip-if = [
|
||||
["browser_test_mousemove_optimization.js"]
|
||||
skip-if = ["display == 'wayland' && os_version == '22.04'"] # Bug 1857059
|
||||
|
||||
["browser_test_paint_skip_in_popup.js"]
|
||||
support-files = ["helper_paint_skip_in_popup.html"]
|
||||
skip-if = [
|
||||
"os == 'mac'", # On Mac popup windows having no remote content doesn't have the compositor
|
||||
]
|
||||
|
||||
["browser_test_popup_menu_in_parent_process.js"]
|
||||
support-files = [
|
||||
"helper_popup_menu_in_parent_process-1.html",
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
Services.scriptloader.loadSubScript(
|
||||
"chrome://mochikit/content/tests/SimpleTest/paint_listener.js",
|
||||
this
|
||||
);
|
||||
|
||||
Services.scriptloader.loadSubScript(
|
||||
new URL("apz_test_utils.js", gTestPath).href,
|
||||
this
|
||||
);
|
||||
|
||||
/* import-globals-from helper_browser_test_utils.js */
|
||||
// For openSelectPopup.
|
||||
Services.scriptloader.loadSubScript(
|
||||
new URL("helper_browser_test_utils.js", gTestPath).href,
|
||||
this
|
||||
);
|
||||
|
||||
// Cleanup for paint_listener.js.
|
||||
add_task(() => {
|
||||
registerCleanupFunction(() => {
|
||||
delete window.waitForAllPaintsFlushed;
|
||||
delete window.waitForAllPaints;
|
||||
delete window.promiseAllPaintsDone;
|
||||
});
|
||||
});
|
||||
|
||||
// Setup preferences.
|
||||
add_task(async () => {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
["apz.popups.enabled", true],
|
||||
["apz.popups_without_remote.enabled", true],
|
||||
["apz.test.logging_enabled", true],
|
||||
["layout.scroll.disable-pixel-alignment", true],
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async () => {
|
||||
function httpURL(filename) {
|
||||
let chromeURL = getRootDirectory(gTestPath) + filename;
|
||||
return chromeURL.replace(
|
||||
"chrome://mochitests/content/",
|
||||
"http://mochi.test:8888/"
|
||||
);
|
||||
}
|
||||
const url = httpURL("helper_paint_skip_in_popup.html");
|
||||
const tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, url);
|
||||
|
||||
await SpecialPowers.spawn(tab.linkedBrowser, [], async () => {
|
||||
await content.wrappedJSObject.promiseApzFlushedRepaints();
|
||||
await content.wrappedJSObject.waitUntilApzStable();
|
||||
});
|
||||
|
||||
// Focus to the select element. This stuff is necessary for `openSelectPopup()`
|
||||
// since the function is triggered on the focused element.
|
||||
await SpecialPowers.spawn(tab.linkedBrowser, [], async () => {
|
||||
const select = content.document.querySelector("select");
|
||||
const focusPromise = new Promise(resolve => {
|
||||
select.addEventListener("focus", resolve, { once: true });
|
||||
});
|
||||
select.focus();
|
||||
await focusPromise;
|
||||
});
|
||||
|
||||
// Open the select popup.
|
||||
const selectPopup = await openSelectPopup();
|
||||
|
||||
const arrowscrollbox = selectPopup.shadowRoot.querySelector("arrowscrollbox");
|
||||
ok(arrowscrollbox, "There's <arrowscrollbox> inside the popup");
|
||||
|
||||
const scrollbox = arrowscrollbox.shadowRoot.querySelector("scrollbox");
|
||||
ok(scrollbox, "There's <scrollbox> inside the popup");
|
||||
|
||||
// Scroll down as much as possible to get the max scroll offset.
|
||||
scrollbox.scrollTo(0, 100000);
|
||||
const scrollMax = scrollbox.scrollTop;
|
||||
ok(scrollMax, "The max scroll offset should not be zero");
|
||||
|
||||
// Restore the scroll offset.
|
||||
// Note that this restoring needs to be done in the same paint where the above scrollTo happened so that
|
||||
// APZ will never sample the max scroll offset at this moment.
|
||||
scrollbox.scrollTo(0, 0);
|
||||
await promiseApzFlushedRepaints(selectPopup);
|
||||
|
||||
// Now scroll to a position which is close to the bottom.
|
||||
scrollbox.scrollBy(0, scrollMax - 10);
|
||||
await promiseApzFlushedRepaints(selectPopup);
|
||||
|
||||
// Try to scroll to the bottom with a `scrollBy` call, even if paint-skip
|
||||
// is enabled, this scroll operation should be reflected to APZ.
|
||||
scrollbox.scrollBy(0, 10);
|
||||
|
||||
// Wait a bit to make sure that APZ has sampled the new scroll offset.
|
||||
await promiseApzFlushedRepaints(selectPopup);
|
||||
await promiseApzFlushedRepaints(selectPopup);
|
||||
|
||||
is(
|
||||
scrollbox.scrollTop,
|
||||
scrollMax,
|
||||
`The scroll offset: ${scrollbox.scrollTop} on the main-thread should be ${scrollMax}`
|
||||
);
|
||||
|
||||
const sampledData = collectSampledScrollOffsets(scrollbox, selectPopup);
|
||||
ok(sampledData.length, "There should be at least one collected offsets");
|
||||
ok(
|
||||
sampledData.some(
|
||||
data => SpecialPowers.wrap(data).scrollOffsetY == scrollMax
|
||||
),
|
||||
`There should be ${scrollMax} in [${sampledData.map(data => SpecialPowers.wrap(data).scrollOffsetY)}]`
|
||||
);
|
||||
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
});
|
||||
@@ -1,33 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script src='/tests/SimpleTest/paint_listener.js'></script>
|
||||
<script src='apz_test_utils.js'></script>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Dropdown with 1000 Random Items</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Dropdown with 1000 Random Elements</h1>
|
||||
<select id="randomDropdown">
|
||||
</select>
|
||||
|
||||
<script>
|
||||
// Generate 100 random items and populate the dropdown
|
||||
const dropdown = document.getElementById('randomDropdown');
|
||||
|
||||
for (let i = 1; i <= 100; i++) {
|
||||
const option = document.createElement('option');
|
||||
option.value = `Item${i}`;
|
||||
option.textContent = `Random Item ${i}: ${Math.random().toFixed(5)}`;
|
||||
dropdown.appendChild(option);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
<script>
|
||||
// Silence SimpleTest warning about missing assertions by having it wait
|
||||
// indefinitely.
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
</script>
|
||||
</html>
|
||||
@@ -3160,7 +3160,7 @@ void ScrollContainerFrame::ScrollToImpl(
|
||||
schedulePaint = false;
|
||||
PAINT_SKIP_LOG("Skipping due to APZ scroll\n");
|
||||
} else if (mScrollableByAPZ) {
|
||||
nsIWidget* widget = GetNearestWidget();
|
||||
nsIWidget* widget = presContext->GetNearestWidget();
|
||||
WindowRenderer* renderer =
|
||||
widget ? widget->GetWindowRenderer() : nullptr;
|
||||
if (renderer) {
|
||||
|
||||
@@ -1125,9 +1125,5 @@ nsresult PuppetWidget::GetSystemFont(nsCString& aFontName) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
LayersId PuppetWidget::GetLayersId() const {
|
||||
return mBrowserChild ? mBrowserChild->GetLayersId() : LayersId{0};
|
||||
}
|
||||
|
||||
} // namespace widget
|
||||
} // namespace mozilla
|
||||
|
||||
@@ -196,7 +196,6 @@ class PuppetWidget final : public nsBaseWidget,
|
||||
void PaintNowIfNeeded();
|
||||
|
||||
BrowserChild* GetOwningBrowserChild() override { return mBrowserChild; }
|
||||
LayersId GetLayersId() const override;
|
||||
|
||||
void UpdateBackingScaleCache(float aDpi, int32_t aRounding, double aScale) {
|
||||
mDPI = aDpi;
|
||||
|
||||
@@ -2494,11 +2494,6 @@ bool nsBaseWidget::MayStartSwipeForNonAPZ(const PanGestureInput& aPanInput) {
|
||||
return true;
|
||||
}
|
||||
|
||||
LayersId nsBaseWidget::GetLayersId() const {
|
||||
return mCompositorSession ? mCompositorSession->RootLayerTreeId()
|
||||
: LayersId{0};
|
||||
}
|
||||
|
||||
const IMENotificationRequests& nsIWidget::IMENotificationRequestsRef() {
|
||||
TextEventDispatcher* dispatcher = GetTextEventDispatcher();
|
||||
return dispatcher->IMENotificationRequestsRef();
|
||||
|
||||
@@ -200,7 +200,6 @@ class nsBaseWidget : public nsIWidget, public nsSupportsWeakReference {
|
||||
nsresult MakeFullScreen(bool aFullScreen) override;
|
||||
void InfallibleMakeFullScreen(bool aFullScreen);
|
||||
|
||||
LayersId GetLayersId() const override;
|
||||
WindowRenderer* GetWindowRenderer() override;
|
||||
bool HasWindowRenderer() const final { return !!mWindowRenderer; }
|
||||
|
||||
|
||||
@@ -1887,11 +1887,6 @@ class nsIWidget : public nsISupports {
|
||||
*/
|
||||
virtual BrowserChild* GetOwningBrowserChild() { return nullptr; }
|
||||
|
||||
/*
|
||||
* Returns the layersId for this widget.
|
||||
*/
|
||||
virtual LayersId GetLayersId() const = 0;
|
||||
|
||||
/**
|
||||
* If this isn't directly compositing to its window surface,
|
||||
* return the compositor which is doing that on our behalf.
|
||||
|
||||
Reference in New Issue
Block a user