Commit Graph

10481 Commits

Author SHA1 Message Date
Jonas Jenwald
343f331b8b
Merge pull request #9095 from Snuffleupagus/WebGLFactory
Split the existing `WebGLUtils` in two classes, a private `WebGLUtils` and a public `WebGLContext`, and utilize the latter in the API to allow various code to access the methods of `WebGLUtils`
2017-11-24 23:25:06 +01:00
Jonas Jenwald
59b5e14301 Split the existing WebGLUtils in two classes, a private WebGLUtils and a public WebGLContext, and utilize the latter in the API to allow various code to access the methods of WebGLUtils
This patch is one (small) step on the way to reduce the general dependency on a global `PDFJS` object, for PDF.js version `2.0`.
2017-11-24 21:54:47 +01:00
Jonas Jenwald
503bc95a2b
Merge pull request #9187 from Standard8/use-services
Update eslint-plugin-mozilla, and enable mozilla/use-services rule.
2017-11-24 18:24:38 +01:00
Mark Banner
3065197cc4 Update eslint-plugin-mozilla, and enable mozilla/use-services rule. 2017-11-24 16:58:36 +00:00
Tim van der Meij
c236790fb4
Merge pull request #9182 from Snuffleupagus/viewer-ignore-other-file-errors
Don't display error messages, in the default viewer, for PDF files other than the current one
2017-11-23 21:58:33 +01:00
Jonas Jenwald
c7ebea40b9 Don't display error messages, in the default viewer, for PDF files other than the current one
We've never attempted to limit the errors displayed in the default viewer to the current PDF file, but that's not really been a problem before. However after PR 7926, it's now possible to get password related error messages for *previously* opened PDF files in the default viewer.

**STR:**
 1. Open a password protected PDF file, e.g. `issue6010_1.pdf` from the test-suite.
 2. Cancel the password prompt.
 3. Open any new PDF file in the viewer.

**AR:**
The error UI is displayed, with a `No password given` message.

**ER:**
No error displayed, since it's only relevent for a now closed PDF file.

This is obviously a minor issue, caused by us now rejecting the still pending `pdfLoadingTask` during the `PDFViewerApplication.close` call, but I don't think that it (generally) makes sense to show errors if they're not relevant to the *currently* displayed PDF file.
2017-11-23 14:00:02 +01:00
Tim van der Meij
58760edba9
Merge pull request #9170 from Snuffleupagus/rm-polyfills
Remove more polyfills for old browsers
2017-11-22 22:23:43 +01:00
Jonas Jenwald
3ed2290c5b
Merge pull request #9179 from mgol/mailmap
Add mgol's name to AUTHORS, add .mailmap
2017-11-22 13:19:08 +01:00
Michał Gołębiowski-Owczarek
a9135f5c35 Add mgol's name to AUTHORS, add .mailmap
In this way mgol's past contribution is mapped correctly.
2017-11-22 10:46:11 +01:00
Jonas Jenwald
cc47ef56ec Remove the onclick polyfill for old versions of Opera
This was only relevant for no obsolete versions Opera, that use the Presto engine. According to https://en.wikipedia.org/wiki/History_of_the_Opera_web_browser#Opera_2013, the last version affected was released in 2013.
2017-11-21 11:02:14 +01:00
Jonas Jenwald
d18b2a8e73 Remove the classList polyfill
This is only relevant for browsers that we don't intend to support with PDF.js version `2.0`.
2017-11-21 11:01:52 +01:00
Jonas Jenwald
4b15e8566b Remove the Function.prototype.bind polyfill
This is only relevant for browsers that we don't intend to support with PDF.js version `2.0`.
2017-11-21 11:00:55 +01:00
Jonas Jenwald
d8cb74d3e3 Remove the btoa/atob polyfills
This is only relevant for browsers that we don't intend to support with PDF.js version `2.0`.
2017-11-21 11:00:55 +01:00
Jonas Jenwald
150ac0788f Remove IE9 specific XMLHttpRequest polyfills that utilize VBArray 2017-11-21 11:00:55 +01:00
Jonas Jenwald
935c5c587f Remove the Object.defineProperty polyfill
This is only relevant for browsers that we don't intend to support with PDF.js version `2.0`.
2017-11-21 11:00:55 +01:00
Tim van der Meij
6f52fafdc0
Merge pull request #9162 from SehyunPark/patch-8
Update index.md
2017-11-20 21:14:17 +01:00
Jonas Jenwald
b8e7a0b2f4 Update l10n files 2017-11-20 16:07:24 +01:00
SehyunRyanPark
0882288cdf
Update index.md
adding commas each in two sentences in order to make readers fully understand when reading index.md and to organize the context properly based on grammatical rules.
2017-11-20 21:47:19 +09:00
Tim van der Meij
dad83bfb5b
Merge pull request #9158 from timvandermeij/annotations-utf16be
Sanitize the display value for choice widget annotations
2017-11-18 21:35:08 +01:00
Tim van der Meij
25b07812b9
Sanitize the display value for choice widget annotations 2017-11-18 20:37:27 +01:00
Tim van der Meij
9e8cf448b0
Merge pull request #9140 from Snuffleupagus/rm-console-polyfill
Remove the `console` polyfills
2017-11-18 15:49:19 +01:00
Tim van der Meij
617cb86a43
Merge pull request #9157 from SehyunPark/patch-6
Update index.md
2017-11-18 15:42:16 +01:00
Tim van der Meij
edaf4b3173
Merge pull request #9037 from Snuffleupagus/refactor-streams-params
Re-factor how parameters are passed to the network streams
2017-11-18 15:41:15 +01:00
SehyunRyanPark
1093cc6d77
Update index.md
fixing grammatical error (demonstrate -> demonstrates)
2017-11-18 23:15:03 +09:00
Tim van der Meij
f5fb87f021
Merge pull request #9156 from SehyunPark/patch-5
Update README.md
2017-11-18 14:27:23 +01:00
SehyunRyanPark
095c8a988e
Update README.md
Clarifying what IRC stands for in order to make people understand clearly who want to use relay chat in irc.mozilla.org
2017-11-18 21:29:20 +09:00
Tim van der Meij
ae07adf143
Merge pull request #9073 from Snuffleupagus/image-streams-fixes
Fix the interface of `JpegStream`/`JpxStream`/`Jbig2Stream` to agree with the other `DecodeStream`s
2017-11-17 23:26:36 +01:00
Jonas Jenwald
c61d197398
Merge pull request #9122 from wojtekmaj/change/remove-compatibility-from-examples
Remove mentions of compatibility.js from examples
2017-11-17 00:31:14 +01:00
Wojciech Maj
9e0559264c Remove mentions of compatibility.js from examples 2017-11-17 00:21:30 +01:00
Tim van der Meij
374709a40a
Merge pull request #9126 from Snuffleupagus/viewer-move-hash-parameter-parsing
Extract parsing of debugging hash parameters into its own method in `PDFViewerApplication`
2017-11-16 22:49:15 +01:00
Tim van der Meij
1d67d9dccd
Merge pull request #9131 from janpe2/svg-empty-paths
Filling and stroking empty paths in SVG backend
2017-11-16 22:43:24 +01:00
Jonas Jenwald
42099c564f Remove the console polyfills
All browsers that we intend to support with PDF.js version 2.0 already supports `console` natively.
2017-11-16 09:34:51 +01:00
Yury Delendik
e162df59bb
Merge pull request #9138 from Snuffleupagus/rm-requestAnimationFrame-polyfill
Remove the `requestAnimationFrame` polyfill
2017-11-15 10:48:34 -06:00
Jonas Jenwald
d5174cd826 Remove the requestAnimationFrame polyfill
According to https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame#Browser_compatibility and https://caniuse.com/#feat=requestanimationframe, the browsers we intend to support with PDF.js version 2.0 should all have native `requestAnimationFrame` support.

Note that the reason for indiscriminately polyfilling `requestAnimationFrame` in iOS, see PR 4961, was apparently because of a bug in iOS 6.
However, according to [Wikipedia](https://en.wikipedia.org/wiki/IOS_version_history#iOS_8): "Support for iOS 8 ended in 2017.", hence the lowest version currently supported is iOS 9.
2017-11-15 16:08:48 +01:00
Jonas Jenwald
25d6bc9de9 Extract parsing of debugging hash parameters into its own method in PDFViewerApplication
In order to move viewer related options from the global `PDFJS` object and into the initialization of the relevant components, we'll need to parse the hash parameters *before* calling `PDFViewerApplication._initializeViewerComponents`.
2017-11-15 10:08:57 +01:00
Jonas Jenwald
f9a0515452
Merge pull request #9125 from Snuffleupagus/rm-viewer-PDFJS-options
Remove compatibility code for unsupported browsers for a couple of `PDFJS` options
2017-11-15 10:04:44 +01:00
Jani Pehkonen
4e8f7070da Filling and stroking empty paths in SVG backend 2017-11-14 18:35:39 +02:00
Jonas Jenwald
745cb73c65 Remove PDFJS.disableRange/PDFJS.disableStream code for now unsupported browsers in src/shared/compatibility.js
We're currently disabling range requests and streaming for a number of configurations. A couple of those will no longer be supported (with PDF.js version 2.0), hence we ought to be able to clean up the compatibility code slightly.
2017-11-14 15:28:50 +01:00
Jonas Jenwald
eb3a1f24a3 Remove the PDFJS.disableHistory code from src/shared/compatibility.js
This compatibility code is only relevant for browsers that will no longer be supported (with PDF.js version 2.0), hence we ought to be able to remove it.
2017-11-14 15:28:50 +01:00
Jonas Jenwald
2f936f88f4 Remove the ignoreCurrentPositionOnZoom viewer option
The only reason for adding this parameter in the first place, all the way back in PR 4074, was that the "maintain document position on zooming" feature was landed and backed out a couple of times before it finally stuck.
Hence it seemed, at the time, like a good idea to have a simple way to disable that behaviour. However, that was almost four years ago, and it's just not likely that we'd want/need to ever disable it now.

Furthermore I really cannot imagine why anyone would actually *want* to reset the position whenever zooming occurs, since it results in a quite annoying UX.

*So, to summarize:* Based on the above, I think that we should try to remove this parameter now. On the off chance that anyone complains, re-adding it shouldn't be difficult.
2017-11-14 15:28:50 +01:00
Jonas Jenwald
85e006720e
Merge pull request #9118 from wassupben/master
Added missing network stream for svgviewer example
2017-11-14 15:20:45 +01:00
Tim van der Meij
9686f6652c
Merge pull request #9089 from yurydelendik/rm-chunks
Extracts OperatorList class and prepares for streaming
2017-11-13 23:35:40 +01:00
Ben Holmes
ead83b7a72 Added missing network stream for svgviewer example 2017-11-13 19:43:30 +00:00
Tim van der Meij
36b83c14f9
Merge pull request #9124 from Snuffleupagus/scrollThumbnailIntoView-multi-cols
Fix incorrect behaviour in `PDFThumbnailViewer.scrollThumbnailIntoView` for multiple columns of thumbnails
2017-11-12 11:41:44 +01:00
Jonas Jenwald
614ab4ef2c Fix incorrect behaviour in PDFThumbnailViewer.scrollThumbnailIntoView for multiple columns of thumbnails
If the sidebar is resized such that the thumbnails are displayed in multiple columns, then scrolling the currently active thumbnail into view doesn't work correctly in some cases.
The reason is that the code in `PDFThumbnailViewer.scrollThumbnailIntoView` implicitly assumes that the thumbnails will be present in just *one* column. Since that may no longer be the case, it's not sufficient to simply check if the thumbnail is visible. Instead we must explicitly check that *all*, i.e. 100 percent, of the thumbnail is already visible, and otherwise scroll it into view.
2017-11-11 22:57:59 +01:00
Jonas Jenwald
23699cef1c Re-factor how parameters are passed to the network streams
*This patch is the result of me starting to look into moving parameters from `PDFJS` into `getDocument` and other API methods.*

When familiarizing myself with the code, the signatures of the various network streams seemed to be unnecessarily cumbersome since `disableRange` is currently handled separately from other parameters.
I'm assuming that the explanation for this is probably "for historical reasons", as is often the case. Hence I'd like to clean this up *before* we start the larger, and more invasive, `PDFJS` parameter re-factoring.
2017-11-11 11:23:29 +01:00
Jonas Jenwald
de5297b9ea Fix the interface of JpegStream/JpxStream/Jbig2Stream to agree with the other DecodeStreams
The interface of all of the "image" streams look kind of weird, and I'm actually a bit surprised that there hasn't been any errors because of it.
For example: None of them actually implement `readBlock` methods, and it seems more luck that anything else that we're not calling `getBytes()` (without providing a length) for those streams, since that would trigger a code-path in `getBytes` that assumes `readBlock` to exist.

To address this long-standing issue, the `ensureBuffer` methods are thus renamed to `readBlock`. Furthermore, the new `ensureBuffer` methods are now no-ops.
Finally, this patch also replaces `var` with `let` in a number of places.
2017-11-11 11:22:16 +01:00
Jonas Jenwald
36593d6bbc Move JpegStream and JpxStream to their own files 2017-11-11 11:22:16 +01:00
Yury Delendik
5fa56f6a9d For backwards compatibility: use addOp amount instead of queue size. 2017-11-09 18:46:48 -06:00
Yury Delendik
877c2d7743 Changing QueueOptimizer to be more iterative. 2017-11-09 18:46:48 -06:00