Closed Bug 1148192 Opened 5 years ago Closed 5 years ago

Update pdf.js to version 1.1.24

Categories

(Firefox :: PDF Viewer, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 39
Tracking Status
firefox39 --- fixed

People

(Reporter: RyanVM, Assigned: RyanVM)

References

Details

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #1135021 +++

Changes since last update:
#5763 Update to version 1.0.1149
#5748 Fetch parameters if they are a |Ref| in CalGray/CalRGB color spaces (issue 5747)
#5744 Fix regression that prevents resetting the zoom level to "Automatic" when using the |Ctrl + 0| keys
#5721 Move the call to |PDFFindController.resolveFirstPage| into PDFViewer
#5731 Skip fill bytes (0xFF) when decoding JPEG images (issue 5331)
#5711 Remove the |el| property in PDFPageView and PDFThumbnailView
#5586 Update thumbnails only when they are visible (to improve scrolling through large documents)
#5758 Add option to open external links in new window
#5693 cleaned whitespace
#5769 nbsp normalization
#5680 Reset state upon load if showPreviousViewOnLoad
#5771 Remove unused isNull utility function
#5778 Add a |text| test-case for issue 5421
#5734 Lower space factor threshold
#5806 Add a reduced test-case for issue 5734
#5802 Embedded Viewer Should Not Override Page Title
#5770 Correctly detect OpenType font files with CFF data
#5819 Using newChannel2 instead of newChannel in the extension.
#5595 Use binary search in getVisibleElements()
#5582 Fix handling of "Fit" zoom values in setHash (issue 5581)
#5692 [l10n] Treat language as case-insensitive
#5821 Correctly detect the presence of the Adobe specific APP14 JPEG marker (bug 1140761)
#5826 WebL10n update (March 2015)
#5829 Fixes minor typo from #5826
#5785 Revert PR 5510, except in WebKit browsers, for breaking print preview in Firefox
#5838 Make presentation mode work again in Safari
#5843 Enable OPS.setHScale in the SVG backend
#5848 Fix the node getinfo.js example
#5851 V1.1
#5855 Remove broken links from hello world example
#5856 Improve the instructions for the 'hello world' example
#5844 Add a |PDFViewer| option to remove the border shadow around pages (issue 5559)
#5866 Add |pageActualOption| to the list of predefined zoom options in the |scalechange| event handler in viewer.js
#5749 Bug 1072350 - Removing CPOWs used by Find events.
#5705 Don't map glyphs to Unicode "Dotted circle" combining mark (bug 1108301)
#5878 PR 5749 followup
#5713 Create a IdentityToUnicodeMap in evaluator.js when toUnicode contains IdentityH/IdentityV
#5868 Add custom |outlineloaded| and |attachmentsloaded| events to the viewer (bug 1112947)
#5882 Don't map glyphs to Unicode position 0x0E33, i.e. Thai character SARA AM (bug1046314)
r?Mossop for the PdfStreamConverter.jsm changes, r?bdahl for the rest.
Assignee: nobody → ryanvm
Status: NEW → ASSIGNED
Attachment #8584152 - Flags: review?(dtownsend)
Attachment #8584152 - Flags: review?(bdahl)
Attachment #8584152 - Flags: review?(bdahl) → review+
Tracking for 39.  We probably also want to put this in release notes.
Comment on attachment 8584152 [details] [diff] [review]
Update pdf.js to version 1.1.24

Review of attachment 8584152 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/extensions/pdfjs/content/PdfStreamConverter.jsm
@@ +461,5 @@
> +                              .getInterface(Ci.nsIDocShell)
> +                              .sameTypeRootTreeItem
> +                              .QueryInterface(Ci.nsIDocShell)
> +                              .QueryInterface(Ci.nsIInterfaceRequestor)
> +                              .getInterface(Ci.nsIContentFrameMessageManager);

I think just this works:

var winmm = this.domWindow.QueryInterface(Ci.nsIInterfaceRequestor)
                          .getInterface(Ci.nsIDocShell)
                          .QueryInterface(Ci.nsIInterfaceRequestor)
                          .getInterface(Ci.nsIContentFrameMessageManager);

You certainly don't need the double QI in the middle there.

::: browser/extensions/pdfjs/content/PdfjsChromeUtils.jsm
@@ +195,5 @@
> +
> +  handleEvent: function(aEvent) {
> +    // We cannot just forward the message as a CPOW without setting up
> +    // __exposedProps__ on it. Instead, let's just create a structured
> +    // cloneable version of the event for performance and for the ease of usage.

This isn't actually true, any object can be passed as a CPOW, but I'm glad you don't anyway so just correct the comment.

@@ +205,5 @@
> +      findPrevious: aEvent.detail.findPrevious
> +    };
> +
> +    let chromeWindow = aEvent.target.ownerDocument.defaultView;
> +    let browser = chromeWindow.gBrowser.selectedBrowser;

aEvent.currentTarget should be the findbar so aEvent.currentTarget.browser should be its associated browser. Use that instead of assuming the browser is selected.

@@ +208,5 @@
> +    let chromeWindow = aEvent.target.ownerDocument.defaultView;
> +    let browser = chromeWindow.gBrowser.selectedBrowser;
> +    if (this._browsers.has(browser)) {
> +      // Only forward the events if the selected browser is a registered
> +      // browser.

We shouldn't ever get here unless its a registered browser, maybe log an error if not?
Attachment #8584152 - Flags: review?(dtownsend) → review+
https://hg.mozilla.org/mozilla-central/rev/6e2c2cddd92e
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 39
Untracking for 39, looks good.
Blocks: 1157827
Depends on: 1182130
Depends on: 1186827
No longer depends on: 1186827
You need to log in before you can comment on or make changes to this bug.