зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1259641 - Do not force reflow for all tabs when size mode changed. r=smaug
MozReview-Commit-ID: GoTCM60Hmlf --HG-- extra : transplant_source : S%88%AD%A3%99%9Bk%D3%E4U%0302%82%87o3%28%FFK
This commit is contained in:
Родитель
e5a1d1af80
Коммит
daa8e38158
|
@ -1655,13 +1655,15 @@ bool
|
||||||
TabChild::RecvSizeModeChanged(const nsSizeMode& aSizeMode)
|
TabChild::RecvSizeModeChanged(const nsSizeMode& aSizeMode)
|
||||||
{
|
{
|
||||||
mPuppetWidget->SetSizeMode(aSizeMode);
|
mPuppetWidget->SetSizeMode(aSizeMode);
|
||||||
|
if (!mPuppetWidget->IsVisible()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
nsCOMPtr<nsIDocument> document(GetDocument());
|
nsCOMPtr<nsIDocument> document(GetDocument());
|
||||||
nsCOMPtr<nsIPresShell> presShell = document->GetShell();
|
nsCOMPtr<nsIPresShell> presShell = document->GetShell();
|
||||||
if (presShell) {
|
if (presShell) {
|
||||||
nsPresContext* presContext = presShell->GetPresContext();
|
nsPresContext* presContext = presShell->GetPresContext();
|
||||||
if (presContext) {
|
if (presContext) {
|
||||||
presContext->MediaFeatureValuesChangedAllDocuments(eRestyle_Subtree,
|
presContext->SizeModeChanged(aSizeMode);
|
||||||
NS_STYLE_HINT_REFLOW);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -328,6 +328,9 @@ GetDisplayMode(nsPresContext* aPresContext, const nsMediaFeature*,
|
||||||
baseWindow->GetMainWidget(getter_AddRefs(mainWidget));
|
baseWindow->GetMainWidget(getter_AddRefs(mainWidget));
|
||||||
int32_t displayMode;
|
int32_t displayMode;
|
||||||
nsSizeMode mode = mainWidget ? mainWidget->SizeMode() : nsSizeMode_Normal;
|
nsSizeMode mode = mainWidget ? mainWidget->SizeMode() : nsSizeMode_Normal;
|
||||||
|
// Background tabs are always in 'browser' mode for now.
|
||||||
|
// If new modes are supported, please ensure not cause the regression in
|
||||||
|
// Bug 1259641.
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case nsSizeMode_Fullscreen:
|
case nsSizeMode_Fullscreen:
|
||||||
displayMode = NS_STYLE_DISPLAY_MODE_FULLSCREEN;
|
displayMode = NS_STYLE_DISPLAY_MODE_FULLSCREEN;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче