Bug 1713627 - Remove code obsoleted by the replacing the Text Encoding menu with one item. r=jaws,emk
Differential Revision: https://phabricator.services.mozilla.com/D116391
This commit is contained in:
@@ -206,7 +206,7 @@ void nsHTMLDocument::TryUserForcedCharset(nsIContentViewer* aCv,
|
||||
nsIDocShell* aDocShell,
|
||||
int32_t& aCharsetSource,
|
||||
NotNull<const Encoding*>& aEncoding) {
|
||||
if (kCharsetFromUserForced <= aCharsetSource) {
|
||||
if (aCharsetSource >= kCharsetFromXmlDeclarationUtf16) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -215,20 +215,11 @@ void nsHTMLDocument::TryUserForcedCharset(nsIContentViewer* aCv,
|
||||
return;
|
||||
}
|
||||
|
||||
if (aDocShell) {
|
||||
if (aDocShell && nsDocShell::Cast(aDocShell)->GetForcedAutodetection()) {
|
||||
// This is the Character Encoding menu code path in Firefox
|
||||
auto encoding = nsDocShell::Cast(aDocShell)->GetForcedCharset();
|
||||
|
||||
if (encoding) {
|
||||
if (!IsAsciiCompatible(encoding)) {
|
||||
return;
|
||||
}
|
||||
aEncoding = WrapNotNull(encoding);
|
||||
aCharsetSource = nsDocShell::Cast(aDocShell)->GetForcedAutodetection()
|
||||
? kCharsetFromPendingUserForcedAutoDetection
|
||||
: kCharsetFromUserForced;
|
||||
aDocShell->SetCharset(""_ns);
|
||||
}
|
||||
aEncoding = WINDOWS_1252_ENCODING;
|
||||
aCharsetSource = kCharsetFromPendingUserForcedAutoDetection;
|
||||
nsDocShell::Cast(aDocShell)->ResetForcedAutodetection();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -238,7 +229,7 @@ void nsHTMLDocument::TryParentCharset(nsIDocShell* aDocShell,
|
||||
if (!aDocShell) {
|
||||
return;
|
||||
}
|
||||
if (aCharsetSource >= kCharsetFromUserForced) {
|
||||
if (aCharsetSource >= kCharsetFromXmlDeclarationUtf16) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -250,9 +241,7 @@ void nsHTMLDocument::TryParentCharset(nsIDocShell* aDocShell,
|
||||
if (!parentCharset) {
|
||||
return;
|
||||
}
|
||||
if (kCharsetFromUserForced == parentSource ||
|
||||
kCharsetFromUserForcedJapaneseAutoDetection == parentSource ||
|
||||
kCharsetFromPendingUserForcedAutoDetection == parentSource ||
|
||||
if (kCharsetFromPendingUserForcedAutoDetection == parentSource ||
|
||||
kCharsetFromInitialUserForcedAutoDetection == parentSource ||
|
||||
kCharsetFromFinalUserForcedAutoDetection == parentSource) {
|
||||
if (WillIgnoreCharsetOverride() ||
|
||||
@@ -261,11 +250,7 @@ void nsHTMLDocument::TryParentCharset(nsIDocShell* aDocShell,
|
||||
return;
|
||||
}
|
||||
aEncoding = WrapNotNull(parentCharset);
|
||||
aCharsetSource =
|
||||
(kCharsetFromUserForced == parentSource ||
|
||||
kCharsetFromUserForcedJapaneseAutoDetection == parentSource)
|
||||
? kCharsetFromUserForced
|
||||
: kCharsetFromPendingUserForcedAutoDetection;
|
||||
aCharsetSource = kCharsetFromPendingUserForcedAutoDetection;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -693,11 +678,9 @@ bool nsHTMLDocument::WillIgnoreCharsetOverride() {
|
||||
switch (mCharacterSetSource) {
|
||||
case kCharsetUninitialized:
|
||||
case kCharsetFromFallback:
|
||||
case kCharsetFromTopLevelDomain:
|
||||
case kCharsetFromDocTypeDefault:
|
||||
case kCharsetFromInitialAutoDetectionWouldHaveBeenUTF8:
|
||||
case kCharsetFromInitialAutoDetectionWouldNotHaveBeenUTF8DependedOnTLD:
|
||||
case kCharsetFromFinalJapaneseAutoDetection:
|
||||
case kCharsetFromFinalAutoDetectionWouldHaveBeenUTF8:
|
||||
case kCharsetFromFinalAutoDetectionWouldNotHaveBeenUTF8DependedOnTLD:
|
||||
case kCharsetFromParentFrame:
|
||||
@@ -705,8 +688,6 @@ bool nsHTMLDocument::WillIgnoreCharsetOverride() {
|
||||
case kCharsetFromMetaPrescan:
|
||||
case kCharsetFromMetaTag:
|
||||
case kCharsetFromChannel:
|
||||
case kCharsetFromUserForced:
|
||||
case kCharsetFromUserForcedJapaneseAutoDetection:
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user