Last Comment Bug 784718 - Update pdf.js for FF17
: Update pdf.js for FF17
Status: RESOLVED FIXED
:
Product: Firefox
Classification: Client Software
Component: PDF Viewer (show other bugs)
: Trunk
: x86 Mac OS X
: -- normal (vote)
: Firefox 17
Assigned To: Brendan Dahl [:bdahl]
:
Mentors:
Depends on: 786219
Blocks: 776026 782217
  Show dependency treegraph
 
Reported: 2012-08-22 10:25 PDT by Brendan Dahl [:bdahl]
Modified: 2013-04-24 09:56 PDT (History)
3 users (show)
ryanvm: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
pdf.js 0.4.3 (100.27 KB, patch)
2012-08-22 10:34 PDT, Brendan Dahl [:bdahl]
no flags Details | Diff | Review
pdf.js 0.4.11 (102.71 KB, patch)
2012-08-23 15:37 PDT, Brendan Dahl [:bdahl]
dtownsend: review+
Details | Diff | Review

Description Brendan Dahl [:bdahl] 2012-08-22 10:25:34 PDT

    
Comment 1 Brendan Dahl [:bdahl] 2012-08-22 10:31:01 PDT
Release Notes
#1899 Catch errors when parsing the linearization header.
#1901 Sync up a few files with mozcentral.  Address mozcentral review comments.
#1903 Also check abbreviation for colorspace in jpegs.
#1839 Speedup textLayer creation
#1915 Don't trigger TODO on marked content.
#1910 Support more type 1 font hsbw formats.
#1909 Prevent the error callback from being called twice when getPdf fails because of a cross domain request.
#1892 Add support for type 1 seac charstring command.
#1840 Moves loading of the binary PDF data to the worker
#1926 Allow relative URLs in getDocument
#1919 Updated Japanese locale
#1939 Update danish locale
#1938 Presentation Mode - Replaces #1388
#1952 Fixes Shading.Dummy return type
#1942 Workaround Opera background style in <select> element.
#1908 Fix initial scroll direction detection.
#1947 Fix loading of the font widths
#1956 Clean up the test manifest file.
#1958 Update Spanish l10n
#1961 Use timeout for font ready callback to avoid intermittent chrome failure
#1957 Sanitize the document info.
#1964 Improved page tracking on scrolling [squashed]
#1965 Added .DS_Store reference in gitignore file
#1953 Add B2G build and new preprocessor.
#1963 Fix some minor issues/nits detected by JetBrains' WebStorm inspector.
#1962 Adds overrideMimeType for IE10 and discontinues readAsBinaryString use
#1967 Cleanup references to dom elements.
#1974 Changing cubic spline interpolation error to TODO
#1972 Finds correct window/notification box for fallback message
#1971 Using fast pixels copy in putBinaryImageData
#1981 Update Japanese l10n
#1976 Marks xref entries with offset 0 as free
#1977 Adds callothersubr support
#1978 Fixes bias calculation for type2 subr
#1975 Simulate support of data URIs for IE10
#1979 Discards invalid values for Blues
#1992 Stop streams from being sent from worker for indexed color spaces.
#2002 Adds textlayer debug modes
#2001 Adds stub of the PdfJs.jsm
#2005 Removes horizontal lines in scanned images
#1943 Implements loading PDF data by extension/chrome
#1999 Add carriage return checks to make.js.
#2009 Correct gjslint warnings in builder.js.
#2010 [cherry-pick #1997] Update src/fonts.js
#2012 Bump version to 0.4

Try Run:
https://tbpl.mozilla.org/?tree=Try&rev=7eef1b5bc211
Comment 2 Brendan Dahl [:bdahl] 2012-08-22 10:34:36 PDT
Created attachment 654256 [details] [diff] [review]
pdf.js 0.4.3

As usual most of the changes are in content only code, but there has been a change to pdfstreamconverter.js.  We now load the pdf in chrome code and send it to the content code (see https://github.com/mozilla/pdf.js/pull/1943).
Comment 3 Brendan Dahl [:bdahl] 2012-08-23 15:37:49 PDT
Created attachment 654822 [details] [diff] [review]
pdf.js 0.4.11

Small fix for when servers report a bad length or offset.
Comment 4 Dave Townsend [:mossop] 2012-08-25 22:30:07 PDT
Comment on attachment 654822 [details] [diff] [review]
pdf.js 0.4.11

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

::: browser/extensions/pdfjs/components/PdfStreamConverter.js
@@ +327,5 @@
> +    }
> +    if (!notificationBox) {
> +      log('Unable to get a notification box for the fallback message');
> +      return;
> +    }

This is ok for now but I don't think you need the loop here, you can just directly get the main window for the child document using something like this https://developer.mozilla.org/en-US/docs/Working_with_windows_in_chrome_code#Accessing_the_elements_of_the_top-level_document_from_a_child_window

I think there may also be a frameElement property on one of those interfaces that gives you the browser element for the child window too.
Comment 5 Brendan Dahl [:bdahl] 2012-08-26 10:06:05 PDT
Thanks, for the review.  I opened an issue on github for the feedback and we'll update in the next version. https://github.com/mozilla/pdf.js/issues/2027
Comment 6 Ryan VanderMeulen [:RyanVM] 2012-08-26 10:36:32 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/11a5ebc0e43a
Comment 7 Ryan VanderMeulen [:RyanVM] 2012-08-26 19:26:26 PDT
https://hg.mozilla.org/mozilla-central/rev/11a5ebc0e43a
Comment 8 Jan Varga [:janv] 2012-09-16 02:40:32 PDT
     // Keep the URL the same so the browser sees it as the same.
     channel.originalURI = aRequest.URI;
     channel.asyncOpen(proxy, aContext);
+    if (useFetchByChrome) {
+      // We can use resource principal when data is fetched by the chrome
+      // e.g. useful for NoScript
+      var securityManager = Cc['@mozilla.org/scriptsecuritymanager;1']
+                            .getService(Ci.nsIScriptSecurityManager);
+      var uri = ioService.newURI(PDF_VIEWER_WEB_PAGE, null, null);
+      // FF16 and below had getCodebasePrincipal (bug 774585)
+      var resourcePrincipal = 'getSimpleCodebasePrincipal' in securityManager ?
+                              securityManager.getSimpleCodebasePrincipal(uri) :
+                              securityManager.getCodebasePrincipal(uri);
+      channel.owner = resourcePrincipal;
+    }
   },


I'm going to replace getSimpleCodebasePrincipal() with getNoAppCodebasePrincipal() to fix a crash. See bug 773373
Comment 9 Yury Delendik (:yury) 2012-09-16 11:40:54 PDT
(In reply to Jan Varga [:janv] from comment #8)
> I'm going to replace getSimpleCodebasePrincipal() with
> getNoAppCodebasePrincipal() to fix a crash. See bug 773373

You would need to remove "FF16 and below" comment and logic as well:

  var resourcePrincipal = securityManager.getNoAppCodebasePrincipal(uri);

The issue https://github.com/mozilla/pdf.js/issues/2134 opened to add fallback logic for the pdf.js addon

Note You need to log in before you can comment on or make changes to this bug.