mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 01:58:06 +02:00
[api-minor] Limit the PDFDocumentLoadingTask.onUnsupportedFeature
functionality to GENERIC builds (PR 15758 follow-up)
This was deprecated in PR 15758 but it's unfortunately quite difficult to tell if third-party users are depending on this, e.g. to implement custom error reporting, and if so to what extent. However, thanks to the pre-processor we can limit *most* of this code to GENERIC builds which still seem like a worthwhile change. These changes reduce the bundle size of the Firefox PDF Viewer by 3.8 kB in total.
This commit is contained in:
parent
0c1fb4e740
commit
1a69d537c1
6 changed files with 159 additions and 105 deletions
|
@ -82,9 +82,11 @@ class Pattern {
|
|||
if (ex instanceof MissingDataException) {
|
||||
throw ex;
|
||||
}
|
||||
handler.send("UnsupportedFeature", {
|
||||
featureId: UNSUPPORTED_FEATURES.shadingPattern,
|
||||
});
|
||||
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
||||
handler.send("UnsupportedFeature", {
|
||||
featureId: UNSUPPORTED_FEATURES.shadingPattern,
|
||||
});
|
||||
}
|
||||
warn(ex);
|
||||
return new DummyShading();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue