Commit Graph

9338 Commits

Author SHA1 Message Date
Jonas Jenwald
c36468cbce Fix errors reported by the keyword-spacing ESLint rule
http://eslint.org/docs/rules/keyword-spacing
2016-12-12 20:35:56 +01:00
Jonas Jenwald
86ba634c97 Fix errors reported by the key-spacing ESLint rule
http://eslint.org/docs/rules/key-spacing
2016-12-12 20:35:55 +01:00
Jonas Jenwald
6606540fe4 Fix errors reported by the func-call-spacing ESLint rule
http://eslint.org/docs/rules/func-call-spacing
2016-12-12 20:35:54 +01:00
Jonas Jenwald
ad915f8af1 Fix errors reported by the comma-spacing ESLint rule
http://eslint.org/docs/rules/comma-spacing
2016-12-12 20:35:53 +01:00
Jonas Jenwald
66d2637b3f Fix errors reported by the yoda ESLint rule
http://eslint.org/docs/rules/yoda
2016-12-12 20:35:52 +01:00
Jonas Jenwald
e53ab844cc Fix errors reported by the no-useless-concat ESLint rule
http://eslint.org/docs/rules/no-useless-concat
2016-12-12 20:35:51 +01:00
Jonas Jenwald
3820946301 Fix (most) errors reported by the no-multi-spaces ESLint rule
http://eslint.org/docs/rules/no-multi-spaces
2016-12-12 20:35:51 +01:00
Jonas Jenwald
328e7397ea Fix errors reported by the no-extra-bind ESLint rule
http://eslint.org/docs/rules/no-extra-bind
2016-12-12 20:35:50 +01:00
Jonas Jenwald
25bf5db47e Fix errors reported by the no-extra-boolean-cast ESLint rule
http://eslint.org/docs/rules/no-extra-boolean-cast
2016-12-12 20:26:18 +01:00
Jonas Jenwald
fb5e756683 Fix errors reported by the no-cond-assign ESLint rule
http://eslint.org/docs/rules/no-cond-assign
2016-12-12 20:26:06 +01:00
Tim van der Meij
00a006e466 Merge pull request #7705 from Snuffleupagus/issue-2594
Move symbolic font glyphs to private use area if they don't have unicode mappings (issue 2594, bug 789074, bug 865644)
2016-12-10 21:30:28 +01:00
Tim van der Meij
47f03b619f Merge pull request #7873 from timvandermeij/mediabox-cropbox-indirect
Document: handle indirect objects in `MediaBox` and `CropBox` entries
2016-12-08 23:59:45 +01:00
Tim van der Meij
3800b5e463 Document: extract CropBox fetching and validation into a getter
This patch refactors the `CropBox` code to combine fetching and
validation code in a getter, like we already did for the `MediaBox`
property. Combined with variable name changes, this improves readability
of the code and makes the `view` getter simpler as well.
2016-12-08 22:44:53 +01:00
Jonas Jenwald
9be3aee9c9 Add a parameter to Page_getInheritedPageProp to make it possible to fetch (and dereference) Arrays, and use that for the MediaBox/CropBox getters (issue 7872) 2016-12-08 22:03:42 +01:00
Tim van der Meij
407dee390a Merge pull request #7884 from Snuffleupagus/Parser-fetch-indirect-objects-in-filter-arrays
Ensure that we resolve indirect objects in `Filter` and `DecodeParms` arrays in `parser.js`
2016-12-08 21:59:34 +01:00
Jonas Jenwald
b4ac6bd2f6 Ensure that we resolve indirect objects in Filter and DecodeParms arrays in parser.js
I've not actually, thus far, come across a PDF file that this patch fixes. However, given the string of recent patches that has fixed issues with indirect objects in arrays, I think that it makes sense to proactively avoid any issues in this code.
2016-12-08 11:55:08 +01:00
Tim van der Meij
aaec490847 Merge pull request #7881 from Snuffleupagus/fixMetadata-constant-condition
Remove a misplaced `false` from a condition in `fixMetadata`, in `metadata.js`, since it currently short circuits the entire condition
2016-12-08 00:29:42 +01:00
Jonas Jenwald
77bcc9232e Remove a misplaced false from a condition in fixMetadata, in metadata.js, since it currently short circuits the entire condition
This looks to me like a simple oversight, which has existed ever since PR 1598 all the way back in 2012.
2016-12-07 22:51:46 +01:00
Jonas Jenwald
94ddd8f61d Merge pull request #7863 from timvandermeij/colorspace
Colorspace: refactoring to prevent unnecessary creation of intermediate arrays
2016-12-06 11:18:53 +01:00
Jonas Jenwald
caf81685cb Update l10n files 2016-12-05 10:10:17 +01:00
Tim van der Meij
fa6b9b7552 Merge pull request #7868 from Snuffleupagus/pageLabels-St-unit-test
Adjust one of the Page Label unit-tests to use a PDF file where the "St" entry is both present and non-default (i.e. greater than one)
2016-12-04 20:45:52 +01:00
Jonas Jenwald
e386af7b22 Adjust one of the Page Label unit-tests to use a PDF file where the "St" entry is both present and non-default (i.e. greater than one)
I just realized that none of our current unit-tests cover this particular part of the Page Label parsing code, hence this patch adjusts an existing test PDF to include a "St" entry in the Page Label dictionary.
2016-12-04 13:03:22 +01:00
Tim van der Meij
90d94815ad Colorspace: miscellaneous improvements
- Remove an unnecessary check and assignment.
- Clean up code regarding mode setting (no need for a member variable).
- Indent two methods correctly.
2016-12-02 16:47:39 +01:00
Tim van der Meij
c5c0a00dca Colorspace: reduce duplication in AlternateCS.getRgbBuffer 2016-12-02 16:42:22 +01:00
Tim van der Meij
ef653d952b Colorspace: optimize default color initialization
This patch avoids the creation of extra arrays when initializing an
array with default (zero) values. Doing this additionally makes the code
more readable by allocating enough space for the number of color
components.
2016-12-02 16:42:22 +01:00
Tim van der Meij
46d2c892de Merge pull request #7857 from jabiinfante/murmurhash3-unit-tests
add basic unit-tests for murmurhash3.js
2016-12-01 16:34:04 +01:00
Jonas Jenwald
48ab6463df Merge pull request #7862 from yurydelendik/issue7861
Don't fail if mozL10n is not present.
2016-12-01 16:06:29 +01:00
Yury Delendik
7b6ba5e9fd Don't fail if mozL10n is not present. 2016-12-01 08:48:07 -06:00
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