Skip to content

Commit

Permalink
Bug 1259641 - Do not force reflow for all tabs when size mode changed…
Browse files Browse the repository at this point in the history
…. r=smaug

MozReview-Commit-ID: GoTCM60Hmlf
  • Loading branch information
legnaleurc committed Apr 20, 2016
1 parent e78c697 commit 3b3bb2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dom/ipc/TabChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions layout/style/nsMediaFeatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3b3bb2b

Please sign in to comment.