Commit Graph

9360 Commits

Author SHA1 Message Date
Javier Infante
54fab606ee add basic unit-tests for murmurhash3.js 2016-12-01 02:21:05 +01:00
Tim van der Meij
8e8af62faf Merge pull request #7856 from Snuffleupagus/issue-7855
Ensure that `PartialEvaluator_extractWidths` is able to handle indirect objects in all kinds of "width" data (issue 7855)
2016-11-30 22:54:56 +01:00
Tim van der Meij
fb4c4ffb97 Merge pull request #7858 from Snuffleupagus/issue-7852
Make the keyboard shortcuts `Ctrl + Up/Down` behave as `Home/End` (issue 7852)
2016-11-30 22:20:28 +01:00
Jonas Jenwald
48696a8d06 Make the keyboard shortcuts Ctrl + Up/Down behave as Home/End (issue 7852)
It seems that for normal web pages, at least in Firefox, the keyboard shortcuts <kbd>Ctrl</kbd> + <kbd>Up</kbd>/<kbd>Down</kbd> are functionally equivalent to <kbd>Home</kbd>/<kbd>End</kbd>. This is obviously an edge-case, but can be easily implemented by using the same logic as we do for <kbd>Home</kbd>/<kbd>End</kbd>.

Fixes 7852.

*Please note:* I'm finding it slightly difficult to interpret issue 7852, and bug 1285719, since among other things: the title includes the word "reverse" with no other mention of it, and the STR makes reference to print preview which doesn't seem applicable to the PDF viewer.
However, compared to regular web pages in Firefox, I think the behavior of this patch makes sense here.
2016-11-30 17:42:52 +01:00
Jonas Jenwald
c5b06cb40d Ensure that PartialEvaluator_extractWidths is able to handle indirect objects in all kinds of "width" data (issue 7855)
Fixes 7855.
2016-11-29 20:49:07 +01:00
Jonas Jenwald
451956c0b1 Merge pull request #7628 from Snuffleupagus/issue-7580
Fallback to the `StandardEncoding` for Nonsymbolic fonts without `/Encoding` entry (issue 7580)
2016-11-29 12:37:36 +01:00
Jonas Jenwald
013f69e65f Merge pull request #7700 from Snuffleupagus/non-embedded-NuptialScript
Improve rendering of non-embedded NuptialScript font
2016-11-29 11:00:21 +01:00
Jonas Jenwald
362d20b23a Update l10n files 2016-11-28 10:30:05 +01:00
Tim van der Meij
e6720ad558 Merge pull request #7853 from Snuffleupagus/jsdoc-parseDestDictionary
Fix the JSDoc comment for `Catalog.parseDestDictionary`
2016-11-27 16:21:03 +01:00
Jonas Jenwald
c6008b4d7c Fix the JSDoc comment for Catalog.parseDestDictionary 2016-11-27 11:18:18 +01:00
Tim van der Meij
ce416eb26e Merge pull request #7849 from timvandermeij/css-cleanup
Viewer: remove unused CSS rule
2016-11-24 23:51:27 +01:00
Tim van der Meij
14d7e2f29c Viewer: remove unused CSS rule
This appears to have been part of the first mock-up of the viewer, but
hasn't been used since.
2016-11-24 23:44:57 +01:00
Tim van der Meij
424fc2df4f Merge pull request #7846 from timvandermeij/bidi-types
Bidi: import Unicode types from the specification
2016-11-24 22:59:31 +01:00
Tim van der Meij
995be19378 Bidi: skip invalid Unicode character to make indexing work
For Arabic characters, the Unicode character codes are mapped to Unicode
character types using the character codes for indexing. However, the
character code 0x061D is undefined (and therefore invalid) in the
Unicode standard. The imported list does not contain this entry, but not
having it in the list breaks indexing for items after it. Therefore, put
an empty string on its position to make indexing work properly and issue
a warning in the unlikely event that we encounter this character.
2016-11-24 22:13:12 +01:00
Tim van der Meij
11839f018f Bidi: import Unicode types from the specification
Mention the specification in the comments for future reference. These
types have been imported from the CSV source.
2016-11-24 21:08:31 +01:00
Tim van der Meij
7c96da4373 Merge pull request #7845 from timvandermeij/dist-min
Make: include minified library files for the distribution target
2016-11-23 21:23:44 +01:00
Adhika Setya Pramudita
906b8ea907 Make: include minified library files for the distribution target
Fixes #5487.
2016-11-23 17:35:19 +01:00
Jonas Jenwald
ef7fd75a94 Merge pull request #7841 from timvandermeij/ios-range
Compatibility: disable range requests for iOS and refactor user agent detection
2016-11-22 22:53:36 +01:00
Tim van der Meij
cf3a7425b6 Compatibility: refactor user agent detection
This patch moves the user agent checks to the top of the file to reduce
duplication and to provide a clear overview of which user agent we are
detecting.

Moreover, we extract inline user agent checks as well and use existing
checks in more places. Finally, we fix the indenting in one place for
consistency.
2016-11-22 22:42:01 +01:00
Tim van der Meij
0b0e18f05c Compatibility: disable range request for iOS
Fixes #7815.
2016-11-22 22:19:20 +01:00
Tim van der Meij
9ff19985c0 Merge pull request #7832 from seanburke-wf/expose-userunit-on-page
Expose the optional UserUnit entry as a page property
2016-11-22 21:18:57 +01:00
Jonas Jenwald
3170a4c40a Improve rendering of non-embedded NuptialScript font
*This patch fixes something that I noticed while debugging https://bugzilla.mozilla.org/show_bug.cgi?id=1308536.*

The PDF file contains a font called "NuptialScript", which unfortunately is not embedded. Since that is a non-standard font we will not be able to render it entirely correct. However, by adding "NuptialScript" to the `getNonStdFontMap`, we can at least improve the rendering slightly by using an italic (serif) fallback font.
2016-11-22 17:56:17 +01:00
Jonas Jenwald
9d8fb02512 Merge pull request #7839 from Snuffleupagus/issue-7835
Correctly detect more cases of non-embedded Arial Black fonts (issue 7835)
2016-11-22 17:37:44 +01:00
Sean Burke
f76cd2ce43 Expose the optional UserUnit entry as a page property 2016-11-22 09:18:19 -07:00
Jonas Jenwald
d3043167de Correctly detect more cases of non-embedded Arial Black fonts (issue 7835)
This patch adds support for non-embedded Arial Black fonts, that use a `Arial-Black...` format for the font names.
Also, this patch changes `canvas.js` such that we always render Arial Black fonts with the maximum weight, which actually improves a number of existing test-cases. This should thus explain the test "failures", which are clear improvements compared with e.g. Adobe Reader.

Fixes 7835.
2016-11-22 13:56:21 +01:00
Tim van der Meij
787d887a2f Merge pull request #7793 from Snuffleupagus/ViewHistory-storage-key-name
Rename the `ViewHistory` localStorage (and sessionStorage) key from `database` to `pdfjs.history`, and migrate existing data on read (issue 7760)
2016-11-21 21:16:44 +01:00
Jonas Jenwald
0af42f1ca7 Rename the ViewHistory localStorage (and sessionStorage) key from database to pdfjs.history, and migrate existing data on read (issue 7760)
For consistency, I also renamed the `FIREFOX/MOZCENTRAL` sessionStorage key, but given that sessionStorage is a lot less permanent than localStorage it didn't seem necessary to migrate any existing values.

Fixes 7760.
2016-11-21 21:03:37 +01:00
Jonas Jenwald
8a1ed8ab1f Update l10n files 2016-11-21 17:23:22 +01:00
Tim van der Meij
99b5416ba0 Merge pull request #7830 from Snuffleupagus/paintOnSvg-unsupported
Return a mock object in `paintOnSvg` when SVG rendering is not supported, to prevent `TypeError`s in the addons
2016-11-21 17:09:20 +01:00
Jonas Jenwald
9872660a95 Return a mock object in paintOnSvg when SVG rendering is not supported, to prevent TypeErrors in the addons
Currently if you try to enable SVG rendering in the addons, a `TypeError` is thrown by the browser since we have code that depends on what `paintOnCanvas`/`paintOnSvg` (should) return.
2016-11-19 13:32:17 +01:00
Yury Delendik
9c3419de94 Merge pull request #7826 from Snuffleupagus/PDFPageView_paintOnSvg-FIREFOX-prevent-unreachable-code-after-return-statement-warning
Prevent "unreachable code after return statement" warnings from `PDFPageView_paintOnSvg` in the addons
2016-11-18 14:20:47 -06:00
Jonas Jenwald
7272bb4894 Prevent "unreachable code after return statement" warnings from PDFPageView_paintOnSvg in the addons
Follow-up to PR 7738.
2016-11-18 21:18:27 +01:00
Tim van der Meij
eaf9bff4e4 Merge pull request #7738 from yurydelendik/svg-page
Adds SVG rendering capabilities to the main viewer.
2016-11-18 20:10:12 +01:00
Yury Delendik
f7d6f3a739 Adds SVG rendering capabilities to the PDFViewer. 2016-11-18 13:03:49 -06:00
Yury Delendik
c9a0955c9c Refactors PDFPageView_draw. 2016-11-18 12:57:11 -06:00
Yury Delendik
f6a8d9c4dd Merge pull request #7789 from yurydelendik/toolbar
Refactor toolbar.
2016-11-18 12:53:51 -06:00
Yury Delendik
a4402c84de Refactor toolbar (and secondary toolbar). 2016-11-18 12:51:15 -06:00
Tim van der Meij
043cea251d Merge pull request #7819 from Snuffleupagus/issue-7804
For commands with with too few arguments, clear out `args` if it's an Array instead of replacing it with `null` in `EvaluatorPreprocessor_read` (issue 7804)
2016-11-18 19:04:30 +01:00
Jonas Jenwald
7f678e3af1 Update l10n files 2016-11-17 12:03:31 +01:00
Jonas Jenwald
a930f9af15 For commands with with too few arguments, clear out args if it's an Array instead of replacing it with null in EvaluatorPreprocessor_read (issue 7804)
For `PartialEvaluator_getTextContent`, the same `args` Array should be re-used for every `EvaluatorPreprocessor_read` call. Hence we want to ensure that it's not accidentally replaced with `null` in `EvaluatorPreprocessor_read`, since otherwise corrupt PDF files (with too few arguments for certain commands) will cause errors in `PartialEvaluator_getTextContent`.

Perhaps a micro-optimization, but this patch also changes two `!args` comparisons to `args === null`, since that should be a tiny bit more efficient.
2016-11-16 10:20:29 +01:00
Jonas Jenwald
7f6a607ea5 Merge pull request #7803 from mukulmishra18/master
Fix #7701: additional check for http/https protocols to fix unsafe he…
2016-11-14 13:04:25 +01:00
Mukul Mishra
6ce2be98b7 Fix #7701: additional check for http/https protocols to fix unsafe header request.
add missing ! and removed trailing whitespaces.
2016-11-14 11:39:10 +05:30
Jonas Jenwald
7ec8adc712 Merge pull request #7801 from Snuffleupagus/preprocessor2-remove-comment-except-copyright
Enable removing of all comments (except for Copyright notices) when preprocessing code, and reduce the indentation level
2016-11-11 22:22:30 +01:00
Jonas Jenwald
4f1cccb138 Enable removing of all comments (except for Copyright notices) when preprocessing code, and reduce the indentation level 2016-11-11 22:05:17 +01:00
Jonas Jenwald
a139c75774 Merge pull request #7800 from Snuffleupagus/compatibility-Safari-regex
Replace the Safari detection in `checkRangeRequests` in compatibility.js with a regular expression
2016-11-11 17:57:29 +01:00
Jonas Jenwald
db2ce3ff64 Replace the Safari detection in checkRangeRequests in compatibility.js with a regular expression
According to e.g. issue 7754, it appears that the current `isSafari` check is failing in newer version of the browser. Despite the fact that checking the userAgent is an anti-pattern, which should be avoided, it's currently the simplest solution.
2016-11-11 17:15:24 +01:00
Jonas Jenwald
c23f124051 Merge pull request #7794 from Snuffleupagus/JavaScript-white-listed-actions
[api-minor] Add support for a couple of white-listed `JavaScript` actions that contains valid URLs (issue 3897, bug 843699)
2016-11-09 10:29:05 +01:00
Tim van der Meij
2f5170f28f Merge pull request #7792 from Snuffleupagus/bug-1315608
Make the `customScaleOption` disabled to prevent it being keyboard accessible (bug 1315608)
2016-11-08 21:55:51 +01:00
Jonas Jenwald
6d8a404a9c [api-minor] Add support for a couple of white-listed JavaScript actions that contains valid URLs (issue 3897, bug 843699)
By only allowing very specific type of `JavaScript` actions, and also utilizing the existing `URL` validation, this patch shouldn't pose too much risk.

Fixes one of the points in issue 3897 (with the PDF file taken from issue 3438).
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=843699 (probably, since that bug doesn't contain a test-case).
2016-11-08 16:48:27 +01:00
Jonas Jenwald
a97bc16fbc Make the customScaleOption disabled to prevent it being keyboard accessible (bug 1315608)
Given that the `customScaleOption` should already be hidden, provided that the browser supports that, this patch also prevents it from being accessible via the keyboard.
As far as my testing goes in various browsers, this doesn't seem to have any ill effects, and note that we're already explicitly ignoring the `custom` value in the `select` event handler.

Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1315608.
2016-11-08 12:04:55 +01:00