зеркало из 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)
|
||||
{
|
||||
mPuppetWidget->SetSizeMode(aSizeMode);
|
||||
if (!mPuppetWidget->IsVisible()) {
|
||||
return true;
|
||||
}
|
||||
nsCOMPtr<nsIDocument> document(GetDocument());
|
||||
nsCOMPtr<nsIPresShell> presShell = document->GetShell();
|
||||
if (presShell) {
|
||||
nsPresContext* presContext = presShell->GetPresContext();
|
||||
if (presContext) {
|
||||
presContext->MediaFeatureValuesChangedAllDocuments(eRestyle_Subtree,
|
||||
NS_STYLE_HINT_REFLOW);
|
||||
presContext->SizeModeChanged(aSizeMode);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -328,6 +328,9 @@ GetDisplayMode(nsPresContext* aPresContext, const nsMediaFeature*,
|
|||
baseWindow->GetMainWidget(getter_AddRefs(mainWidget));
|
||||
int32_t displayMode;
|
||||
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) {
|
||||
case nsSizeMode_Fullscreen:
|
||||
displayMode = NS_STYLE_DISPLAY_MODE_FULLSCREEN;
|
||||
|
|
Загрузка…
Ссылка в новой задаче