Bug 1662839 - Set author style disabled state correctly on newly created iframes. r=mattwoodrow

Differential Revision: https://phabricator.services.mozilla.com/D90953
This commit is contained in:
Cameron McCormack
2020-10-04 03:25:16 +00:00
parent ba02a2db89
commit 1a10f8e9fc
13 changed files with 141 additions and 18 deletions

View File

@@ -7276,10 +7276,8 @@ nsresult nsDocShell::RestoreFromHistory() {
nsCOMPtr<nsIContentViewer> newCv(viewer);
float overrideDPPX = 0.0f;
bool styleDisabled = false;
if (oldCv && newCv) {
if (oldCv) {
oldCv->GetOverrideDPPX(&overrideDPPX);
oldCv->GetAuthorStyleDisabled(&styleDisabled);
}
// Protect against mLSHE going away via a load triggered from
@@ -7504,9 +7502,8 @@ nsresult nsDocShell::RestoreFromHistory() {
FavorPerformanceHint(true);
}
if (oldCv && newCv) {
if (oldCv) {
newCv->SetOverrideDPPX(overrideDPPX);
newCv->SetAuthorStyleDisabled(styleDisabled);
}
if (document) {
@@ -8074,7 +8071,6 @@ nsresult nsDocShell::SetupNewViewer(nsIContentViewer* aNewViewer,
const Encoding* hintCharset = nullptr;
int32_t hintCharsetSource = kCharsetUninitialized;
float overrideDPPX = 1.0;
bool styleDisabled = false;
// |newMUDV| also serves as a flag to set the data from the above vars
nsCOMPtr<nsIContentViewer> newCv;
@@ -8108,8 +8104,6 @@ nsresult nsDocShell::SetupNewViewer(nsIContentViewer* aNewViewer,
NS_ERROR_FAILURE);
NS_ENSURE_SUCCESS(oldCv->GetOverrideDPPX(&overrideDPPX),
NS_ERROR_FAILURE);
NS_ENSURE_SUCCESS(oldCv->GetAuthorStyleDisabled(&styleDisabled),
NS_ERROR_FAILURE);
}
}
}
@@ -8167,8 +8161,6 @@ nsresult nsDocShell::SetupNewViewer(nsIContentViewer* aNewViewer,
NS_ENSURE_SUCCESS(newCv->SetHintCharacterSetSource(hintCharsetSource),
NS_ERROR_FAILURE);
NS_ENSURE_SUCCESS(newCv->SetOverrideDPPX(overrideDPPX), NS_ERROR_FAILURE);
NS_ENSURE_SUCCESS(newCv->SetAuthorStyleDisabled(styleDisabled),
NS_ERROR_FAILURE);
}
// Stuff the bgcolor from the old pres shell into the new