Added fix for mozbz#1447775 - wrong dropspace sizing.

This commit is contained in:
Martin Stransky 2018-10-09 16:03:26 +02:00
parent dbbd17cd61
commit f4af4b70b2
2 changed files with 75 additions and 2 deletions

View File

@ -94,7 +94,7 @@
Summary: Mozilla Firefox Web browser
Name: firefox
Version: 62.0.3
Release: 3%{?pre_tag}%{?dist}
Release: 4%{?pre_tag}%{?dist}
URL: https://www.mozilla.org/firefox/
License: MPLv1.1 or GPLv2+ or LGPLv2+
Source0: https://hg.mozilla.org/releases/mozilla-release/archive/firefox-%{version}%{?pre_version}.source.tar.xz
@ -152,6 +152,7 @@ Patch416: mozilla-1424422.patch
Patch417: bug1375074-save-restore-x28.patch
Patch419: rb244676.patch
Patch420: rb246462.patch
Patch421: mozilla-1447775.patch
# Wayland specific upstream patches
Patch572: mozilla-1467128.patch
@ -351,11 +352,11 @@ This package contains results of tests executed during build.
%endif
%patch419 -p1 -b .rb244676
%patch420 -p1 -b .rb246462
# Patch for big endian platforms only
%if 0%{?big_endian}
%patch26 -p1 -b .icu
%endif
%patch421 -p1 -b .1447775
# Wayland specific upstream patches
%patch572 -p1 -b .1467128
@ -889,6 +890,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
#---------------------------------------------------------------------
%changelog
* Tue Oct 9 2018 Martin Stransky <stransky@redhat.com> - 62.0.3-4
- Added fix for mozbz#1447775 - wrong dropspace sizing.
* Tue Oct 9 2018 Martin Stransky <stransky@redhat.com> - 62.0.3-3
- Added fix for mozbz#1493081 - popups incorrectly placed and sized.

69
mozilla-1447775.patch Normal file
View File

@ -0,0 +1,69 @@
# HG changeset patch
# User Martin Stransky <stransky@redhat.com>
# Date 1523525760 -7200
# Node ID 6654f42bc0e615e3fd2328d23b4a2283cad9ad45
# Parent b4bc6b2401738b78fd47127a4c716bb9178e1a09
Bug 1447775 - Change persist mode immediately after sizemodechange change, r?jimm
Recently the window sizemode attribute is updated with 500ms delay (on Linux). It causes race condition
between reflow/CSS rule and window resize callbacks and also causes visual glitch when toolbar dragspace
is enabled.
TabsToolbar height is used at resize callback to do dragspace calculation. It has old values here
because it depends on 'window[sizemode="normal"] #TabsToolbar' css rule which is applied with 500ms delay.
So we use old TabsToolbar height for the dragspace, then the sizemode us updated by PersistenceTimer and
a new TabsToolbar height is calculated but the dragspace size stays as we're not notified
about the TabsToolbar height update.
MozReview-Commit-ID: AiensY5LMDO
diff --git a/xpfe/appshell/nsWebShellWindow.cpp b/xpfe/appshell/nsWebShellWindow.cpp
--- a/xpfe/appshell/nsWebShellWindow.cpp
+++ b/xpfe/appshell/nsWebShellWindow.cpp
@@ -350,20 +350,16 @@ nsWebShellWindow::SizeModeChanged(nsSize
if (sizeMode == nsSizeMode_Maximized || sizeMode == nsSizeMode_Fullscreen) {
uint32_t zLevel;
GetZLevel(&zLevel);
if (zLevel > nsIXULWindow::normalZ)
SetZLevel(nsIXULWindow::normalZ);
}
mWindow->SetSizeMode(sizeMode);
- // Persist mode, but not immediately, because in many (all?)
- // cases this will merge with the similar call in NS_SIZE and
- // write the attribute values only once.
- SetPersistenceTimer(PAD_MISC);
nsCOMPtr<nsPIDOMWindowOuter> ourWindow =
mDocShell ? mDocShell->GetWindow() : nullptr;
if (ourWindow) {
// Ensure that the fullscreen state is synchronized between
// the widget and the outer window object.
if (sizeMode == nsSizeMode_Fullscreen) {
ourWindow->SetFullScreen(true);
}
@@ -384,16 +380,22 @@ nsWebShellWindow::SizeModeChanged(nsSize
ourWindow->DispatchCustomEvent(NS_LITERAL_STRING("sizemodechange"));
}
nsIPresShell* presShell;
if ((presShell = GetPresShell())) {
presShell->GetPresContext()->SizeModeChanged(sizeMode);
}
+ // Persist mode immediately as the timer causes race condition
+ // between css rules dependent on window sizemode and
+ // sizemodechange/resize listener which calculates TabsToolbar height.
+ PersistentAttributesDirty(PAD_MISC);
+ SavePersistentAttributes();
+
// Note the current implementation of SetSizeMode just stores
// the new state; it doesn't actually resize. So here we store
// the state and pass the event on to the OS. The day is coming
// when we'll handle the event here, and the return result will
// then need to be different.
}
void