Commit Graph

7155 Commits

Author SHA1 Message Date
yscumc
4acb744f77 Update document_properties.js
Fix for minutes tz calculation
2014-08-28 16:22:57 -04:00
Yury Delendik
61eac43c9b Merge pull request #5240 from Snuffleupagus/api-progressCallback-doc
In src/display/api.js, add documentation for the |progressCallback| parameter in |PDFJS.getDocument|
2014-08-28 08:03:10 -05:00
Jonas Jenwald
64d95bedaa In src/display/api.js, add documentation for the |progressCallback| parameter in |PDFJS.getDocument| 2014-08-28 14:11:14 +02:00
Jonas Jenwald
4fcd502b1e Merge pull request #5232 from Rob--W/crx-isolate-pageAction-logic
Chrome extension: Isolate pageAction logic
2014-08-26 12:38:52 +02:00
Rob Wu
1055350425 Chrome extension: Isolate pageAction logic
Remove pageAction logic from extension router, and put it in a
separate file. The pageAction URL parsing logic has been simplified,
and all pageAction-related files have been moved to a separate directory.
2014-08-22 23:00:39 +02:00
Yury Delendik
4834f1c289 Merge pull request #5219 from Snuffleupagus/sanitizeMetrics-avoid-intermediate-strings
Avoid creating intermediate strings in sanitizeMetrics
2014-08-21 08:05:44 -05:00
Jonas Jenwald
ae896fc071 Avoid creating intermediate strings in sanitizeMetrics
This patch avoids creating many intermediate strings, when adding dummy width/lsb entries for glyphs where those are missing.
For the relevant PDF files in our test suite, the average number of intermediate strings are well over 1000.
2014-08-20 23:55:57 +02:00
Tim van der Meij
b4fb1e21e7 Merge pull request #5209 from CodingFabian/text-layer-transform-origin
Set transformOrigin for text layer in css.
2014-08-19 22:59:55 +02:00
Fabian Lange
1da38ec91e no need to set textlayer properties which are overwritten in individual styles. 2014-08-19 22:47:39 +02:00
Fabian Lange
6a0aa2cf49 Set transformOrigin for text layer in css.
transformOrigin is set to 0% 0% in all cases. This adds extra memory
impact into the dom tree. It also involves the CustomStyles workaround
to determine the correct css rule for the browser.
By setting all vendor and standard variants in css, the rule is applied
without the dom memory overhead and without the minor computation
overhead to set the value.
2014-08-19 22:46:09 +02:00
Yury Delendik
6969ed4760 Merge pull request #5204 from nnethercote/needsDecode
Apply the GRAYSCALE_1BPP optimization when `needsDecode` is set.
2014-08-19 07:24:49 -05:00
Jonas Jenwald
0dbac150d5 Merge pull request #5212 from fkaelberer/fixFunctionName
Fix ensureByte() function name (copy-and-paste error)
2014-08-19 12:22:47 +02:00
fkaelberer
a7bbc12a81 Fix ensureByte() function name (copy-and-paste error) 2014-08-19 12:19:22 +02:00
Yury Delendik
2f5c6d6c3a Merge pull request #5208 from CodingFabian/debounce-scroll
Debounces scroll events in web viewer.
2014-08-18 22:53:28 -05:00
Jonas Jenwald
f543e86f71 Merge pull request #5210 from yurydelendik/type3dir
Fixes Type3 negative font direction
2014-08-19 01:51:37 +02:00
Nicholas Nethercote
48de7651ce Apply the GRAYSCALE_1BPP optimization when needsDecode is set.
The scanned, black-and-white document at
https://bugzilla.mozilla.org/show_bug.cgi?id=835380 doesn't benefit from
the critical GRAYSCALE_1BPP optimization because the optimization is
skipped if `needsDecode` is set.

This change addresses that, and reduces both rendering time and memory
usage for that document by almost 10x.
2014-08-18 16:45:19 -07:00
Yury Delendik
be998261cc Fixes Type3 negative font direction 2014-08-18 17:57:52 -05:00
Fabian Lange
403a4e2bda Debounces scroll events in web viewer.
As requested in #5178, this change debounces the scroll events.
The reason for doing so is that browsers can event-storm especially on
scroll, communicating hundreds of subpixel changes.

The main reason for this resulting in poor performance is that on each
scroll event `scrollTop` was queried, which forces layouting.

This change will use `requestAnimationFrame` to make sure the browser can
allocate enough time to other tasks. The delay is however quite small, thus
the reduction in executions is less noticeable. Modern browsers however utilize
`requestAnimationFrame` to smoothen out rendering.
2014-08-18 23:23:32 +02:00
Yury Delendik
4ef70588de Merge pull request #5193 from nnethercote/data-font-name
Only use data-font-name attributes when necessary.
2014-08-18 13:54:07 -05:00
Yury Delendik
6ac995dc88 Merge pull request #5205 from nnethercote/setGState-closure
Remove setGStateForKey() closure.
2014-08-18 07:49:54 -05:00
Nicholas Nethercote
96b9af68dd Remove setGStateForKey() closure.
setGStateForKey() is a closure that serves no particularly useful
purpose. This change inlines it at the single call site. This avoids 1.7
MiB of allocations (because closures are objects) for the MTA map
mentioned in https://bugzilla.mozilla.org/show_bug.cgi?id=835380#c17.
2014-08-17 22:21:45 -07:00
Nicholas Nethercote
eda7dcbb9e Only use data-font-name attributes when necessary.
The data-font-name attribute of textLayer divs are only used by the Font
Inspector. This change ensures they are only present when the pdfBug
tools are enabled.
2014-08-17 15:56:11 -07:00
Yury Delendik
b06dc8d363 Merge pull request #5201 from Snuffleupagus/DocumentProperties-refactor
Small re-factoring of DocumentProperties
2014-08-16 08:22:12 -05:00
Yury Delendik
783d5066ed Merge pull request #5200 from kkujala/calrgb
CalRGB: optimize CalRGB calculations
2014-08-16 08:16:34 -05:00
Jonas Jenwald
61e24c6f45 Small re-factoring of DocumentProperties
With the changes made in PR 5169 to enable quicker display of the File size, `setFileSize()` can now be called during file loading. This function parses *and* localizes the file size, where the l10n is a synchronous operation.
This patch:
* Re-factors `setFileSize()` to *only* update `rawFileSize`, and moves parsing and fetching of the l10n string to a separate method that isn't called until the Document Properties dialog is actually opened.

* Adds a couple of checks to make sure that `rawFileSize` is set to a positive number.

* Removes the `fileName` and `fileSize` properties. Since they are parsed every time the Document Properties dialog is opened, it doesn't seem necessary to cache them.
2014-08-16 12:15:49 +02:00
Kalervo Kujala
0c5525dc8a CalRGB: optimize CalRGB calculations
Also fix one silly mistake.
2014-08-16 11:38:15 +03:00
Yury Delendik
3ad972ad45 Merge pull request #5199 from yor-mozilla-com/bug1054590
Bug 1054590 - [pdf.js] Update to use gaia-header
2014-08-15 22:57:37 -05:00
Yan Or
d8bc16362c Bug 1054590 - [pdf.js] Update to use gaia-header 2014-08-15 17:57:07 -07:00
Yury Delendik
90d79d1577 Merge pull request #5198 from timvandermeij/svg-paintformxobject
Implements paintFormXObject in svg.js
2014-08-15 16:29:30 -05:00
Tim van der Meij
32853c07f4 Implements paintFormXObject in svg.js 2014-08-15 23:23:04 +02:00
Yury Delendik
34449f6d9c Merge pull request #5195 from Snuffleupagus/typed-array-api-unittest
Add unit test for PDF file loaded as typed array
2014-08-15 10:46:35 -05:00
Yury Delendik
c2f4b9d301 Merge pull request #5194 from nnethercote/no-absolute
Remove `position: absolute` from text divs.
2014-08-15 10:38:23 -05:00
Jonas Jenwald
9f1e140c4f Add unit test for PDF file loaded as typed array 2014-08-15 17:21:46 +02:00
Yury Delendik
e53a28c996 Merge pull request #5192 from nnethercote/empty-setGState
Ignore setGState no-ops.
2014-08-15 10:20:14 -05:00
Yury Delendik
fa8d385818 Merge pull request #5165 from kkujala/calrgb
implement CalRGB color space
2014-08-15 10:19:49 -05:00
Nicholas Nethercote
9695958ebc Remove position: absolute from text divs.
It's not necessary in each text div, because it's specified in the
`.textLayer > div` rule.
2014-08-15 08:17:20 -07:00
Yury Delendik
5eb6a353d9 Merge pull request #5181 from timvandermeij/svg-optimizations
Optimizes defaults for svg.js
2014-08-15 09:40:41 -05:00
Yury Delendik
9b3c96d5d3 Merge pull request #5186 from Snuffleupagus/fix-CMap-unavailable-error-handling
Fix the error handling for CMaps that fail to load
2014-08-15 08:31:33 -05:00
Yury Delendik
992e7613c1 Merge pull request #5187 from nnethercote/EI-checking
Reduce ASCII checks in makeInlineImage().
2014-08-15 08:29:03 -05:00
Jonas Jenwald
9b480d70eb Merge pull request #5168 from nnethercote/EvaluatorPreprocessor_read
Avoid unnecessary array allocations in EvaluatorPreprocessor_read().
2014-08-15 13:35:05 +02:00
Jonas Jenwald
9d87cbc516 Merge pull request #5191 from nnethercote/getSampleArray-array-length
Right-size the array in getSampleArray().
2014-08-15 11:36:35 +02:00
Nicholas Nethercote
9674abc542 Ignore setGState no-ops.
For the document in #2504, 11% of the ops are `setGState` with a
`gStateObj` that is an empty array, which is a no-op. This is possible
because we ignore various setGState keys (OP, OPM, BG, etc).

This change prevents these ops from being inserted into the operator
list.
2014-08-14 20:46:28 -07:00
Nicholas Nethercote
bcc31b666f Right-size the array in getSampleArray().
This allows the JS engine to do a better job of allocating the right
number of elements for the array, avoiding some resizings. For the PDF
in #2504, this avoids 100s of MiBs of allocations in Firefox.
2014-08-14 18:56:12 -07:00
Nicholas Nethercote
ffae848f4e Reduce ASCII checks in makeInlineImage().
makeInlineImage() has a "are the next five chars ASCII?" check which is
run after an "EI" sequence has been found. This check involves the
creation of a new object because peekBytes() calls subarray().

Unfortunately, the check is currently run on whitespace chars even when
an "EI" sequence has not yet been found, i.e. when it's not needed. For
the PDF in #2618, there are over 820,000 such checks.

This change reworks the relevant loop so that the check is only done
once an "EI" sequence has been seen. This reduces the number of checks
to 157,000, and speeds up rendering by somewhere between 2% and 7% (the
measurements are noisy).
2014-08-14 16:20:58 -07:00
Jonas Jenwald
cd5bd9fb7e Merge pull request #5184 from yurydelendik/cff-width
Use cff glyph width in the hmtx table
2014-08-14 23:40:12 +02:00
Tim van der Meij
1d02ace81f Optimizes defaults for svg.js 2014-08-14 23:14:55 +02:00
Yury Delendik
a2c2f81167 Use cff glyph width in the hmtx table 2014-08-14 16:11:09 -05:00
Tim van der Meij
90afb70e44 Merge pull request #5188 from yurydelendik/svg-refact
Refactors some SVG api and includes svg.js in the build
2014-08-14 23:01:00 +02:00
Kalervo Kujala
1e4a7f981e implement CalRGB color space
Both whitespace and blackspace support are implemented.
2014-08-14 23:49:19 +03:00
Yury Delendik
de23d3791e Fixes image and font embedding 2014-08-14 15:11:27 -05:00