Bug 1321315 - Update pdf.js to version 1.6.355. r=bdahl
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 30 Nov 2016 11:17:02 -0500
changeset 324825 e5b1439dda41fcf6e5b3c75e3c19302c9e3e6cc6
parent 324824 a8eed0b176b532a6f4d8aceba50e65de570499f4
child 324826 00edc44f7cf8dc66473a9a1012edf0129b0dfe7e
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersbdahl
bugs1321315
milestone53.0a1
Bug 1321315 - Update pdf.js to version 1.6.355. r=bdahl
browser/extensions/pdfjs/README.mozilla
browser/extensions/pdfjs/content/build/pdf.js
browser/extensions/pdfjs/content/build/pdf.worker.js
browser/extensions/pdfjs/content/web/viewer.css
browser/extensions/pdfjs/content/web/viewer.js
--- a/browser/extensions/pdfjs/README.mozilla
+++ b/browser/extensions/pdfjs/README.mozilla
@@ -1,3 +1,3 @@
 This is the pdf.js project output, https://github.com/mozilla/pdf.js
 
-Current extension version is: 1.6.329
+Current extension version is: 1.6.355
--- a/browser/extensions/pdfjs/content/build/pdf.js
+++ b/browser/extensions/pdfjs/content/build/pdf.js
@@ -18,18 +18,18 @@
   define('pdfjs-dist/build/pdf', ['exports'], factory);
  } else if (typeof exports !== 'undefined') {
   factory(exports);
  } else {
   factory(root['pdfjsDistBuildPdf'] = {});
  }
 }(this, function (exports) {
  'use strict';
- var pdfjsVersion = '1.6.329';
- var pdfjsBuild = '9c3419d';
+ var pdfjsVersion = '1.6.355';
+ var pdfjsBuild = '451956c';
  var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null;
  var pdfjsLibs = {};
  (function pdfjsWrapper() {
   (function (root, factory) {
    factory(root.pdfjsSharedUtil = {});
   }(this, function (exports) {
    var globalScope = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : this;
    var FONT_IDENTITY_MATRIX = [
@@ -4748,17 +4748,17 @@
        current.fontDirection = 1;
       }
       this.current.font = fontObj;
       this.current.fontSize = size;
       if (fontObj.isType3Font) {
        return;
       }
       var name = fontObj.loadedName || 'sans-serif';
-      var bold = fontObj.black ? fontObj.bold ? '900' : 'bold' : fontObj.bold ? 'bold' : 'normal';
+      var bold = fontObj.black ? '900' : fontObj.bold ? 'bold' : 'normal';
       var italic = fontObj.italic ? 'italic' : 'normal';
       var typeface = '"' + name + '", ' + fontObj.fallbackName;
       var browserFontSize = size < MIN_FONT_SIZE ? MIN_FONT_SIZE : size > MAX_FONT_SIZE ? MAX_FONT_SIZE : size;
       this.current.fontSizeScale = size / browserFontSize;
       var rule = italic + ' ' + bold + ' ' + browserFontSize + 'px ' + typeface;
       this.ctx.font = rule;
      },
      setTextRenderingMode: function CanvasGraphics_setTextRenderingMode(mode) {
@@ -5838,16 +5838,19 @@
       return this.pageIndex + 1;
      },
      get rotate() {
       return this.pageInfo.rotate;
      },
      get ref() {
       return this.pageInfo.ref;
      },
+     get userUnit() {
+      return this.pageInfo.userUnit;
+     },
      get view() {
       return this.pageInfo.view;
      },
      getViewport: function PDFPageProxy_getViewport(scale, rotate) {
       if (arguments.length < 2) {
        rotate = this.rotate;
       }
       return new PageViewport(this.view, scale, rotate, 0, 0);
--- a/browser/extensions/pdfjs/content/build/pdf.worker.js
+++ b/browser/extensions/pdfjs/content/build/pdf.worker.js
@@ -18,18 +18,18 @@
   define('pdfjs-dist/build/pdf.worker', ['exports'], factory);
  } else if (typeof exports !== 'undefined') {
   factory(exports);
  } else {
   factory(root['pdfjsDistBuildPdfWorker'] = {});
  }
 }(this, function (exports) {
  'use strict';
- var pdfjsVersion = '1.6.329';
- var pdfjsBuild = '9c3419d';
+ var pdfjsVersion = '1.6.355';
+ var pdfjsBuild = '451956c';
  var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null;
  var pdfjsLibs = {};
  (function pdfjsWrapper() {
   (function (root, factory) {
    factory(root.pdfjsCoreArithmeticDecoder = {});
   }(this, function (exports) {
    var ArithmeticDecoder = function ArithmeticDecoderClosure() {
     var QeTable = [
@@ -404,761 +404,16 @@
       return d;
      }
     };
     return ArithmeticDecoder;
    }();
    exports.ArithmeticDecoder = ArithmeticDecoder;
   }));
   (function (root, factory) {
-   factory(root.pdfjsCoreBidi = {});
-  }(this, function (exports) {
-   var baseTypes = [
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'S',
-    'B',
-    'S',
-    'WS',
-    'B',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'B',
-    'B',
-    'B',
-    'S',
-    'WS',
-    'ON',
-    'ON',
-    'ET',
-    'ET',
-    'ET',
-    'ON',
-    'ON',
-    'ON',
-    'ON',
-    'ON',
-    'ON',
-    'CS',
-    'ON',
-    'CS',
-    'ON',
-    'EN',
-    'EN',
-    'EN',
-    'EN',
-    'EN',
-    'EN',
-    'EN',
-    'EN',
-    'EN',
-    'EN',
-    'ON',
-    'ON',
-    'ON',
-    'ON',
-    'ON',
-    'ON',
-    'ON',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'ON',
-    'ON',
-    'ON',
-    'ON',
-    'ON',
-    'ON',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'ON',
-    'ON',
-    'ON',
-    'ON',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'B',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'BN',
-    'CS',
-    'ON',
-    'ET',
-    'ET',
-    'ET',
-    'ET',
-    'ON',
-    'ON',
-    'ON',
-    'ON',
-    'L',
-    'ON',
-    'ON',
-    'ON',
-    'ON',
-    'ON',
-    'ET',
-    'ET',
-    'EN',
-    'EN',
-    'ON',
-    'L',
-    'ON',
-    'ON',
-    'ON',
-    'EN',
-    'L',
-    'ON',
-    'ON',
-    'ON',
-    'ON',
-    'ON',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'ON',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'ON',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L',
-    'L'
-   ];
-   var arabicTypes = [
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'CS',
-    'AL',
-    'ON',
-    'ON',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AN',
-    'AN',
-    'AN',
-    'AN',
-    'AN',
-    'AN',
-    'AN',
-    'AN',
-    'AN',
-    'AN',
-    'ET',
-    'AN',
-    'AN',
-    'AL',
-    'AL',
-    'AL',
-    'NSM',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'ON',
-    'NSM',
-    'NSM',
-    'NSM',
-    'NSM',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL',
-    'AL'
-   ];
-   function isOdd(i) {
-    return (i & 1) !== 0;
-   }
-   function isEven(i) {
-    return (i & 1) === 0;
-   }
-   function findUnequal(arr, start, value) {
-    for (var j = start, jj = arr.length; j < jj; ++j) {
-     if (arr[j] !== value) {
-      return j;
-     }
-    }
-    return j;
-   }
-   function setValues(arr, start, end, value) {
-    for (var j = start; j < end; ++j) {
-     arr[j] = value;
-    }
-   }
-   function reverseValues(arr, start, end) {
-    for (var i = start, j = end - 1; i < j; ++i, --j) {
-     var temp = arr[i];
-     arr[i] = arr[j];
-     arr[j] = temp;
-    }
-   }
-   function createBidiText(str, isLTR, vertical) {
-    return {
-     str: str,
-     dir: vertical ? 'ttb' : isLTR ? 'ltr' : 'rtl'
-    };
-   }
-   var chars = [];
-   var types = [];
-   function bidi(str, startLevel, vertical) {
-    var isLTR = true;
-    var strLength = str.length;
-    if (strLength === 0 || vertical) {
-     return createBidiText(str, isLTR, vertical);
-    }
-    chars.length = strLength;
-    types.length = strLength;
-    var numBidi = 0;
-    var i, ii;
-    for (i = 0; i < strLength; ++i) {
-     chars[i] = str.charAt(i);
-     var charCode = str.charCodeAt(i);
-     var charType = 'L';
-     if (charCode <= 0x00ff) {
-      charType = baseTypes[charCode];
-     } else if (0x0590 <= charCode && charCode <= 0x05f4) {
-      charType = 'R';
-     } else if (0x0600 <= charCode && charCode <= 0x06ff) {
-      charType = arabicTypes[charCode & 0xff];
-     } else if (0x0700 <= charCode && charCode <= 0x08AC) {
-      charType = 'AL';
-     }
-     if (charType === 'R' || charType === 'AL' || charType === 'AN') {
-      numBidi++;
-     }
-     types[i] = charType;
-    }
-    if (numBidi === 0) {
-     isLTR = true;
-     return createBidiText(str, isLTR);
-    }
-    if (startLevel === -1) {
-     if (strLength / numBidi < 0.3) {
-      isLTR = true;
-      startLevel = 0;
-     } else {
-      isLTR = false;
-      startLevel = 1;
-     }
-    }
-    var levels = [];
-    for (i = 0; i < strLength; ++i) {
-     levels[i] = startLevel;
-    }
-    var e = isOdd(startLevel) ? 'R' : 'L';
-    var sor = e;
-    var eor = sor;
-    var lastType = sor;
-    for (i = 0; i < strLength; ++i) {
-     if (types[i] === 'NSM') {
-      types[i] = lastType;
-     } else {
-      lastType = types[i];
-     }
-    }
-    lastType = sor;
-    var t;
-    for (i = 0; i < strLength; ++i) {
-     t = types[i];
-     if (t === 'EN') {
-      types[i] = lastType === 'AL' ? 'AN' : 'EN';
-     } else if (t === 'R' || t === 'L' || t === 'AL') {
-      lastType = t;
-     }
-    }
-    for (i = 0; i < strLength; ++i) {
-     t = types[i];
-     if (t === 'AL') {
-      types[i] = 'R';
-     }
-    }
-    for (i = 1; i < strLength - 1; ++i) {
-     if (types[i] === 'ES' && types[i - 1] === 'EN' && types[i + 1] === 'EN') {
-      types[i] = 'EN';
-     }
-     if (types[i] === 'CS' && (types[i - 1] === 'EN' || types[i - 1] === 'AN') && types[i + 1] === types[i - 1]) {
-      types[i] = types[i - 1];
-     }
-    }
-    for (i = 0; i < strLength; ++i) {
-     if (types[i] === 'EN') {
-      var j;
-      for (j = i - 1; j >= 0; --j) {
-       if (types[j] !== 'ET') {
-        break;
-       }
-       types[j] = 'EN';
-      }
-      for (j = i + 1; j < strLength; ++j) {
-       if (types[j] !== 'ET') {
-        break;
-       }
-       types[j] = 'EN';
-      }
-     }
-    }
-    for (i = 0; i < strLength; ++i) {
-     t = types[i];
-     if (t === 'WS' || t === 'ES' || t === 'ET' || t === 'CS') {
-      types[i] = 'ON';
-     }
-    }
-    lastType = sor;
-    for (i = 0; i < strLength; ++i) {
-     t = types[i];
-     if (t === 'EN') {
-      types[i] = lastType === 'L' ? 'L' : 'EN';
-     } else if (t === 'R' || t === 'L') {
-      lastType = t;
-     }
-    }
-    for (i = 0; i < strLength; ++i) {
-     if (types[i] === 'ON') {
-      var end = findUnequal(types, i + 1, 'ON');
-      var before = sor;
-      if (i > 0) {
-       before = types[i - 1];
-      }
-      var after = eor;
-      if (end + 1 < strLength) {
-       after = types[end + 1];
-      }
-      if (before !== 'L') {
-       before = 'R';
-      }
-      if (after !== 'L') {
-       after = 'R';
-      }
-      if (before === after) {
-       setValues(types, i, end, before);
-      }
-      i = end - 1;
-     }
-    }
-    for (i = 0; i < strLength; ++i) {
-     if (types[i] === 'ON') {
-      types[i] = e;
-     }
-    }
-    for (i = 0; i < strLength; ++i) {
-     t = types[i];
-     if (isEven(levels[i])) {
-      if (t === 'R') {
-       levels[i] += 1;
-      } else if (t === 'AN' || t === 'EN') {
-       levels[i] += 2;
-      }
-     } else {
-      if (t === 'L' || t === 'AN' || t === 'EN') {
-       levels[i] += 1;
-      }
-     }
-    }
-    var highestLevel = -1;
-    var lowestOddLevel = 99;
-    var level;
-    for (i = 0, ii = levels.length; i < ii; ++i) {
-     level = levels[i];
-     if (highestLevel < level) {
-      highestLevel = level;
-     }
-     if (lowestOddLevel > level && isOdd(level)) {
-      lowestOddLevel = level;
-     }
-    }
-    for (level = highestLevel; level >= lowestOddLevel; --level) {
-     var start = -1;
-     for (i = 0, ii = levels.length; i < ii; ++i) {
-      if (levels[i] < level) {
-       if (start >= 0) {
-        reverseValues(chars, start, i);
-        start = -1;
-       }
-      } else if (start < 0) {
-       start = i;
-      }
-     }
-     if (start >= 0) {
-      reverseValues(chars, start, levels.length);
-     }
-    }
-    for (i = 0, ii = chars.length; i < ii; ++i) {
-     var ch = chars[i];
-     if (ch === '<' || ch === '>') {
-      chars[i] = '';
-     }
-    }
-    return createBidiText(chars.join(''), isLTR);
-   }
-   exports.bidi = bidi;
-  }));
-  (function (root, factory) {
    factory(root.pdfjsCoreCharsets = {});
   }(this, function (exports) {
    var ISOAdobeCharset = [
     '.notdef',
     'space',
     'exclam',
     'quotedbl',
     'numbersign',
@@ -4868,16 +4123,765 @@
    exports.string32 = string32;
    exports.stringToBytes = stringToBytes;
    exports.stringToPDFString = stringToPDFString;
    exports.stringToUTF8String = stringToUTF8String;
    exports.utf8StringToString = utf8StringToString;
    exports.warn = warn;
   }));
   (function (root, factory) {
+   factory(root.pdfjsCoreBidi = {}, root.pdfjsSharedUtil);
+  }(this, function (exports, sharedUtil) {
+   var warn = sharedUtil.warn;
+   var baseTypes = [
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'S',
+    'B',
+    'S',
+    'WS',
+    'B',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'B',
+    'B',
+    'B',
+    'S',
+    'WS',
+    'ON',
+    'ON',
+    'ET',
+    'ET',
+    'ET',
+    'ON',
+    'ON',
+    'ON',
+    'ON',
+    'ON',
+    'ES',
+    'CS',
+    'ES',
+    'CS',
+    'CS',
+    'EN',
+    'EN',
+    'EN',
+    'EN',
+    'EN',
+    'EN',
+    'EN',
+    'EN',
+    'EN',
+    'EN',
+    'CS',
+    'ON',
+    'ON',
+    'ON',
+    'ON',
+    'ON',
+    'ON',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'ON',
+    'ON',
+    'ON',
+    'ON',
+    'ON',
+    'ON',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'ON',
+    'ON',
+    'ON',
+    'ON',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'B',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'BN',
+    'CS',
+    'ON',
+    'ET',
+    'ET',
+    'ET',
+    'ET',
+    'ON',
+    'ON',
+    'ON',
+    'ON',
+    'L',
+    'ON',
+    'ON',
+    'BN',
+    'ON',
+    'ON',
+    'ET',
+    'ET',
+    'EN',
+    'EN',
+    'ON',
+    'L',
+    'ON',
+    'ON',
+    'ON',
+    'EN',
+    'L',
+    'ON',
+    'ON',
+    'ON',
+    'ON',
+    'ON',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'ON',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'ON',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L',
+    'L'
+   ];
+   var arabicTypes = [
+    'AN',
+    'AN',
+    'AN',
+    'AN',
+    'AN',
+    'AN',
+    'ON',
+    'ON',
+    'AL',
+    'ET',
+    'ET',
+    'AL',
+    'CS',
+    'AL',
+    'ON',
+    'ON',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'AL',
+    'AL',
+    '',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'AN',
+    'AN',
+    'AN',
+    'AN',
+    'AN',
+    'AN',
+    'AN',
+    'AN',
+    'AN',
+    'AN',
+    'ET',
+    'AN',
+    'AN',
+    'AL',
+    'AL',
+    'AL',
+    'NSM',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'AN',
+    'ON',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'AL',
+    'AL',
+    'NSM',
+    'NSM',
+    'ON',
+    'NSM',
+    'NSM',
+    'NSM',
+    'NSM',
+    'AL',
+    'AL',
+    'EN',
+    'EN',
+    'EN',
+    'EN',
+    'EN',
+    'EN',
+    'EN',
+    'EN',
+    'EN',
+    'EN',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL',
+    'AL'
+   ];
+   function isOdd(i) {
+    return (i & 1) !== 0;
+   }
+   function isEven(i) {
+    return (i & 1) === 0;
+   }
+   function findUnequal(arr, start, value) {
+    for (var j = start, jj = arr.length; j < jj; ++j) {
+     if (arr[j] !== value) {
+      return j;
+     }
+    }
+    return j;
+   }
+   function setValues(arr, start, end, value) {
+    for (var j = start; j < end; ++j) {
+     arr[j] = value;
+    }
+   }
+   function reverseValues(arr, start, end) {
+    for (var i = start, j = end - 1; i < j; ++i, --j) {
+     var temp = arr[i];
+     arr[i] = arr[j];
+     arr[j] = temp;
+    }
+   }
+   function createBidiText(str, isLTR, vertical) {
+    return {
+     str: str,
+     dir: vertical ? 'ttb' : isLTR ? 'ltr' : 'rtl'
+    };
+   }
+   var chars = [];
+   var types = [];
+   function bidi(str, startLevel, vertical) {
+    var isLTR = true;
+    var strLength = str.length;
+    if (strLength === 0 || vertical) {
+     return createBidiText(str, isLTR, vertical);
+    }
+    chars.length = strLength;
+    types.length = strLength;
+    var numBidi = 0;
+    var i, ii;
+    for (i = 0; i < strLength; ++i) {
+     chars[i] = str.charAt(i);
+     var charCode = str.charCodeAt(i);
+     var charType = 'L';
+     if (charCode <= 0x00ff) {
+      charType = baseTypes[charCode];
+     } else if (0x0590 <= charCode && charCode <= 0x05f4) {
+      charType = 'R';
+     } else if (0x0600 <= charCode && charCode <= 0x06ff) {
+      charType = arabicTypes[charCode & 0xff];
+      if (!charType) {
+       warn('Bidi: invalid Unicode character ' + charCode.toString(16));
+      }
+     } else if (0x0700 <= charCode && charCode <= 0x08AC) {
+      charType = 'AL';
+     }
+     if (charType === 'R' || charType === 'AL' || charType === 'AN') {
+      numBidi++;
+     }
+     types[i] = charType;
+    }
+    if (numBidi === 0) {
+     isLTR = true;
+     return createBidiText(str, isLTR);
+    }
+    if (startLevel === -1) {
+     if (strLength / numBidi < 0.3) {
+      isLTR = true;
+      startLevel = 0;
+     } else {
+      isLTR = false;
+      startLevel = 1;
+     }
+    }
+    var levels = [];
+    for (i = 0; i < strLength; ++i) {
+     levels[i] = startLevel;
+    }
+    var e = isOdd(startLevel) ? 'R' : 'L';
+    var sor = e;
+    var eor = sor;
+    var lastType = sor;
+    for (i = 0; i < strLength; ++i) {
+     if (types[i] === 'NSM') {
+      types[i] = lastType;
+     } else {
+      lastType = types[i];
+     }
+    }
+    lastType = sor;
+    var t;
+    for (i = 0; i < strLength; ++i) {
+     t = types[i];
+     if (t === 'EN') {
+      types[i] = lastType === 'AL' ? 'AN' : 'EN';
+     } else if (t === 'R' || t === 'L' || t === 'AL') {
+      lastType = t;
+     }
+    }
+    for (i = 0; i < strLength; ++i) {
+     t = types[i];
+     if (t === 'AL') {
+      types[i] = 'R';
+     }
+    }
+    for (i = 1; i < strLength - 1; ++i) {
+     if (types[i] === 'ES' && types[i - 1] === 'EN' && types[i + 1] === 'EN') {
+      types[i] = 'EN';
+     }
+     if (types[i] === 'CS' && (types[i - 1] === 'EN' || types[i - 1] === 'AN') && types[i + 1] === types[i - 1]) {
+      types[i] = types[i - 1];
+     }
+    }
+    for (i = 0; i < strLength; ++i) {
+     if (types[i] === 'EN') {
+      var j;
+      for (j = i - 1; j >= 0; --j) {
+       if (types[j] !== 'ET') {
+        break;
+       }
+       types[j] = 'EN';
+      }
+      for (j = i + 1; j < strLength; ++j) {
+       if (types[j] !== 'ET') {
+        break;
+       }
+       types[j] = 'EN';
+      }
+     }
+    }
+    for (i = 0; i < strLength; ++i) {
+     t = types[i];
+     if (t === 'WS' || t === 'ES' || t === 'ET' || t === 'CS') {
+      types[i] = 'ON';
+     }
+    }
+    lastType = sor;
+    for (i = 0; i < strLength; ++i) {
+     t = types[i];
+     if (t === 'EN') {
+      types[i] = lastType === 'L' ? 'L' : 'EN';
+     } else if (t === 'R' || t === 'L') {
+      lastType = t;
+     }
+    }
+    for (i = 0; i < strLength; ++i) {
+     if (types[i] === 'ON') {
+      var end = findUnequal(types, i + 1, 'ON');
+      var before = sor;
+      if (i > 0) {
+       before = types[i - 1];
+      }
+      var after = eor;
+      if (end + 1 < strLength) {
+       after = types[end + 1];
+      }
+      if (before !== 'L') {
+       before = 'R';
+      }
+      if (after !== 'L') {
+       after = 'R';
+      }
+      if (before === after) {
+       setValues(types, i, end, before);
+      }
+      i = end - 1;
+     }
+    }
+    for (i = 0; i < strLength; ++i) {
+     if (types[i] === 'ON') {
+      types[i] = e;
+     }
+    }
+    for (i = 0; i < strLength; ++i) {
+     t = types[i];
+     if (isEven(levels[i])) {
+      if (t === 'R') {
+       levels[i] += 1;
+      } else if (t === 'AN' || t === 'EN') {
+       levels[i] += 2;
+      }
+     } else {
+      if (t === 'L' || t === 'AN' || t === 'EN') {
+       levels[i] += 1;
+      }
+     }
+    }
+    var highestLevel = -1;
+    var lowestOddLevel = 99;
+    var level;
+    for (i = 0, ii = levels.length; i < ii; ++i) {
+     level = levels[i];
+     if (highestLevel < level) {
+      highestLevel = level;
+     }
+     if (lowestOddLevel > level && isOdd(level)) {
+      lowestOddLevel = level;
+     }
+    }
+    for (level = highestLevel; level >= lowestOddLevel; --level) {
+     var start = -1;
+     for (i = 0, ii = levels.length; i < ii; ++i) {
+      if (levels[i] < level) {
+       if (start >= 0) {
+        reverseValues(chars, start, i);
+        start = -1;
+       }
+      } else if (start < 0) {
+       start = i;
+      }
+     }
+     if (start >= 0) {
+      reverseValues(chars, start, levels.length);
+     }
+    }
+    for (i = 0, ii = chars.length; i < ii; ++i) {
+     var ch = chars[i];
+     if (ch === '<' || ch === '>') {
+      chars[i] = '';
+     }
+    }
+    return createBidiText(chars.join(''), isLTR);
+   }
+   exports.bidi = bidi;
+  }));
+  (function (root, factory) {
    factory(root.pdfjsCoreCFFParser = {}, root.pdfjsSharedUtil, root.pdfjsCoreCharsets, root.pdfjsCoreEncodings);
   }(this, function (exports, sharedUtil, coreCharsets, coreEncodings) {
    var error = sharedUtil.error;
    var info = sharedUtil.info;
    var bytesToString = sharedUtil.bytesToString;
    var warn = sharedUtil.warn;
    var isArray = sharedUtil.isArray;
    var Util = sharedUtil.Util;
@@ -19627,16 +19631,20 @@
     t['ArialNarrow'] = 'Helvetica';
     t['ArialNarrow-Bold'] = 'Helvetica-Bold';
     t['ArialNarrow-BoldItalic'] = 'Helvetica-BoldOblique';
     t['ArialNarrow-Italic'] = 'Helvetica-Oblique';
     t['ArialBlack'] = 'Helvetica';
     t['ArialBlack-Bold'] = 'Helvetica-Bold';
     t['ArialBlack-BoldItalic'] = 'Helvetica-BoldOblique';
     t['ArialBlack-Italic'] = 'Helvetica-Oblique';
+    t['Arial-Black'] = 'Helvetica';
+    t['Arial-Black-Bold'] = 'Helvetica-Bold';
+    t['Arial-Black-BoldItalic'] = 'Helvetica-BoldOblique';
+    t['Arial-Black-Italic'] = 'Helvetica-Oblique';
     t['Arial'] = 'Helvetica';
     t['Arial-Bold'] = 'Helvetica-Bold';
     t['Arial-BoldItalic'] = 'Helvetica-BoldOblique';
     t['Arial-Italic'] = 'Helvetica-Oblique';
     t['Arial-BoldItalicMT'] = 'Helvetica-BoldOblique';
     t['Arial-BoldMT'] = 'Helvetica-Bold';
     t['Arial-ItalicMT'] = 'Helvetica-Oblique';
     t['ArialMT'] = 'Helvetica';
@@ -19700,16 +19708,17 @@
     t['MS-PGothic'] = 'MS PGothic';
     t['MS-PGothic-Bold'] = 'MS PGothic-Bold';
     t['MS-PGothic-BoldItalic'] = 'MS PGothic-BoldItalic';
     t['MS-PGothic-Italic'] = 'MS PGothic-Italic';
     t['MS-PMincho'] = 'MS PMincho';
     t['MS-PMincho-Bold'] = 'MS PMincho-Bold';
     t['MS-PMincho-BoldItalic'] = 'MS PMincho-BoldItalic';
     t['MS-PMincho-Italic'] = 'MS PMincho-Italic';
+    t['NuptialScript'] = 'Times-Italic';
     t['Wingdings'] = 'ZapfDingbats';
    });
    var getSerifFonts = getLookupTableFactory(function (t) {
     t['Adobe Jenson'] = true;
     t['Adobe Text'] = true;
     t['Albertus'] = true;
     t['Aldus'] = true;
     t['Alexandria'] = true;
@@ -19800,16 +19809,17 @@
     t['Modern'] = true;
     t['Mona Lisa'] = true;
     t['Mrs Eaves'] = true;
     t['MS Serif'] = true;
     t['Museo Slab'] = true;
     t['New York'] = true;
     t['Nimbus Roman'] = true;
     t['NPS Rawlinson Roadway'] = true;
+    t['NuptialScript'] = true;
     t['Palatino'] = true;
     t['Perpetua'] = true;
     t['Plantin'] = true;
     t['Plantin Schoolbook'] = true;
     t['Playbill'] = true;
     t['Poor Richard'] = true;
     t['Rawlinson Roadway'] = true;
     t['Renault'] = true;
@@ -36786,17 +36796,17 @@
       this.black = name.search(/Black/g) !== -1;
       this.remeasure = Object.keys(this.widths).length > 0;
       if (isStandardFont && type === 'CIDFontType2' && properties.cidEncoding.indexOf('Identity-') === 0) {
        var GlyphMapForStandardFonts = getGlyphMapForStandardFonts();
        var map = [];
        for (charCode in GlyphMapForStandardFonts) {
         map[+charCode] = GlyphMapForStandardFonts[charCode];
        }
-       if (/ArialBlack/i.test(name)) {
+       if (/Arial-?Black/i.test(name)) {
         var SupplementalGlyphMapForArialBlack = getSupplementalGlyphMapForArialBlack();
         for (charCode in SupplementalGlyphMapForArialBlack) {
          map[+charCode] = SupplementalGlyphMapForArialBlack[charCode];
         }
        }
        var isIdentityUnicode = this.toUnicode instanceof IdentityToUnicodeMap;
        if (!isIdentityUnicode) {
         this.toUnicode.forEach(function (charCode, unicodeCharCode) {
@@ -45434,18 +45444,23 @@
        }
        if (baseEncodingName !== 'MacRomanEncoding' && baseEncodingName !== 'MacExpertEncoding' && baseEncodingName !== 'WinAnsiEncoding') {
         baseEncodingName = null;
        }
       }
       if (baseEncodingName) {
        properties.defaultEncoding = getEncoding(baseEncodingName).slice();
       } else {
-       encoding = properties.type === 'TrueType' ? WinAnsiEncoding : StandardEncoding;
-       if (!!(properties.flags & FontFlags.Symbolic)) {
+       var isSymbolicFont = !!(properties.flags & FontFlags.Symbolic);
+       var isNonsymbolicFont = !!(properties.flags & FontFlags.Nonsymbolic);
+       encoding = StandardEncoding;
+       if (properties.type === 'TrueType' && !isNonsymbolicFont) {
+        encoding = WinAnsiEncoding;
+       }
+       if (isSymbolicFont) {
         encoding = MacRomanEncoding;
         if (!properties.file) {
          if (/Symbol/i.test(properties.name)) {
           encoding = SymbolSetEncoding;
          } else if (/Dingbats/i.test(properties.name)) {
           encoding = ZapfDingbatsEncoding;
          }
         }
@@ -47632,16 +47647,17 @@
   }(this, function (exports, sharedUtil, corePrimitives, coreStream, coreObj, coreParser, coreCrypto, coreEvaluator, coreAnnotation) {
    var MissingDataException = sharedUtil.MissingDataException;
    var Util = sharedUtil.Util;
    var assert = sharedUtil.assert;
    var error = sharedUtil.error;
    var info = sharedUtil.info;
    var isArray = sharedUtil.isArray;
    var isArrayBuffer = sharedUtil.isArrayBuffer;
+   var isNum = sharedUtil.isNum;
    var isString = sharedUtil.isString;
    var shadow = sharedUtil.shadow;
    var stringToBytes = sharedUtil.stringToBytes;
    var stringToPDFString = sharedUtil.stringToPDFString;
    var warn = sharedUtil.warn;
    var isSpace = sharedUtil.isSpace;
    var Dict = corePrimitives.Dict;
    var isDict = corePrimitives.isDict;
@@ -47655,16 +47671,17 @@
    var XRef = coreObj.XRef;
    var Linearization = coreParser.Linearization;
    var calculateMD5 = coreCrypto.calculateMD5;
    var OperatorList = coreEvaluator.OperatorList;
    var PartialEvaluator = coreEvaluator.PartialEvaluator;
    var Annotation = coreAnnotation.Annotation;
    var AnnotationFactory = coreAnnotation.AnnotationFactory;
    var Page = function PageClosure() {
+    var DEFAULT_USER_UNIT = 1.0;
     var LETTER_SIZE_MEDIABOX = [
      0,
      0,
      612,
      792
     ];
     function Page(pdfManager, xref, pageIndex, pageDict, ref, fontCache) {
      this.pdfManager = pdfManager;
@@ -47715,16 +47732,23 @@
      },
      get mediaBox() {
       var obj = this.getInheritedPageProp('MediaBox');
       if (!isArray(obj) || obj.length !== 4) {
        obj = LETTER_SIZE_MEDIABOX;
       }
       return shadow(this, 'mediaBox', obj);
      },
+     get userUnit() {
+      var obj = this.getPageProp('UserUnit');
+      if (!isNum(obj) || obj <= 0) {
+       obj = DEFAULT_USER_UNIT;
+      }
+      return shadow(this, 'userUnit', obj);
+     },
      get view() {
       var mediaBox = this.mediaBox;
       var cropBox = this.getInheritedPageProp('CropBox');
       if (!isArray(cropBox) || cropBox.length !== 4) {
        return shadow(this, 'view', mediaBox);
       }
       cropBox = Util.intersect(cropBox, mediaBox);
       if (!cropBox) {
@@ -48798,26 +48822,29 @@
         });
        }, onFailure);
       }, onFailure);
      };
      handler.on('GetPage', function wphSetupGetPage(data) {
       return pdfManager.getPage(data.pageIndex).then(function (page) {
        var rotatePromise = pdfManager.ensure(page, 'rotate');
        var refPromise = pdfManager.ensure(page, 'ref');
+       var userUnitPromise = pdfManager.ensure(page, 'userUnit');
        var viewPromise = pdfManager.ensure(page, 'view');
        return Promise.all([
         rotatePromise,
         refPromise,
+        userUnitPromise,
         viewPromise
        ]).then(function (results) {
         return {
          rotate: results[0],
          ref: results[1],
-         view: results[2]
+         userUnit: results[2],
+         view: results[3]
         };
        });
       });
      });
      handler.on('GetPageIndex', function wphSetupGetPageIndex(data) {
       var ref = new Ref(data.ref.num, data.ref.gen);
       var catalog = pdfManager.pdfDocument.catalog;
       return catalog.getPageIndex(ref);
--- a/browser/extensions/pdfjs/content/web/viewer.css
+++ b/browser/extensions/pdfjs/content/web/viewer.css
@@ -926,21 +926,16 @@ html[dir='rtl'] .toolbarButton:first-chi
 }
 
 .toolbarButtonSpacer {
   width: 30px;
   display: inline-block;
   height: 1px;
 }
 
-.toolbarButtonFlexibleSpacer {
-  -moz-box-flex: 1;
-  min-width: 30px;
-}
-
 html[dir='ltr'] #findPrevious {
   margin-left: 3px;
 }
 html[dir='ltr'] #findNext {
   margin-right: 3px;
 }
 
 html[dir='rtl'] #findPrevious {
--- a/browser/extensions/pdfjs/content/web/viewer.js
+++ b/browser/extensions/pdfjs/content/web/viewer.js
@@ -502,23 +502,23 @@ var pdfjsWebLibs;
       this.file = database.files[index];
       this.database = database;
      }.bind(this));
     }
     ViewHistory.prototype = {
      _writeToStorage: function ViewHistory_writeToStorage() {
       return new Promise(function (resolve) {
        var databaseStr = JSON.stringify(this.database);
-       sessionStorage.setItem('pdfjsHistory', databaseStr);
+       sessionStorage.setItem('pdfjs.history', databaseStr);
        resolve();
       }.bind(this));
      },
      _readFromStorage: function ViewHistory_readFromStorage() {
       return new Promise(function (resolve) {
-       resolve(sessionStorage.getItem('pdfjsHistory'));
+       resolve(sessionStorage.getItem('pdfjs.history'));
       });
      },
      set: function ViewHistory_set(name, val) {
       if (!this.isInitializedPromiseResolved) {
        return;
       }
       this.file[name] = val;
       return this._writeToStorage();
@@ -4258,17 +4258,23 @@ var pdfjsWebLibs;
        resolveRenderPromise(undefined);
       }, function pdfPageRenderError(error) {
        showCanvas();
        rejectRenderPromise(error);
       });
       return result;
      },
      paintOnSvg: function PDFPageView_paintOnSvg(wrapper) {
-      return Promise.resolve('SVG rendering is not supported.');
+      return {
+       promise: Promise.reject(new Error('SVG rendering is not supported.')),
+       onRenderContinue: function (cont) {
+       },
+       cancel: function () {
+       }
+      };
      },
      setPageLabel: function PDFView_setPageLabel(label) {
       this.pageLabel = typeof label === 'string' ? label : null;
       if (this.pageLabel !== null) {
        this.div.setAttribute('data-page-label', this.pageLabel);
       } else {
        this.div.removeAttribute('data-page-label');
       }