perf: Stop flushing document styles when switching spaces, b=bug #11851, c=glance, workspaces

This commit is contained in:
mr. m
2026-01-10 13:00:27 +01:00
parent 818b2d1af5
commit 44a28e2afe
2 changed files with 9 additions and 26 deletions

View File

@@ -685,8 +685,8 @@ class nsZenWorkspaces {
const delta = event.delta * 300;
const stripWidth =
document.getElementById('navigator-toolbox').getBoundingClientRect().width +
document.getElementById('zen-sidebar-splitter').getBoundingClientRect().width * 2;
window.windowUtils.getBoundsWithoutFlushing(document.getElementById('navigator-toolbox')).width +
window.windowUtils.getBoundsWithoutFlushing(document.getElementById('zen-sidebar-splitter')).width * 2;
let translateX = this._swipeState.lastDelta + delta;
// Add a force multiplier as we are translating the strip depending on how close to the edge we are
let forceMultiplier = Math.min(1, 1 - Math.abs(translateX) / (stripWidth * 4.5)); // 4.5 instead of 4 to add a bit of a buffer
@@ -1681,7 +1681,7 @@ class nsZenWorkspaces {
!(this.#inChangingWorkspace && !forAnimation && !this._alwaysAnimatePaddingTop)
) {
delete this._alwaysAnimatePaddingTop;
const essentialsHeight = essentialContainer.getBoundingClientRect().height;
const essentialsHeight = window.windowUtils.getBoundsWithoutFlushing(essentialContainer).height;
if (!forAnimation && animateContainer && gZenUIManager.motion && gZenStartup.isReady) {
gZenUIManager.motion.animate(
workspaceElement,