mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 13:34:03 +00:00
Oust PDF.js - Part 5: Remove special cases in docshell and dom as well as mozbuild backend tests
This commit is contained in:
@@ -44,13 +44,6 @@ nsWebNavigationInfo::IsTypeSupported(const nsACString& aType,
|
||||
// to say for itself.
|
||||
*aIsTypeSupported = nsIWebNavigationInfo::UNSUPPORTED;
|
||||
|
||||
// We want to claim that the type for PDF documents is unsupported,
|
||||
// so that the internal PDF viewer's stream converted will get used.
|
||||
if (aType.LowerCaseEqualsLiteral("application/pdf") &&
|
||||
nsContentUtils::IsPDFJSEnabled()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
const nsCString& flatType = PromiseFlatCString(aType);
|
||||
nsresult rv = IsTypeSupportedInternal(flatType, aIsTypeSupported);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
@@ -6406,19 +6406,6 @@ nsContentUtils::AllowXULXBLForPrincipal(nsIPrincipal* aPrincipal)
|
||||
IsSitePermAllow(aPrincipal, "allowXULXBL"));
|
||||
}
|
||||
|
||||
bool
|
||||
nsContentUtils::IsPDFJSEnabled()
|
||||
{
|
||||
nsCOMPtr<nsIStreamConverterService> convServ =
|
||||
do_GetService("@mozilla.org/streamConverters;1");
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
bool canConvert = false;
|
||||
if (convServ) {
|
||||
rv = convServ->CanConvert("application/pdf", "text/html", &canConvert);
|
||||
}
|
||||
return NS_SUCCEEDED(rv) && canConvert;
|
||||
}
|
||||
|
||||
already_AddRefed<nsIDocumentLoaderFactory>
|
||||
nsContentUtils::FindInternalContentViewer(const char* aType,
|
||||
ContentViewerType* aLoaderType)
|
||||
|
||||
@@ -2011,11 +2011,6 @@ public:
|
||||
*/
|
||||
static void XPCOMShutdown();
|
||||
|
||||
/**
|
||||
* Checks if internal PDF viewer is enabled.
|
||||
*/
|
||||
static bool IsPDFJSEnabled();
|
||||
|
||||
enum ContentViewerType
|
||||
{
|
||||
TYPE_UNSUPPORTED,
|
||||
|
||||
@@ -552,11 +552,6 @@ IsPluginEnabledByExtension(nsIURI* uri, nsCString& mimeType)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Disables any native PDF plugins, when internal PDF viewer is enabled.
|
||||
if (ext.EqualsIgnoreCase("pdf") && nsContentUtils::IsPDFJSEnabled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsRefPtr<nsPluginHost> pluginHost = nsPluginHost::GetInst();
|
||||
|
||||
if (!pluginHost) {
|
||||
@@ -2674,13 +2669,6 @@ nsObjectLoadingContent::GetTypeOfContent(const nsCString& aMIMEType)
|
||||
return eType_Image;
|
||||
}
|
||||
|
||||
// Faking support of the PDF content as a document for EMBED tags
|
||||
// when internal PDF viewer is enabled.
|
||||
if (aMIMEType.LowerCaseEqualsLiteral("application/pdf") &&
|
||||
nsContentUtils::IsPDFJSEnabled()) {
|
||||
return eType_Document;
|
||||
}
|
||||
|
||||
// SVGs load as documents, but are their own capability
|
||||
bool isSVG = aMIMEType.LowerCaseEqualsLiteral("image/svg+xml");
|
||||
Capabilities supportType = isSVG ? eSupportSVG : eSupportDocuments;
|
||||
|
||||
@@ -39,7 +39,6 @@ class TestManifest(unittest.TestCase):
|
||||
'skin global classic/1.0 content/skin/classic/ application=foo' +
|
||||
' os=WINNT',
|
||||
'',
|
||||
'manifest pdfjs/chrome.manifest',
|
||||
'resource gre-resources toolkit/res/',
|
||||
'override chrome://global/locale/netError.dtd' +
|
||||
' chrome://browser/locale/netError.dtd',
|
||||
@@ -70,7 +69,6 @@ class TestManifest(unittest.TestCase):
|
||||
ManifestSkin('', 'global', 'classic/1.0', 'content/skin/classic/'),
|
||||
ManifestSkin('', 'global', 'classic/1.0', 'content/skin/classic/',
|
||||
'application=foo', 'os=WINNT'),
|
||||
Manifest('', 'pdfjs/chrome.manifest'),
|
||||
ManifestResource('', 'gre-resources', 'toolkit/res/'),
|
||||
ManifestOverride('', 'chrome://global/locale/netError.dtd',
|
||||
'chrome://browser/locale/netError.dtd'),
|
||||
|
||||
@@ -611,8 +611,6 @@ class TestManifestFile(TestWithTmpDir):
|
||||
f = ManifestFile('chrome')
|
||||
f.add(ManifestContent('chrome', 'global', 'toolkit/content/global/'))
|
||||
f.add(ManifestResource('chrome', 'gre-resources', 'toolkit/res/'))
|
||||
f.add(ManifestResource('chrome/pdfjs', 'pdfjs', './'))
|
||||
f.add(ManifestContent('chrome/pdfjs', 'pdfjs', 'pdfjs'))
|
||||
f.add(ManifestLocale('chrome', 'browser', 'en-US',
|
||||
'en-US/locale/browser/'))
|
||||
|
||||
@@ -620,8 +618,6 @@ class TestManifestFile(TestWithTmpDir):
|
||||
self.assertEqual(open(self.tmppath('chrome.manifest')).readlines(), [
|
||||
'content global toolkit/content/global/\n',
|
||||
'resource gre-resources toolkit/res/\n',
|
||||
'resource pdfjs pdfjs/\n',
|
||||
'content pdfjs pdfjs/pdfjs\n',
|
||||
'locale browser en-US en-US/locale/browser/\n',
|
||||
])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user