mirror of
https://github.com/zen-browser/desktop.git
synced 2026-03-30 04:11:51 +00:00
perf: Stop flushing document styles when switching spaces, b=bug #11851, c=glance, workspaces
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user