[Basilisk] Revert "Update PDF.js to 2.3.235" as it breaks in e10s

This commit is contained in:
roytam1 2023-10-06 11:38:43 +08:00
commit e90473bdda
29 changed files with 56983 additions and 74493 deletions

View file

@ -1,7 +0,0 @@
This is a port of IsaacSchemm's PDF.JS for SeaMonkey addon, https://github.com/IsaacSchemm/pdf.js-seamonkey
Current extension version is: 2.3.235
Taken from https://github.com/IsaacSchemm/pdf.js-seamonkey/releases/tag/v2.3.235
PdfJs.jsm ported from Firefox 60.9.0's version of PDF.js

View file

@ -0,0 +1,3 @@
This is the pdf.js project output, https://github.com/mozilla/pdf.js
Current extension version is: 1.7.348

View file

@ -12,6 +12,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* globals Components, Services, XPCOMUtils, PdfjsChromeUtils,
PdfjsContentUtils, PdfStreamConverter */
"use strict";
@ -19,6 +21,7 @@ var EXPORTED_SYMBOLS = ["PdfJs"];
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
const Cm = Components.manager;
const Cu = Components.utils;
@ -29,10 +32,6 @@ const PREF_PREVIOUS_ACTION = PREF_PREFIX + ".previousHandler.preferredAction";
const PREF_PREVIOUS_ASK = PREF_PREFIX +
".previousHandler.alwaysAskBeforeHandling";
const PREF_DISABLED_PLUGIN_TYPES = "plugin.disable_full_page_plugin_for_types";
const PREF_ENABLED_CACHE_STATE = PREF_PREFIX + ".enabledCache.state";
const PREF_ENABLED_CACHE_INITIALIZED = PREF_PREFIX +
".enabledCache.initialized";
const PREF_APP_UPDATE_POSTUPDATE = "app.update.postupdate";
const TOPIC_PDFJS_HANDLER_CHANGED = "pdfjs:handlerChanged";
const TOPIC_PLUGINS_LIST_UPDATED = "plugins-list-updated";
const TOPIC_PLUGIN_INFO_UPDATED = "plugin-info-updated";
@ -49,9 +48,9 @@ XPCOMUtils.defineLazyServiceGetter(Svc, "pluginHost",
"@mozilla.org/plugin/host;1",
"nsIPluginHost");
XPCOMUtils.defineLazyModuleGetter(this, "PdfjsChromeUtils",
"resource://pdf.js/PdfjsChromeUtils.jsm");
"resource://pdf.js/PdfjsChromeUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PdfjsContentUtils",
"resource://pdf.js/PdfjsContentUtils.jsm");
"resource://pdf.js/PdfjsContentUtils.jsm");
function getBoolPref(aPref, aDefaultValue) {
try {
@ -70,38 +69,35 @@ function getIntPref(aPref, aDefaultValue) {
}
function isDefaultHandler() {
if (Services.appinfo.processType !== Services.appinfo.PROCESS_TYPE_DEFAULT) {
throw new Error("isDefaultHandler should only get called in the parent " +
"process.");
}
return PdfjsChromeUtils.isDefaultHandlerApp();
if (Services.appinfo.processType === Services.appinfo.PROCESS_TYPE_CONTENT) {
return PdfjsContentUtils.isDefaultHandlerApp();
}
return PdfjsChromeUtils.isDefaultHandlerApp();
}
function initializeDefaultPreferences() {
/* eslint-disable semi */
var DEFAULT_PREFERENCES =
{
"showPreviousViewOnLoad": true,
"defaultZoomValue": "",
"sidebarViewOnLoad": 0,
"cursorToolOnLoad": 0,
"enableHandToolOnLoad": false,
"enableWebGL": false,
"pdfBugEnabled": false,
"disableRange": false,
"disableStream": false,
"disableAutoFetch": false,
"disableFontFace": false,
"textLayerMode": 1,
"disableTextLayer": false,
"useOnlyCssZoom": false,
"externalLinkTarget": 0,
"enhanceTextSelection": false,
"renderer": "canvas",
"renderInteractiveForms": false,
"enablePrintAutoRotate": false,
"disablePageMode": false,
"disablePageLabels": false
}
/* eslint-enable semi */
var defaultBranch = Services.prefs.getDefaultBranch(PREF_PREFIX + ".");
var defaultValue;
@ -149,7 +145,7 @@ Factory.prototype = {
registrar.unregisterFactory(this._classID2, this._factory);
}
this._factory = null;
},
}
};
var PdfJs = {
@ -193,10 +189,10 @@ var PdfJs = {
},
updateRegistration: function updateRegistration() {
if (this.checkEnabled()) {
this.ensureRegistered();
if (this.enabled) {
this._ensureRegistered();
} else {
this.ensureUnregistered();
this._ensureUnregistered();
}
},
@ -209,7 +205,7 @@ var PdfJs = {
Services.obs.removeObserver(this, TOPIC_PLUGIN_INFO_UPDATED);
this._initialized = false;
}
this.ensureUnregistered();
this._ensureUnregistered();
},
_migrate: function migrate() {
@ -259,7 +255,7 @@ var PdfJs = {
types = stringTypes.split(",");
}
if (!types.includes(PDF_CONTENT_TYPE)) {
if (types.indexOf(PDF_CONTENT_TYPE) === -1) {
types.push(PDF_CONTENT_TYPE);
}
prefs.setCharPref(PREF_DISABLED_PLUGIN_TYPES, types.join(","));
@ -272,7 +268,23 @@ var PdfJs = {
false);
},
_isEnabled: function _isEnabled() {
// nsIObserver
observe: function observe(aSubject, aTopic, aData) {
this.updateRegistration();
if (Services.appinfo.processType ===
Services.appinfo.PROCESS_TYPE_DEFAULT) {
let jsm = "resource://pdf.js/PdfjsChromeUtils.jsm";
let PdfjsChromeUtils = Components.utils.import(jsm, {}).PdfjsChromeUtils;
PdfjsChromeUtils.notifyChildOfSettingsChange();
}
},
/**
* pdf.js is only enabled if it is both selected as the pdf viewer and if the
* global switch enabling it is true.
* @return {boolean} Whether or not it's enabled.
*/
get enabled() {
var disabled = getBoolPref(PREF_DISABLED, true);
if (disabled) {
return false;
@ -287,7 +299,7 @@ var PdfJs = {
if (Services.prefs.prefHasUserValue(PREF_DISABLED_PLUGIN_TYPES)) {
let disabledPluginTypes =
Services.prefs.getCharPref(PREF_DISABLED_PLUGIN_TYPES).split(",");
if (disabledPluginTypes.includes(PDF_CONTENT_TYPE)) {
if (disabledPluginTypes.indexOf(PDF_CONTENT_TYPE) >= 0) {
return true;
}
}
@ -312,52 +324,7 @@ var PdfJs = {
return !enabledPluginFound;
},
checkEnabled: function checkEnabled() {
let isEnabled = this._isEnabled();
// This will be updated any time we observe a dependency changing, since
// updateRegistration internally calls enabled.
Services.prefs.setBoolPref(PREF_ENABLED_CACHE_STATE, isEnabled);
return isEnabled;
},
// nsIObserver
observe: function observe(aSubject, aTopic, aData) {
if (Services.appinfo.processType !==
Services.appinfo.PROCESS_TYPE_DEFAULT) {
throw new Error("Only the parent process should be observing PDF " +
"handler changes.");
}
this.updateRegistration();
let jsm = "resource://pdf.js/PdfjsChromeUtils.jsm";
let PdfjsChromeUtils = Cu.import(jsm, {}).PdfjsChromeUtils;
PdfjsChromeUtils.notifyChildOfSettingsChange(this.enabled);
},
/**
* pdf.js is only enabled if it is both selected as the pdf viewer and if the
* global switch enabling it is true.
* @return {boolean} Whether or not it's enabled.
*/
get enabled() {
/*if (!Services.policies.isAllowed("PDF.js")) {
return false;
}*/
if (!Services.prefs.getBoolPref(PREF_ENABLED_CACHE_INITIALIZED, false)) {
// If we just updated, and the cache hasn't been initialized, then we
// can't assume a default state, and need to synchronously initialize
// PdfJs
if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_POSTUPDATE)) {
this.checkEnabled();
}
Services.prefs.setBoolPref(PREF_ENABLED_CACHE_INITIALIZED, true);
}
return Services.prefs.getBoolPref(PREF_ENABLED_CACHE_STATE, true);
},
ensureRegistered: function ensureRegistered() {
_ensureRegistered: function _ensureRegistered() {
if (this._registered) {
return;
}
@ -368,7 +335,7 @@ var PdfJs = {
this._registered = true;
},
ensureUnregistered: function ensureUnregistered() {
_ensureUnregistered: function _ensureUnregistered() {
if (!this._registered) {
return;
}
@ -377,5 +344,6 @@ var PdfJs = {
delete this._pdfStreamConverterFactory;
this._registered = false;
},
}
};

View file

@ -12,6 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* globals Components, Services */
"use strict";
@ -19,6 +20,11 @@ Components.utils.import("resource://gre/modules/Services.jsm");
var EXPORTED_SYMBOLS = ["NetworkManager"];
function log(aMsg) {
var msg = "PdfJsNetwork.jsm: " + (aMsg.join ? aMsg.join("") : aMsg);
Services.console.logStringMessage(msg);
}
var NetworkManager = (function NetworkManagerClosure() {
const OK_RESPONSE = 200;

View file

@ -12,6 +12,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* globals Components, Services, XPCOMUtils, NetUtil, PrivateBrowsingUtils,
dump, NetworkManager, PdfjsContentUtils */
"use strict";
@ -23,17 +25,15 @@ const Cr = Components.results;
const Cu = Components.utils;
const PDFJS_EVENT_ID = "pdf.js.message";
const PREF_PREFIX = "extensions.uriloader@pdf.js";
const PDF_VIEWER_ORIGIN = "resource://pdf.js";
const PDF_CONTENT_TYPE = "application/pdf";
const PREF_PREFIX = "pdfjs";
const PDF_VIEWER_WEB_PAGE = "resource://pdf.js/web/viewer.html";
const MAX_NUMBER_OF_PREFS = 50;
const MAX_STRING_PREF_LENGTH = 128;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
"resource://gre/modules/NetUtil.jsm");
Cu.import("resource://gre/modules/NetUtil.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "NetworkManager",
"resource://pdf.js/PdfJsNetwork.jsm");
@ -57,7 +57,7 @@ function getContainingBrowser(domWindow) {
}
function getFindBar(domWindow) {
if (Services.appinfo.processType === Services.appinfo.PROCESS_TYPE_CONTENT) {
if (PdfjsContentUtils.isRemote) {
throw new Error("FindBar is not accessible from the content process.");
}
try {
@ -90,10 +90,7 @@ function getIntPref(pref, def) {
function getStringPref(pref, def) {
try {
if (!Services.prefs.getStringPref) {
return Services.prefs.getComplexValue(pref, Ci.nsISupportsString).data;
}
return Services.prefs.getStringPref(pref);
return Services.prefs.getComplexValue(pref, Ci.nsISupportsString).data;
} catch (ex) {
return def;
}
@ -108,21 +105,18 @@ function log(aMsg) {
dump(msg + "\n");
}
function getDOMWindow(aChannel, aPrincipal) {
function getDOMWindow(aChannel) {
var requestor = aChannel.notificationCallbacks ?
aChannel.notificationCallbacks :
aChannel.loadGroup.notificationCallbacks;
var win = requestor.getInterface(Components.interfaces.nsIDOMWindow);
// Ensure the window wasn't navigated to something that is not PDF.js.
if (!win.document.nodePrincipal.equals(aPrincipal)) {
return null;
}
return win;
}
function getLocalizedStrings(path) {
var stringBundle =
Services.strings.createBundle("chrome://pdf.js/locale/" + path);
var stringBundle = Cc["@mozilla.org/intl/stringbundle;1"].
getService(Ci.nsIStringBundleService).
createBundle("chrome://pdf.js/locale/" + path);
var map = {};
var enumerator = stringBundle.getSimpleEnumeration();
@ -152,7 +146,7 @@ function getLocalizedString(strings, id, property) {
// PDF data storage
function PdfDataListener(length) {
this.length = length; // less than 0, if length is unknown
this.buffers = [];
this.buffer = null;
this.loaded = 0;
}
@ -160,7 +154,15 @@ PdfDataListener.prototype = {
append: function PdfDataListener_append(chunk) {
// In most of the cases we will pass data as we receive it, but at the
// beginning of the loading we may accumulate some data.
this.buffers.push(chunk);
if (!this.buffer) {
this.buffer = new Uint8Array(chunk);
} else {
var buffer = this.buffer;
var newBuffer = new Uint8Array(buffer.length + chunk.length);
newBuffer.set(buffer);
newBuffer.set(chunk, buffer.length);
this.buffer = newBuffer;
}
this.loaded += chunk.length;
if (this.length >= 0 && this.length < this.loaded) {
this.length = -1; // reset the length, server is giving incorrect one
@ -168,26 +170,9 @@ PdfDataListener.prototype = {
this.onprogress(this.loaded, this.length >= 0 ? this.length : void 0);
},
readData: function PdfDataListener_readData() {
if (this.buffers.length === 0) {
return null;
}
if (this.buffers.length === 1) {
return this.buffers.pop();
}
// There are multiple buffers that need to be combined into a single
// buffer.
let combinedLength = 0;
for (let buffer of this.buffers) {
combinedLength += buffer.length;
}
let combinedArray = new Uint8Array(combinedLength);
let writeOffset = 0;
while (this.buffers.length) {
let buffer = this.buffers.shift();
combinedArray.set(buffer, writeOffset);
writeOffset += buffer.length;
}
return combinedArray;
var result = this.buffer;
this.buffer = null;
return result;
},
finish: function PdfDataListener_finish() {
this.isDataReady = true;
@ -213,7 +198,7 @@ PdfDataListener.prototype = {
if (this.errorCode) {
value(null, this.errorCode);
}
},
}
};
/**
@ -309,7 +294,7 @@ class ChromeActions {
onDataAvailable(aRequest, aContext, aDataInputStream, aOffset, aCount) {
this.extListener.onDataAvailable(aRequest, aContext, aDataInputStream,
aOffset, aCount);
},
}
};
channel.asyncOpen2(listener);
@ -317,10 +302,7 @@ class ChromeActions {
}
getLocale() {
if (!Services.locale.getRequestedLocale) {
return getStringPref("general.useragent.locale", "en-US");
}
return Services.locale.getRequestedLocale() || "en-US";
return getStringPref("general.useragent.locale", "en-US");
}
getStrings(data) {
@ -344,7 +326,7 @@ class ChromeActions {
}
// ... and we are in a child process
if (Services.appinfo.processType === Services.appinfo.PROCESS_TYPE_CONTENT) {
if (PdfjsContentUtils.isRemote) {
return true;
}
@ -523,7 +505,7 @@ class RangedChromeActions extends ChromeActions {
return;
}
this.headers[aHeader] = aValue;
},
}
};
if (originalRequest.visitRequestHeaders) {
originalRequest.visitRequestHeaders(httpHeaderVisitor);
@ -577,7 +559,7 @@ class RangedChromeActions extends ChromeActions {
loaded,
total,
chunk: this.dataListener.readData(),
}, PDF_VIEWER_ORIGIN);
}, "*");
};
this.dataListener.oncomplete = () => {
this.dataListener = null;
@ -591,7 +573,7 @@ class RangedChromeActions extends ChromeActions {
pdfUrl: this.pdfUrl,
length: this.contentLength,
data,
}, PDF_VIEWER_ORIGIN);
}, "*");
return true;
}
@ -613,14 +595,14 @@ class RangedChromeActions extends ChromeActions {
pdfjsLoadAction: "range",
begin: aArgs.begin,
chunk: aArgs.chunk,
}, PDF_VIEWER_ORIGIN);
}, "*");
},
onProgress: function RangedChromeActions_onProgress(evt) {
domWindow.postMessage({
pdfjsLoadAction: "rangeProgress",
loaded: evt.loaded,
}, PDF_VIEWER_ORIGIN);
},
}, "*");
}
});
}
@ -655,7 +637,7 @@ class StandardChromeActions extends ChromeActions {
pdfjsLoadAction: "progress",
loaded,
total,
}, PDF_VIEWER_ORIGIN);
}, "*");
};
this.dataListener.oncomplete = (data, errorCode) => {
@ -663,7 +645,7 @@ class StandardChromeActions extends ChromeActions {
pdfjsLoadAction: "complete",
data,
errorCode,
}, PDF_VIEWER_ORIGIN);
}, "*");
this.dataListener = null;
this.originalRequest = null;
@ -713,8 +695,7 @@ class RequestListener {
response = function sendResponse(aResponse) {
try {
var listener = doc.createEvent("CustomEvent");
let detail = Cu.cloneInto({ response: aResponse, },
doc.defaultView);
let detail = Cu.cloneInto({ response: aResponse }, doc.defaultView);
listener.initCustomEvent("pdf.js.response", true, false, detail);
return message.dispatchEvent(listener);
} catch (e) {
@ -743,10 +724,10 @@ class FindEventManager {
}
bind() {
var unload = (evt) => {
var unload = function(e) {
this.unbind();
this.contentWindow.removeEventListener(evt.type, unload);
};
this.contentWindow.removeEventListener(e.type, unload);
}.bind(this);
this.contentWindow.addEventListener("unload", unload);
// We cannot directly attach listeners to for the find events
@ -779,11 +760,11 @@ function PdfStreamConverter() {
PdfStreamConverter.prototype = {
// properties required for XPCOM registration:
classID: Components.ID("{6457a96b-2d68-439a-bcfa-44465fbcdbb1}"),
classID: Components.ID("{d0c5195d-e798-49d4-b1d3-9324328b2291}"),
classDescription: "pdf.js Component",
contractID: "@mozilla.org/streamconv;1?from=application/pdf&to=*/*",
classID2: Components.ID("{6457a96b-2d68-439a-bcfa-44465fbcdbb2}"),
classID2: Components.ID("{d0c5195d-e798-49d4-b1d3-9324328b2292}"),
contractID2: "@mozilla.org/streamconv;1?from=application/pdf&to=text/html",
QueryInterface: XPCOMUtils.generateQI([
@ -828,9 +809,8 @@ PdfStreamConverter.prototype = {
var binaryStream = this.binaryStream;
binaryStream.setInputStream(aInputStream);
let chunk = new ArrayBuffer(aCount);
binaryStream.readArrayBuffer(aCount, chunk);
this.dataListener.append(new Uint8Array(chunk));
var chunk = binaryStream.readByteArray(aCount);
this.dataListener.append(chunk);
},
// nsIRequestObserver::onStartRequest
@ -862,22 +842,25 @@ PdfStreamConverter.prototype = {
aRequest.contentLength >= 0 &&
!getBoolPref(PREF_PREFIX + ".disableRange", false) &&
(!isPDFBugEnabled ||
!hash.toLowerCase().includes("disablerange=true"));
hash.toLowerCase().indexOf("disablerange=true") < 0);
streamRequest = contentEncoding === "identity" &&
aRequest.contentLength >= 0 &&
!getBoolPref(PREF_PREFIX + ".disableStream", false) &&
(!isPDFBugEnabled ||
!hash.toLowerCase().includes("disablestream=true"));
hash.toLowerCase().indexOf("disablestream=true") < 0);
}
aRequest.QueryInterface(Ci.nsIChannel);
aRequest.QueryInterface(Ci.nsIWritablePropertyBag);
var contentDispositionFilename;
try {
contentDispositionFilename = aRequest.contentDispositionFilename;
} catch (e) {}
// Change the content type so we don't get stuck in a loop.
aRequest.setProperty("contentType", aRequest.contentType);
aRequest.contentType = "text/html";
if (isHttpRequest) {
// We trust PDF viewer, using no CSP
@ -915,13 +898,9 @@ PdfStreamConverter.prototype = {
offset, count);
},
onStopRequest(request, context, statusCode) {
var domWindow = getDOMWindow(channel, resourcePrincipal);
if (!Components.isSuccessCode(statusCode) || !domWindow) {
// The request may have been aborted and the document may have been
// replaced with something that is not PDF.js, abort attaching.
listener.onStopRequest(aRequest, context, statusCode);
return;
}
// We get the DOM window here instead of before the request since it
// may have changed during a redirect.
var domWindow = getDOMWindow(channel);
var actions;
if (rangeRequest || streamRequest) {
actions = new RangedChromeActions(
@ -932,7 +911,7 @@ PdfStreamConverter.prototype = {
domWindow, contentDispositionFilename, aRequest, dataListener);
}
var requestListener = new RequestListener(actions);
domWindow.document.addEventListener(PDFJS_EVENT_ID, function(event) {
domWindow.addEventListener(PDFJS_EVENT_ID, function(event) {
requestListener.receive(event);
}, false, true);
if (actions.supportsIntegratedFind()) {
@ -945,7 +924,7 @@ PdfStreamConverter.prototype = {
var isObjectEmbed = domWindow.frameElement.tagName !== "IFRAME" ||
domWindow.frameElement.className === "previewPluginContentFrame";
}
},
}
};
// Keep the URL the same so the browser sees it as the same.
@ -956,10 +935,11 @@ PdfStreamConverter.prototype = {
// We can use the resource principal when data is fetched by the chrome,
// e.g. useful for NoScript. Make make sure we reuse the origin attributes
// from the request channel to keep isolation consistent.
var ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
.getService(Ci.nsIScriptSecurityManager);
var uri = NetUtil.newURI(PDF_VIEWER_WEB_PAGE);
var resourcePrincipal =
Services.scriptSecurityManager.createCodebasePrincipal(uri,
aRequest.loadInfo.originAttributes);
ssm.createCodebasePrincipal(uri, aRequest.loadInfo.originAttributes);
aRequest.owner = resourcePrincipal;
channel.asyncOpen2(proxy);
@ -979,5 +959,6 @@ PdfStreamConverter.prototype = {
}
delete this.dataListener;
delete this.binaryStream;
},
}
};

View file

@ -12,6 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* globals Components, Services, XPCOMUtils */
"use strict";
@ -19,9 +20,10 @@ var EXPORTED_SYMBOLS = ["PdfjsChromeUtils"];
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
const Cu = Components.utils;
const PREF_PREFIX = "extensions.uriloader@pdf.js";
const PREF_PREFIX = "pdfjs";
const PDF_CONTENT_TYPE = "application/pdf";
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
@ -32,32 +34,28 @@ XPCOMUtils.defineLazyServiceGetter(Svc, "mime",
"@mozilla.org/mime;1",
"nsIMIMEService");
/* eslint-disable semi */
var DEFAULT_PREFERENCES =
{
"cursorToolOnLoad": 0,
"showPreviousViewOnLoad": true,
"defaultZoomValue": "",
"disablePageLabels": false,
"enablePrintAutoRotate": false,
"sidebarViewOnLoad": 0,
"enableHandToolOnLoad": false,
"enableWebGL": false,
"eventBusDispatchToDOM": false,
"externalLinkTarget": 0,
"historyUpdateUrl": false,
"pdfBugEnabled": false,
"renderer": "canvas",
"renderInteractiveForms": false,
"sidebarViewOnLoad": -1,
"scrollModeOnLoad": -1,
"spreadModeOnLoad": -1,
"textLayerMode": 1,
"useOnlyCssZoom": false,
"viewOnLoad": 0,
"disableRange": false,
"disableStream": false,
"disableAutoFetch": false,
"disableFontFace": false,
"disableRange": false,
"disableStream": false
"disableTextLayer": false,
"useOnlyCssZoom": false,
"externalLinkTarget": 0,
"enhanceTextSelection": false,
"renderer": "canvas",
"renderInteractiveForms": false,
"enablePrintAutoRotate": false,
"disablePageLabels": false
}
/* eslint-enable semi */
var PdfjsChromeUtils = {
// For security purposes when running remote, we restrict preferences
@ -92,18 +90,8 @@ var PdfjsChromeUtils = {
this._mmg.addMessageListener("PDFJS:Parent:removeEventListener", this);
this._mmg.addMessageListener("PDFJS:Parent:updateControlState", this);
// The signature of `Services.obs.addObserver` changed in Firefox 55,
// see https://bugzilla.mozilla.org/show_bug.cgi?id=1355216.
// PLEASE NOTE: While the third parameter is now optional,
// omitting it in prior Firefox versions breaks the addon.
var ffVersion = parseInt(Services.appinfo.platformVersion);
if (ffVersion <= 55) {
// eslint-disable-next-line mozilla/no-useless-parameters
Services.obs.addObserver(this, "quit-application", false);
return;
}
// Observer to handle shutdown.
Services.obs.addObserver(this, "quit-application");
// observer to handle shutdown
Services.obs.addObserver(this, "quit-application", false);
}
},
@ -136,7 +124,7 @@ var PdfjsChromeUtils = {
* instruct the child to refresh its configuration and (possibly)
* the module's registration.
*/
notifyChildOfSettingsChange(enabled) {
notifyChildOfSettingsChange() {
if (Services.appinfo.processType ===
Services.appinfo.PROCESS_TYPE_DEFAULT && this._ppmm) {
// XXX kinda bad, we want to get the parent process mm associated
@ -144,8 +132,7 @@ var PdfjsChromeUtils = {
// manager, which means this is going to fire to every child process
// we have open. Unfortunately I can't find a way to get at that
// process specific mm from js.
this._ppmm.broadcastAsyncMessage("PDFJS:Child:updateSettings",
{ enabled, });
this._ppmm.broadcastAsyncMessage("PDFJS:Child:refreshSettings", {});
}
},
@ -217,7 +204,7 @@ var PdfjsChromeUtils = {
query: aEvent.detail.query,
caseSensitive: aEvent.detail.caseSensitive,
highlightAll: aEvent.detail.highlightAll,
findPrevious: aEvent.detail.findPrevious,
findPrevious: aEvent.detail.findPrevious
};
let browser = aEvent.currentTarget.browser;
@ -274,7 +261,7 @@ var PdfjsChromeUtils = {
_ensurePreferenceAllowed(aPrefName) {
let unPrefixedName = aPrefName.split(PREF_PREFIX + ".");
if (unPrefixedName[0] !== "" ||
!this._allowedPrefNames.includes(unPrefixedName[1])) {
this._allowedPrefNames.indexOf(unPrefixedName[1]) === -1) {
let msg = "\"" + aPrefName + "\" " +
"can't be accessed from content. See PdfjsChromeUtils.";
throw new Error(msg);
@ -303,14 +290,10 @@ var PdfjsChromeUtils = {
_setStringPref(aPrefName, aPrefValue) {
this._ensurePreferenceAllowed(aPrefName);
if (!Services.prefs.setStringPref) {
let str = Cc["@mozilla.org/supports-string;1"]
.createInstance(Ci.nsISupportsString);
str.data = aPrefValue;
Services.prefs.setComplexValue(aPrefName, Ci.nsISupportsString, str);
return;
}
Services.prefs.setStringPref(aPrefName, aPrefValue);
let str = Cc["@mozilla.org/supports-string;1"]
.createInstance(Ci.nsISupportsString);
str.data = aPrefValue;
Services.prefs.setComplexValue(aPrefName, Ci.nsISupportsString, str);
},
/*
@ -349,7 +332,7 @@ var PdfjsChromeUtils = {
callback() {
messageSent = true;
sendMessage(true);
},
}
}];
notificationBox.appendNotification(data.message, "pdfjs-fallback", null,
notificationBox.PRIORITY_INFO_LOW,
@ -367,6 +350,6 @@ var PdfjsChromeUtils = {
}
sendMessage(false);
});
},
}
};

View file

@ -12,6 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* globals Components, Services, XPCOMUtils */
"use strict";
@ -19,6 +20,7 @@ var EXPORTED_SYMBOLS = ["PdfjsContentUtils"];
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
const Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
@ -42,25 +44,14 @@ var PdfjsContentUtils = {
if (!this._mm) {
this._mm = Cc["@mozilla.org/childprocessmessagemanager;1"].
getService(Ci.nsISyncMessageSender);
this._mm.addMessageListener("PDFJS:Child:updateSettings", this);
// The signature of `Services.obs.addObserver` changed in Firefox 55,
// see https://bugzilla.mozilla.org/show_bug.cgi?id=1355216.
// PLEASE NOTE: While the third parameter is now optional,
// omitting it in prior Firefox versions breaks the addon.
var ffVersion = parseInt(Services.appinfo.platformVersion);
if (ffVersion <= 55) {
// eslint-disable-next-line mozilla/no-useless-parameters
Services.obs.addObserver(this, "quit-application", false);
return;
}
Services.obs.addObserver(this, "quit-application");
this._mm.addMessageListener("PDFJS:Child:refreshSettings", this);
Services.obs.addObserver(this, "quit-application", false);
}
},
uninit() {
if (this._mm) {
this._mm.removeMessageListener("PDFJS:Child:updateSettings", this);
this._mm.removeMessageListener("PDFJS:Child:refreshSettings", this);
Services.obs.removeObserver(this, "quit-application");
}
this._mm = null;
@ -74,38 +65,46 @@ var PdfjsContentUtils = {
clearUserPref(aPrefName) {
this._mm.sendSyncMessage("PDFJS:Parent:clearUserPref", {
name: aPrefName,
name: aPrefName
});
},
setIntPref(aPrefName, aPrefValue) {
this._mm.sendSyncMessage("PDFJS:Parent:setIntPref", {
name: aPrefName,
value: aPrefValue,
value: aPrefValue
});
},
setBoolPref(aPrefName, aPrefValue) {
this._mm.sendSyncMessage("PDFJS:Parent:setBoolPref", {
name: aPrefName,
value: aPrefValue,
value: aPrefValue
});
},
setCharPref(aPrefName, aPrefValue) {
this._mm.sendSyncMessage("PDFJS:Parent:setCharPref", {
name: aPrefName,
value: aPrefValue,
value: aPrefValue
});
},
setStringPref(aPrefName, aPrefValue) {
this._mm.sendSyncMessage("PDFJS:Parent:setStringPref", {
name: aPrefName,
value: aPrefValue,
value: aPrefValue
});
},
/*
* Forwards default app query to the parent where we check various
* handler app settings only available in the parent process.
*/
isDefaultHandlerApp() {
return this._mm.sendSyncMessage("PDFJS:Parent:isDefaultHandlerApp")[0];
},
/*
* Request the display of a notification warning in the associated window
* when the renderer isn't sure a pdf displayed correctly.
@ -135,20 +134,16 @@ var PdfjsContentUtils = {
receiveMessage(aMsg) {
switch (aMsg.name) {
case "PDFJS:Child:updateSettings":
case "PDFJS:Child:refreshSettings":
// Only react to this if we are remote.
if (Services.appinfo.processType ===
Services.appinfo.PROCESS_TYPE_CONTENT) {
let jsm = "resource://pdf.js/PdfJs.jsm";
let pdfjs = Components.utils.import(jsm, {}).PdfJs;
if (aMsg.data.enabled) {
pdfjs.ensureRegistered();
} else {
pdfjs.ensureUnregistered();
}
pdfjs.updateRegistration();
}
break;
}
},
}
};

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,34 @@
/* Copyright 2014 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* globals Components, PdfjsContentUtils, PdfJs, Services */
"use strict";
/*
* pdfjschildbootstrap.js loads into the content process to take care of
* initializing our built-in version of pdfjs when running remote.
*/
Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://pdf.js/PdfJs.jsm");
Components.utils.import("resource://pdf.js/PdfjsContentUtils.jsm");
// init content utils shim pdfjs will use to access privileged apis.
PdfjsContentUtils.init();
if (Services.appinfo.processType === Services.appinfo.PROCESS_TYPE_CONTENT) {
// register various pdfjs factories that hook us into content loading.
PdfJs.updateRegistration();
}

View file

@ -12,35 +12,38 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable no-var */
'use strict';
var FontInspector = (function FontInspectorClosure() {
var fonts, createObjectURL;
var fonts;
var active = false;
var fontAttribute = 'data-font-name';
function removeSelection() {
let divs = document.querySelectorAll(`span[${fontAttribute}]`);
for (let div of divs) {
var divs = document.querySelectorAll('div[' + fontAttribute + ']');
for (var i = 0, ii = divs.length; i < ii; ++i) {
var div = divs[i];
div.className = '';
}
}
function resetSelection() {
let divs = document.querySelectorAll(`span[${fontAttribute}]`);
for (let div of divs) {
var divs = document.querySelectorAll('div[' + fontAttribute + ']');
for (var i = 0, ii = divs.length; i < ii; ++i) {
var div = divs[i];
div.className = 'debuggerHideText';
}
}
function selectFont(fontName, show) {
let divs = document.querySelectorAll(`span[${fontAttribute}=${fontName}]`);
for (let div of divs) {
var divs = document.querySelectorAll('div[' + fontAttribute + '=' +
fontName + ']');
for (var i = 0, ii = divs.length; i < ii; ++i) {
var div = divs[i];
div.className = show ? 'debuggerShowText' : 'debuggerHideText';
}
}
function textLayerClick(e) {
if (!e.target.dataset.fontName ||
e.target.tagName.toUpperCase() !== 'SPAN') {
e.target.tagName.toUpperCase() !== 'DIV') {
return;
}
var fontName = e.target.dataset.fontName;
@ -71,8 +74,6 @@ var FontInspector = (function FontInspectorClosure() {
fonts = document.createElement('div');
panel.appendChild(fonts);
createObjectURL = pdfjsLib.createObjectURL;
},
cleanup: function cleanup() {
fonts.textContent = '';
@ -117,7 +118,10 @@ var FontInspector = (function FontInspectorClosure() {
url = /url\(['"]?([^\)"']+)/.exec(url);
download.href = url[1];
} else if (fontObj.data) {
download.href = createObjectURL(fontObj.data, fontObj.mimeType);
url = URL.createObjectURL(new Blob([fontObj.data], {
type: fontObj.mimeType
}));
download.href = url;
}
download.textContent = 'Download';
var logIt = document.createElement('a');
@ -145,12 +149,12 @@ var FontInspector = (function FontInspectorClosure() {
fonts.appendChild(font);
// Somewhat of a hack, should probably add a hook for when the text layer
// is done rendering.
setTimeout(() => {
setTimeout(function() {
if (this.active) {
resetSelection();
}
}, 2000);
},
}.bind(this), 2000);
}
};
})();
@ -239,7 +243,7 @@ var StepperManager = (function StepperManagerClosure() {
saveBreakPoints: function saveBreakPoints(pageIndex, bps) {
breakPoints[pageIndex] = bps;
sessionStorage.setItem('pdfjsBreakPoints', JSON.stringify(breakPoints));
},
}
};
})();
@ -258,7 +262,7 @@ var Stepper = (function StepperClosure() {
if (typeof args === 'string') {
var MAX_STRING_LENGTH = 75;
return args.length <= MAX_STRING_LENGTH ? args :
args.substring(0, MAX_STRING_LENGTH) + '...';
args.substr(0, MAX_STRING_LENGTH) + '...';
}
if (typeof args !== 'object' || args === null) {
return args;
@ -333,7 +337,7 @@ var Stepper = (function StepperClosure() {
line.className = 'line';
line.dataset.idx = i;
chunk.appendChild(line);
var checked = this.breakPoints.includes(i);
var checked = this.breakPoints.indexOf(i) !== -1;
var args = operatorList.argsArray[i] || [];
var breakCell = c('td');
@ -429,7 +433,7 @@ var Stepper = (function StepperClosure() {
row.style.backgroundColor = null;
}
}
},
}
};
return Stepper;
})();
@ -455,13 +459,14 @@ var Stats = (function Stats() {
name: 'Stats',
panel: null,
manager: null,
init(pdfjsLib) {
init: function init(pdfjsLib) {
this.panel.setAttribute('style', 'padding: 5px;');
pdfjsLib.PDFJS.enableStats = true;
},
enabled: false,
active: false,
// Stats specific functions.
add(pageNumber, stat) {
add: function(pageNumber, stat) {
if (!stat) {
return;
}
@ -480,7 +485,7 @@ var Stats = (function Stats() {
statsDiv.textContent = stat.toString();
wrapper.appendChild(title);
wrapper.appendChild(statsDiv);
stats.push({ pageNumber, div: wrapper, });
stats.push({ pageNumber: pageNumber, div: wrapper });
stats.sort(function(a, b) {
return a.pageNumber - b.pageNumber;
});
@ -489,15 +494,15 @@ var Stats = (function Stats() {
this.panel.appendChild(stats[i].div);
}
},
cleanup() {
cleanup: function () {
stats = [];
clear(this.panel);
},
}
};
})();
// Manages all the debugging tools.
window.PDFBug = (function PDFBugClosure() {
var PDFBug = (function PDFBugClosure() {
var panelWidth = 300;
var buttons = [];
var activePanel = null;
@ -508,14 +513,14 @@ window.PDFBug = (function PDFBugClosure() {
StepperManager,
Stats
],
enable(ids) {
enable: function(ids) {
var all = false, tools = this.tools;
if (ids.length === 1 && ids[0] === 'all') {
all = true;
}
for (var i = 0; i < tools.length; ++i) {
var tool = tools[i];
if (all || ids.includes(tool.id)) {
if (all || ids.indexOf(tool.id) !== -1) {
tool.enabled = true;
}
}
@ -530,7 +535,7 @@ window.PDFBug = (function PDFBugClosure() {
});
}
},
init(pdfjsLib, container) {
init: function init(pdfjsLib, container) {
/*
* Basic Layout:
* PDFBug
@ -583,14 +588,14 @@ window.PDFBug = (function PDFBugClosure() {
}
this.selectPanel(0);
},
cleanup() {
cleanup: function cleanup() {
for (var i = 0, ii = this.tools.length; i < ii; i++) {
if (this.tools[i].enabled) {
this.tools[i].cleanup();
}
}
},
selectPanel(index) {
selectPanel: function selectPanel(index) {
if (typeof index !== 'number') {
index = this.tools.indexOf(index);
}
@ -610,6 +615,6 @@ window.PDFBug = (function PDFBugClosure() {
tools[j].panel.setAttribute('hidden', 'true');
}
}
},
}
};
})();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 B

View file

@ -0,0 +1,157 @@
"use strict";
// Small subset of the webL10n API by Fabien Cazenave for pdf.js extension.
(function(window) {
var gLanguage = "";
var gExternalLocalizerServices = null;
var gReadyState = "loading";
// fetch an l10n objects
function getL10nData(key) {
var response = gExternalLocalizerServices.getStrings(key);
var data = JSON.parse(response);
if (!data) {
console.warn("[l10n] #" + key + " missing for [" + gLanguage + "]");
}
return data;
}
// replace {{arguments}} with their values
function substArguments(text, args) {
if (!args) {
return text;
}
return text.replace(/\{\{\s*(\w+)\s*\}\}/g, function(all, name) {
return (name in args ? args[name] : "{{" + name + "}}");
});
}
// translate a string
function translateString(key, args, fallback) {
var i = key.lastIndexOf(".");
var name, property;
if (i >= 0) {
name = key.substring(0, i);
property = key.substring(i + 1);
} else {
name = key;
property = "textContent";
}
var data = getL10nData(name);
var value = (data && data[property]) || fallback;
if (!value) {
return "{{" + key + "}}";
}
return substArguments(value, args);
}
// translate an HTML element
function translateElement(element) {
if (!element || !element.dataset) {
return;
}
// get the related l10n object
var key = element.dataset.l10nId;
var data = getL10nData(key);
if (!data) {
return;
}
// get arguments (if any)
// TODO: more flexible parser?
var args;
if (element.dataset.l10nArgs) {
try {
args = JSON.parse(element.dataset.l10nArgs);
} catch (e) {
console.warn("[l10n] could not parse arguments for #" + key + "");
}
}
// translate element
// TODO: security check?
for (var k in data) {
element[k] = substArguments(data[k], args);
}
}
// translate an HTML subtree
function translateFragment(element) {
element = element || document.querySelector("html");
// check all translatable children (= w/ a `data-l10n-id' attribute)
var children = element.querySelectorAll("*[data-l10n-id]");
var elementCount = children.length;
for (var i = 0; i < elementCount; i++) {
translateElement(children[i]);
}
// translate element itself if necessary
if (element.dataset.l10nId) {
translateElement(element);
}
}
function translateDocument() {
gLanguage = gExternalLocalizerServices.getLocale();
translateFragment();
gReadyState = "complete";
// fire a 'localized' DOM event
var evtObject = document.createEvent("Event");
evtObject.initEvent("localized", false, false);
evtObject.language = gLanguage;
window.dispatchEvent(evtObject);
}
window.addEventListener("DOMContentLoaded", function() {
if (gExternalLocalizerServices) {
translateDocument();
}
// ... else see setExternalLocalizerServices below
});
// Public API
document.mozL10n = {
// get a localized string
get: translateString,
// get the document language
getLanguage() {
return gLanguage;
},
// get the direction (ltr|rtl) of the current language
getDirection() {
// http://www.w3.org/International/questions/qa-scripts
// Arabic, Hebrew, Farsi, Pashto, Urdu
var rtlList = ["ar", "he", "fa", "ps", "ur"];
// use the short language code for "full" codes like 'ar-sa' (issue 5440)
var shortCode = gLanguage.split("-")[0];
return (rtlList.indexOf(shortCode) >= 0) ? "rtl" : "ltr";
},
getReadyState() {
return gReadyState;
},
setExternalLocalizerServices(externalLocalizerServices) {
gExternalLocalizerServices = externalLocalizerServices;
// ... in case if we missed DOMContentLoaded above.
if (window.document.readyState === "interactive" ||
window.document.readyState === "complete") {
translateDocument();
}
},
// translate an element or document fragment
translate: translateFragment
};
})(this);

View file

@ -24,11 +24,12 @@
line-height: 1.0;
}
.textLayer > span {
.textLayer > div {
color: transparent;
position: absolute;
white-space: pre;
cursor: text;
-moz-transform-origin: 0% 0%;
transform-origin: 0% 0%;
}
@ -57,6 +58,7 @@
}
.textLayer ::selection { background: rgb(0,0,255); }
.textLayer ::-moz-selection { background: rgb(0,0,255); }
.textLayer .endOfContent {
display: block;
@ -67,7 +69,7 @@
bottom: 0px;
z-index: -1;
cursor: default;
user-select: none;
-moz-user-select: none;
}
.textLayer .endOfContent.active {
@ -79,8 +81,7 @@
position: absolute;
}
.annotationLayer .linkAnnotation > a,
.annotationLayer .buttonWidgetAnnotation.pushButton > a {
.annotationLayer .linkAnnotation > a {
position: absolute;
font-size: 1em;
top: 0;
@ -89,8 +90,7 @@
height: 100%;
}
.annotationLayer .linkAnnotation > a:hover,
.annotationLayer .buttonWidgetAnnotation.pushButton > a:hover {
.annotationLayer .linkAnnotation > a:hover {
opacity: 0.2;
background: #ff0;
box-shadow: 0px 2px 10px #ff0;
@ -111,20 +111,11 @@
box-sizing: border-box;
font-size: 9px;
height: 100%;
margin: 0;
padding: 0 3px;
vertical-align: top;
width: 100%;
}
.annotationLayer .choiceWidgetAnnotation select option {
padding: 0;
}
.annotationLayer .buttonWidgetAnnotation.radioButton input {
border-radius: 50%;
}
.annotationLayer .textWidgetAnnotation textarea {
font: message-box;
font-size: 9px;
@ -156,38 +147,6 @@
border: 1px solid transparent;
}
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,
.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before {
background-color: #000;
content: '';
display: block;
position: absolute;
}
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after {
height: 80%;
left: 45%;
width: 1px;
}
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before {
transform: rotate(45deg);
}
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after {
transform: rotate(-45deg);
}
.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before {
border-radius: 50%;
height: 50%;
left: 30%;
top: 20%;
width: 50%;
}
.annotationLayer .textWidgetAnnotation input.comb {
font-family: monospace;
padding-left: 2px;
@ -206,8 +165,8 @@
.annotationLayer .buttonWidgetAnnotation.checkBox input,
.annotationLayer .buttonWidgetAnnotation.radioButton input {
-moz-appearance: none;
appearance: none;
padding: 0;
}
.annotationLayer .popupWrapper {
@ -220,48 +179,28 @@
z-index: 200;
max-width: 20em;
background-color: #FFFF99;
box-shadow: 0px 2px 5px #888;
box-shadow: 0px 2px 5px #333;
border-radius: 2px;
padding: 6px;
padding: 0.6em;
margin-left: 5px;
cursor: pointer;
font: message-box;
font-size: 9px;
word-wrap: break-word;
}
.annotationLayer .popup > * {
font-size: 9px;
}
.annotationLayer .popup h1 {
display: inline-block;
}
.annotationLayer .popup span {
display: inline-block;
margin-left: 5px;
font-size: 1em;
border-bottom: 1px solid #000000;
padding-bottom: 0.2em;
}
.annotationLayer .popup p {
border-top: 1px solid #333;
margin-top: 2px;
padding-top: 2px;
padding-top: 0.2em;
}
.annotationLayer .highlightAnnotation,
.annotationLayer .underlineAnnotation,
.annotationLayer .squigglyAnnotation,
.annotationLayer .strikeoutAnnotation,
.annotationLayer .freeTextAnnotation,
.annotationLayer .lineAnnotation svg line,
.annotationLayer .squareAnnotation svg rect,
.annotationLayer .circleAnnotation svg ellipse,
.annotationLayer .polylineAnnotation svg polyline,
.annotationLayer .polygonAnnotation svg polygon,
.annotationLayer .caretAnnotation,
.annotationLayer .inkAnnotation svg polyline,
.annotationLayer .stampAnnotation,
.annotationLayer .fileAttachmentAnnotation {
cursor: pointer;
}
@ -297,55 +236,11 @@
border: none;
}
.pdfViewer.scrollHorizontal, .pdfViewer.scrollWrapped, .spread {
margin-left: 3.5px;
margin-right: 3.5px;
text-align: center;
}
.pdfViewer.scrollHorizontal, .spread {
white-space: nowrap;
}
.pdfViewer.removePageBorders,
.pdfViewer.scrollHorizontal .spread,
.pdfViewer.scrollWrapped .spread {
margin-left: 0;
margin-right: 0;
}
.spread .page,
.pdfViewer.scrollHorizontal .page,
.pdfViewer.scrollWrapped .page,
.pdfViewer.scrollHorizontal .spread,
.pdfViewer.scrollWrapped .spread {
display: inline-block;
vertical-align: middle;
}
.spread .page,
.pdfViewer.scrollHorizontal .page,
.pdfViewer.scrollWrapped .page {
margin-left: -3.5px;
margin-right: -3.5px;
}
.pdfViewer.removePageBorders .spread .page,
.pdfViewer.removePageBorders.scrollHorizontal .page,
.pdfViewer.removePageBorders.scrollWrapped .page {
margin-left: 5px;
margin-right: 5px;
}
.pdfViewer .page canvas {
margin: 0;
display: block;
}
.pdfViewer .page canvas[hidden] {
display: none;
}
.pdfViewer .page .loadingIcon {
position: absolute;
display: block;
@ -356,24 +251,9 @@
background: url('images/loading-icon.gif') center no-repeat;
}
.pdfPresentationMode .pdfViewer {
margin-left: 0;
margin-right: 0;
}
.pdfPresentationMode .pdfViewer .page,
.pdfPresentationMode .pdfViewer .spread {
display: block;
}
.pdfPresentationMode .pdfViewer .page,
.pdfPresentationMode .pdfViewer.removePageBorders .page {
margin-left: auto;
margin-right: auto;
}
.pdfPresentationMode:-ms-fullscreen .pdfViewer .page {
margin-bottom: 100% !important;
.pdfPresentationMode:-moz-full-screen .pdfViewer .page {
margin-bottom: 100%;
border: 0;
}
.pdfPresentationMode:fullscreen .pdfViewer .page {
@ -381,10 +261,6 @@
border: 0;
}
:root {
--sidebar-width: 200px;
}
* {
padding: 0;
margin: 0;
@ -419,13 +295,15 @@ select {
display: none !important;
}
#viewerContainer.pdfPresentationMode:-ms-fullscreen {
top: 0px !important;
overflow: hidden !important;
}
#viewerContainer.pdfPresentationMode:-ms-fullscreen::-ms-backdrop {
#viewerContainer.pdfPresentationMode:-moz-full-screen {
top: 0px;
border-top: 2px solid transparent;
background-color: #000;
width: 100%;
height: 100%;
overflow: hidden;
cursor: none;
-moz-user-select: none;
}
#viewerContainer.pdfPresentationMode:fullscreen {
@ -436,19 +314,27 @@ select {
height: 100%;
overflow: hidden;
cursor: none;
user-select: none;
-moz-user-select: none;
}
.pdfPresentationMode:-moz-full-screen a:not(.internalLink) {
display: none;
}
.pdfPresentationMode:fullscreen a:not(.internalLink) {
display: none;
}
.pdfPresentationMode:fullscreen .textLayer > span {
.pdfPresentationMode:-moz-full-screen .textLayer > div {
cursor: none;
}
.pdfPresentationMode:fullscreen .textLayer > div {
cursor: none;
}
.pdfPresentationMode.pdfPresentationModeControls > *,
.pdfPresentationMode.pdfPresentationModeControls .textLayer > span {
.pdfPresentationMode.pdfPresentationModeControls .textLayer > div {
cursor: default;
}
@ -460,48 +346,31 @@ select {
#sidebarContainer {
position: absolute;
top: 32px;
top: 0;
bottom: 0;
width: 200px; /* Here, and elsewhere below, keep the constant value for compatibility
with older browsers that lack support for CSS variables. */
width: var(--sidebar-width);
width: 200px;
visibility: hidden;
z-index: 100;
border-top: 1px solid #333;
transition-duration: 200ms;
transition-timing-function: ease;
}
html[dir='ltr'] #sidebarContainer {
transition-property: left;
left: -200px;
left: calc(-1 * var(--sidebar-width));
}
html[dir='rtl'] #sidebarContainer {
transition-property: right;
right: -200px;
right: calc(-1 * var(--sidebar-width));
}
.loadingInProgress #sidebarContainer {
top: 36px;
}
#outerContainer.sidebarResizing #sidebarContainer {
/* Improve responsiveness and avoid visual glitches when the sidebar is resized. */
transition-duration: 0s;
/* Prevent e.g. the thumbnails being selected when the sidebar is resized. */
user-select: none;
}
#outerContainer.sidebarMoving #sidebarContainer,
#outerContainer.sidebarOpen #sidebarContainer {
#outerContainer.sidebarMoving > #sidebarContainer,
#outerContainer.sidebarOpen > #sidebarContainer {
visibility: visible;
}
html[dir='ltr'] #outerContainer.sidebarOpen #sidebarContainer {
html[dir='ltr'] #outerContainer.sidebarOpen > #sidebarContainer {
left: 0px;
}
html[dir='rtl'] #outerContainer.sidebarOpen #sidebarContainer {
html[dir='rtl'] #outerContainer.sidebarOpen > #sidebarContainer {
right: 0px;
}
@ -512,15 +381,24 @@ html[dir='rtl'] #outerContainer.sidebarOpen #sidebarContainer {
bottom: 0;
left: 0;
min-width: 320px;
transition-duration: 200ms;
transition-timing-function: ease;
}
html[dir='ltr'] #outerContainer.sidebarOpen > #mainContainer {
transition-property: left;
left: 200px;
}
html[dir='rtl'] #outerContainer.sidebarOpen > #mainContainer {
transition-property: right;
right: 200px;
}
#sidebarContent {
top: 32px;
bottom: 0;
overflow: auto;
-webkit-overflow-scrolling: touch;
position: absolute;
width: 100%;
width: 200px;
background-color: hsla(0,0%,0%,.1);
}
html[dir='ltr'] #sidebarContent {
@ -534,7 +412,6 @@ html[dir='rtl'] #sidebarContent {
#viewerContainer {
overflow: auto;
-webkit-overflow-scrolling: touch;
position: absolute;
top: 32px;
right: 0;
@ -542,10 +419,6 @@ html[dir='rtl'] #sidebarContent {
left: 0;
outline: none;
}
#viewerContainer:not(.pdfPresentationMode) {
transition-duration: 200ms;
transition-timing-function: ease;
}
html[dir='ltr'] #viewerContainer {
box-shadow: inset 1px 0 0 hsla(0,0%,100%,.05);
}
@ -553,22 +426,6 @@ html[dir='rtl'] #viewerContainer {
box-shadow: inset -1px 0 0 hsla(0,0%,100%,.05);
}
#outerContainer.sidebarResizing #viewerContainer {
/* Improve responsiveness and avoid visual glitches when the sidebar is resized. */
transition-duration: 0s;
}
html[dir='ltr'] #outerContainer.sidebarOpen #viewerContainer:not(.pdfPresentationMode) {
transition-property: left;
left: 200px;
left: var(--sidebar-width);
}
html[dir='rtl'] #outerContainer.sidebarOpen #viewerContainer:not(.pdfPresentationMode) {
transition-property: right;
right: 200px;
right: var(--sidebar-width);
}
.toolbar {
position: relative;
left: 0;
@ -582,7 +439,7 @@ html[dir='rtl'] #outerContainer.sidebarOpen #viewerContainer:not(.pdfPresentatio
}
#toolbarSidebar {
width: 100%;
width: 200px;
height: 32px;
background-color: #424242; /* fallback */
background-image: url(images/texture.png),
@ -601,21 +458,6 @@ html[dir='rtl'] #toolbarSidebar {
0 0 1px hsla(0,0%,0%,.1);
}
#sidebarResizer {
position: absolute;
top: 0;
bottom: 0;
width: 6px;
z-index: 200;
cursor: ew-resize;
}
html[dir='ltr'] #sidebarResizer {
right: -6px;
}
html[dir='rtl'] #sidebarResizer {
left: -6px;
}
#toolbarContainer, .findbar, .secondaryToolbar {
position: relative;
height: 32px;
@ -624,13 +466,15 @@ html[dir='rtl'] #sidebarResizer {
linear-gradient(hsla(0,0%,32%,.99), hsla(0,0%,27%,.95));
}
html[dir='ltr'] #toolbarContainer, .findbar, .secondaryToolbar {
box-shadow: inset 0 1px 1px hsla(0,0%,0%,.15),
box-shadow: inset 1px 0 0 hsla(0,0%,100%,.08),
inset 0 1px 1px hsla(0,0%,0%,.15),
inset 0 -1px 0 hsla(0,0%,100%,.05),
0 1px 0 hsla(0,0%,0%,.15),
0 1px 1px hsla(0,0%,0%,.1);
}
html[dir='rtl'] #toolbarContainer, .findbar, .secondaryToolbar {
box-shadow: inset 0 1px 1px hsla(0,0%,0%,.15),
box-shadow: inset -1px 0 0 hsla(0,0%,100%,.08),
inset 0 1px 1px hsla(0,0%,0%,.15),
inset 0 -1px 0 hsla(0,0%,100%,.05),
0 1px 0 hsla(0,0%,0%,.15),
0 1px 1px hsla(0,0%,0%,.1);
@ -688,7 +532,8 @@ html[dir='rtl'] #toolbarContainer, .findbar, .secondaryToolbar {
top: 32px;
position: absolute;
z-index: 10000;
height: auto;
height: 32px;
min-width: 16px;
padding: 0px 6px 0px 6px;
margin: 4px 2px 4px 2px;
@ -699,38 +544,18 @@ html[dir='rtl'] #toolbarContainer, .findbar, .secondaryToolbar {
cursor: default;
}
.findbar {
min-width: 300px;
}
.findbar > div {
height: 32px;
}
.findbar.wrapContainers > div {
clear: both;
}
.findbar.wrapContainers > div#findbarMessageContainer {
height: auto;
}
html[dir='ltr'] .findbar {
left: 68px;
}
html[dir='rtl'] .findbar {
right: 68px;
}
.findbar label {
user-select: none;
-moz-user-select: none;
}
#findInput {
width: 200px;
}
#findInput::-webkit-input-placeholder {
color: hsl(0, 0%, 75%);
}
#findInput::placeholder {
font-style: italic;
}
#findInput[data-status="pending"] {
background-image: url(images/loading-small.png);
background-repeat: no-repeat;
@ -756,15 +581,9 @@ html[dir='rtl'] .secondaryToolbar {
max-width: 200px;
max-height: 400px;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
margin-bottom: -4px;
}
#secondaryToolbarButtonContainer.hiddenScrollModeButtons > .scrollModeButtons,
#secondaryToolbarButtonContainer.hiddenSpreadModeButtons > .spreadModeButtons {
display: none !important;
}
.doorHanger,
.doorHangerRight {
border: 1px solid hsla(0,0%,0%,.5);
@ -827,9 +646,6 @@ html[dir='ltr'] .doorHangerRight:before {
font-style: italic;
color: #A6B7D0;
}
#findMsg:empty {
display: none;
}
#findInput.notFound {
background-color: rgb(255, 102, 102);
@ -852,14 +668,14 @@ html[dir='rtl'] #toolbarViewerLeft {
html[dir='ltr'] #toolbarViewerLeft > *,
html[dir='ltr'] #toolbarViewerMiddle > *,
html[dir='ltr'] #toolbarViewerRight > *,
html[dir='ltr'] .findbar * {
html[dir='ltr'] .findbar > * {
position: relative;
float: left;
}
html[dir='rtl'] #toolbarViewerLeft > *,
html[dir='rtl'] #toolbarViewerMiddle > *,
html[dir='rtl'] #toolbarViewerRight > *,
html[dir='rtl'] .findbar * {
html[dir='rtl'] .findbar > * {
position: relative;
float: right;
}
@ -903,6 +719,10 @@ html[dir='rtl'] .splitToolbarButton > .toolbarButton {
opacity: .5;
}
.toolbarButton.group {
margin-right: 0;
}
.splitToolbarButton.toggled .toolbarButton {
margin: 0;
}
@ -994,7 +814,7 @@ html[dir='rtl'] .splitToolbarButtonSeparator {
color: hsla(0,0%,100%,.8);
font-size: 12px;
line-height: 14px;
user-select: none;
-moz-user-select: none;
/* Opera does not support user-select, use <... unselectable="on"> instead */
cursor: default;
transition-property: background-color, border-color, box-shadow;
@ -1330,38 +1150,10 @@ html[dir="rtl"] .secondaryToolbarButton > span {
content: url(images/secondaryToolbarButton-rotateCw.png);
}
.secondaryToolbarButton.selectTool::before {
content: url(images/secondaryToolbarButton-selectTool.png);
}
.secondaryToolbarButton.handTool::before {
content: url(images/secondaryToolbarButton-handTool.png);
}
.secondaryToolbarButton.scrollVertical::before {
content: url(images/secondaryToolbarButton-scrollVertical.png);
}
.secondaryToolbarButton.scrollHorizontal::before {
content: url(images/secondaryToolbarButton-scrollHorizontal.png);
}
.secondaryToolbarButton.scrollWrapped::before {
content: url(images/secondaryToolbarButton-scrollWrapped.png);
}
.secondaryToolbarButton.spreadNone::before {
content: url(images/secondaryToolbarButton-spreadNone.png);
}
.secondaryToolbarButton.spreadOdd::before {
content: url(images/secondaryToolbarButton-spreadOdd.png);
}
.secondaryToolbarButton.spreadEven::before {
content: url(images/secondaryToolbarButton-spreadEven.png);
}
.secondaryToolbarButton.documentProperties::before {
content: url(images/secondaryToolbarButton-documentProperties.png);
}
@ -1429,12 +1221,6 @@ html[dir='rtl'] .verticalToolbarSeparator {
background-position: 1px;
}
.toolbarField.pageNumber::-webkit-inner-spin-button,
.toolbarField.pageNumber::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
.toolbarField:hover {
background-color: hsla(0,0%,100%,.11);
border-color: hsla(0,0%,0%,.4) hsla(0,0%,0%,.43) hsla(0,0%,0%,.45);
@ -1455,33 +1241,22 @@ html[dir='rtl'] .verticalToolbarSeparator {
font-size: 12px;
line-height: 14px;
text-align: left;
user-select: none;
-moz-user-select: none;
cursor: default;
}
#thumbnailView {
position: absolute;
width: calc(100% - 60px);
width: 120px;
top: 0;
bottom: 0;
padding: 10px 30px 0;
padding: 10px 40px 0;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
#thumbnailView > a:active,
#thumbnailView > a:focus {
outline: 0;
}
.thumbnail {
margin: 0 10px 5px 10px;
}
html[dir='ltr'] .thumbnail {
float: left;
}
html[dir='rtl'] .thumbnail {
float: right;
margin-bottom: 5px;
}
#thumbnailView > a:last-of-type > .thumbnail {
@ -1494,7 +1269,7 @@ html[dir='rtl'] .thumbnail {
.thumbnail:not([data-loaded]) {
border: 1px dashed rgba(255, 255, 255, 0.5);
margin: -1px 9px 4px 9px;
margin: -1px -1px 4px -1px;
}
.thumbnailImage {
@ -1545,12 +1320,11 @@ a:focus > .thumbnail > .thumbnailSelectionRing,
#outlineView,
#attachmentsView {
position: absolute;
width: calc(100% - 8px);
width: 192px;
top: 0;
bottom: 0;
overflow: auto;
-webkit-overflow-scrolling: touch;
user-select: none;
-moz-user-select: none;
}
#outlineView {
@ -1583,7 +1357,7 @@ html[dir='rtl'] .outlineItem > .outlineItems {
color: hsla(0,0%,100%,.8);
font-size: 13px;
line-height: 15px;
user-select: none;
-moz-user-select: none;
white-space: normal;
}
@ -1679,6 +1453,7 @@ html[dir='rtl'] .outlineItemToggler::before {
so we can override the opaque grey background when the window is inactive;
see https://bugzilla.mozilla.org/show_bug.cgi?id=706209 */
::selection { background: rgba(0,0,255,0.3); }
::-moz-selection { background: rgba(0,0,255,0.3); }
#errorWrapper {
background: none repeat scroll 0 0 #FF5555;
@ -1726,7 +1501,6 @@ html[dir='rtl'] .outlineItemToggler::before {
}
#overlayContainer > * {
overflow: auto;
-webkit-overflow-scrolling: touch;
}
#overlayContainer > .container {
@ -1850,7 +1624,6 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * {
bottom: 0;
left: 0;
overflow: auto;
-webkit-overflow-scrolling: touch;
position: absolute;
right: 0;
top: 27px;
@ -1889,19 +1662,19 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * {
mix-blend-mode: screen;
}
#viewer.textLayer-visible .textLayer > span {
#viewer.textLayer-visible .textLayer > div {
background-color: rgba(255, 255, 0, 0.1);
color: black;
border: solid 1px rgba(255, 0, 0, 0.5);
box-sizing: border-box;
}
#viewer.textLayer-hover .textLayer > span:hover {
#viewer.textLayer-hover .textLayer > div:hover {
background-color: white;
color: black;
}
#viewer.textLayer-shadow .textLayer > span {
#viewer.textLayer-shadow .textLayer > div {
background-color: rgba(255,255,255, .6);
color: black;
}
@ -1937,7 +1710,7 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * {
display: none;
}
@media screen and (min-resolution: 1.1dppx) {
@media screen and (min-resolution: 2dppx) {
/* Rules for Retina screens */
.toolbarButton::before {
transform: scale(0.5);
@ -2082,38 +1855,10 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * {
content: url(images/secondaryToolbarButton-rotateCw@2x.png);
}
.secondaryToolbarButton.selectTool::before {
content: url(images/secondaryToolbarButton-selectTool@2x.png);
}
.secondaryToolbarButton.handTool::before {
content: url(images/secondaryToolbarButton-handTool@2x.png);
}
.secondaryToolbarButton.scrollVertical::before {
content: url(images/secondaryToolbarButton-scrollVertical@2x.png);
}
.secondaryToolbarButton.scrollHorizontal::before {
content: url(images/secondaryToolbarButton-scrollHorizontal@2x.png);
}
.secondaryToolbarButton.scrollWrapped::before {
content: url(images/secondaryToolbarButton-scrollWrapped@2x.png);
}
.secondaryToolbarButton.spreadNone::before {
content: url(images/secondaryToolbarButton-spreadNone@2x.png);
}
.secondaryToolbarButton.spreadOdd::before {
content: url(images/secondaryToolbarButton-spreadOdd@2x.png);
}
.secondaryToolbarButton.spreadEven::before {
content: url(images/secondaryToolbarButton-spreadEven@2x.png);
}
.secondaryToolbarButton.documentProperties::before {
content: url(images/secondaryToolbarButton-documentProperties@2x.png);
}
@ -2207,8 +1952,9 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * {
display: none;
}
@media all and (max-width: 900px) {
#toolbarViewerMiddle {
@media all and (max-width: 1040px) {
#outerContainer.sidebarMoving #toolbarViewerMiddle,
#outerContainer.sidebarOpen #toolbarViewerMiddle {
display: table;
margin: auto;
left: auto;
@ -2217,16 +1963,53 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * {
}
}
@media all and (max-width: 980px) {
.sidebarMoving .hiddenLargeView,
.sidebarOpen .hiddenLargeView {
display: none;
}
.sidebarMoving .visibleLargeView,
.sidebarOpen .visibleLargeView {
display: inherit;
}
}
@media all and (max-width: 900px) {
#toolbarViewerMiddle {
display: table;
margin: auto;
left: auto;
position: inherit;
transform: none;
}
.sidebarMoving .hiddenMediumView,
.sidebarOpen .hiddenMediumView {
display: none;
}
.sidebarMoving .visibleMediumView,
.sidebarOpen .visibleMediumView {
display: inherit;
}
}
@media all and (max-width: 840px) {
#sidebarContainer {
top: 32px;
z-index: 100;
}
.loadingInProgress #sidebarContainer {
top: 37px;
}
#sidebarContent {
top: 32px;
background-color: hsla(0,0%,0%,.7);
}
html[dir='ltr'] #outerContainer.sidebarOpen #viewerContainer {
left: 0px !important;
html[dir='ltr'] #outerContainer.sidebarOpen > #mainContainer {
left: 0px;
}
html[dir='rtl'] #outerContainer.sidebarOpen #viewerContainer {
right: 0px !important;
html[dir='rtl'] #outerContainer.sidebarOpen > #mainContainer {
right: 0px;
}
#outerContainer .hiddenLargeView,
@ -2258,7 +2041,7 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * {
}
@media all and (max-width: 640px) {
.hiddenSmallView, .hiddenSmallView * {
.hiddenSmallView {
display: none;
}
.visibleSmallView {
@ -2267,12 +2050,6 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * {
.toolbarButtonSpacer {
width: 0;
}
html[dir='ltr'] .findbar {
left: 38px;
}
html[dir='rtl'] .findbar {
right: 38px;
}
}
@media all and (max-width: 535px) {

View file

@ -20,7 +20,7 @@ Adobe CMap resources are covered by their own copyright but the same license:
See https://github.com/adobe-type-tools/cmap-resources
-->
<html dir="ltr" mozdisallowselectionprint>
<html dir="ltr" mozdisallowselectionprint moznomarginboxes>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
@ -28,6 +28,7 @@ See https://github.com/adobe-type-tools/cmap-resources
<!-- This snippet is used in the Firefox extension (included from viewer.html) -->
<base href="resource://pdf.js/web/">
<script src="l10n.js"></script>
<script src="../build/pdf.js"></script>
@ -35,6 +36,8 @@ See https://github.com/adobe-type-tools/cmap-resources
<script src="viewer.js"></script>
</head>
@ -45,13 +48,13 @@ See https://github.com/adobe-type-tools/cmap-resources
<div id="sidebarContainer">
<div id="toolbarSidebar">
<div class="splitToolbarButton toggled">
<button id="viewThumbnail" class="toolbarButton toggled" title="Show Thumbnails" tabindex="2" data-l10n-id="thumbs">
<button id="viewThumbnail" class="toolbarButton group toggled" title="Show Thumbnails" tabindex="2" data-l10n-id="thumbs">
<span data-l10n-id="thumbs_label">Thumbnails</span>
</button>
<button id="viewOutline" class="toolbarButton" title="Show Document Outline (double-click to expand/collapse all items)" tabindex="3" data-l10n-id="document_outline">
<button id="viewOutline" class="toolbarButton group" title="Show Document Outline (double-click to expand/collapse all items)" tabindex="3" data-l10n-id="document_outline">
<span data-l10n-id="document_outline_label">Document Outline</span>
</button>
<button id="viewAttachments" class="toolbarButton" title="Show Attachments" tabindex="4" data-l10n-id="attachments">
<button id="viewAttachments" class="toolbarButton group" title="Show Attachments" tabindex="4" data-l10n-id="attachments">
<span data-l10n-id="attachments_label">Attachments</span>
</button>
</div>
@ -64,39 +67,27 @@ See https://github.com/adobe-type-tools/cmap-resources
<div id="attachmentsView" class="hidden">
</div>
</div>
<div id="sidebarResizer" class="hidden"></div>
</div> <!-- sidebarContainer -->
<div id="mainContainer">
<div class="findbar hidden doorHanger" id="findbar">
<div id="findbarInputContainer">
<input id="findInput" class="toolbarField" title="Find" placeholder="Find in document…" tabindex="91" data-l10n-id="find_input">
<div class="splitToolbarButton">
<button id="findPrevious" class="toolbarButton findPrevious" title="Find the previous occurrence of the phrase" tabindex="92" data-l10n-id="find_previous">
<span data-l10n-id="find_previous_label">Previous</span>
</button>
<div class="splitToolbarButtonSeparator"></div>
<button id="findNext" class="toolbarButton findNext" title="Find the next occurrence of the phrase" tabindex="93" data-l10n-id="find_next">
<span data-l10n-id="find_next_label">Next</span>
</button>
</div>
</div>
<div id="findbarOptionsOneContainer">
<input type="checkbox" id="findHighlightAll" class="toolbarField" tabindex="94">
<label for="findHighlightAll" class="toolbarLabel" data-l10n-id="find_highlight">Highlight all</label>
<input type="checkbox" id="findMatchCase" class="toolbarField" tabindex="95">
<label for="findMatchCase" class="toolbarLabel" data-l10n-id="find_match_case_label">Match case</label>
</div>
<div id="findbarOptionsTwoContainer">
<input type="checkbox" id="findEntireWord" class="toolbarField" tabindex="96">
<label for="findEntireWord" class="toolbarLabel" data-l10n-id="find_entire_word_label">Whole words</label>
<span id="findResultsCount" class="toolbarLabel hidden"></span>
</div>
<div id="findbarMessageContainer">
<span id="findMsg" class="toolbarLabel"></span>
<div class="findbar hidden doorHanger hiddenSmallView" id="findbar">
<label for="findInput" class="toolbarLabel" data-l10n-id="find_label">Find:</label>
<input id="findInput" class="toolbarField" tabindex="91">
<div class="splitToolbarButton">
<button class="toolbarButton findPrevious" title="" id="findPrevious" tabindex="92" data-l10n-id="find_previous">
<span data-l10n-id="find_previous_label">Previous</span>
</button>
<div class="splitToolbarButtonSeparator"></div>
<button class="toolbarButton findNext" title="" id="findNext" tabindex="93" data-l10n-id="find_next">
<span data-l10n-id="find_next_label">Next</span>
</button>
</div>
<input type="checkbox" id="findHighlightAll" class="toolbarField" tabindex="94">
<label for="findHighlightAll" class="toolbarLabel" data-l10n-id="find_highlight">Highlight all</label>
<input type="checkbox" id="findMatchCase" class="toolbarField" tabindex="95">
<label for="findMatchCase" class="toolbarLabel" data-l10n-id="find_match_case_label">Match case</label>
<span id="findResultsCount" class="toolbarLabel hidden"></span>
<span id="findMsg" class="toolbarLabel"></span>
</div> <!-- findbar -->
<div id="secondaryToolbar" class="secondaryToolbar hidden doorHangerRight">
@ -141,40 +132,13 @@ See https://github.com/adobe-type-tools/cmap-resources
<div class="horizontalToolbarSeparator"></div>
<button id="cursorSelectTool" class="secondaryToolbarButton selectTool toggled" title="Enable Text Selection Tool" tabindex="60" data-l10n-id="cursor_text_select_tool">
<span data-l10n-id="cursor_text_select_tool_label">Text Selection Tool</span>
</button>
<button id="cursorHandTool" class="secondaryToolbarButton handTool" title="Enable Hand Tool" tabindex="61" data-l10n-id="cursor_hand_tool">
<span data-l10n-id="cursor_hand_tool_label">Hand Tool</span>
<button id="toggleHandTool" class="secondaryToolbarButton handTool" title="Enable hand tool" tabindex="60" data-l10n-id="hand_tool_enable">
<span data-l10n-id="hand_tool_enable_label">Enable hand tool</span>
</button>
<div class="horizontalToolbarSeparator"></div>
<button id="scrollVertical" class="secondaryToolbarButton scrollModeButtons scrollVertical toggled" title="Use Vertical Scrolling" tabindex="62" data-l10n-id="scroll_vertical">
<span data-l10n-id="scroll_vertical_label">Vertical Scrolling</span>
</button>
<button id="scrollHorizontal" class="secondaryToolbarButton scrollModeButtons scrollHorizontal" title="Use Horizontal Scrolling" tabindex="63" data-l10n-id="scroll_horizontal">
<span data-l10n-id="scroll_horizontal_label">Horizontal Scrolling</span>
</button>
<button id="scrollWrapped" class="secondaryToolbarButton scrollModeButtons scrollWrapped" title="Use Wrapped Scrolling" tabindex="64" data-l10n-id="scroll_wrapped">
<span data-l10n-id="scroll_wrapped_label">Wrapped Scrolling</span>
</button>
<div class="horizontalToolbarSeparator scrollModeButtons"></div>
<button id="spreadNone" class="secondaryToolbarButton spreadModeButtons spreadNone toggled" title="Do not join page spreads" tabindex="65" data-l10n-id="spread_none">
<span data-l10n-id="spread_none_label">No Spreads</span>
</button>
<button id="spreadOdd" class="secondaryToolbarButton spreadModeButtons spreadOdd" title="Join page spreads starting with odd-numbered pages" tabindex="66" data-l10n-id="spread_odd">
<span data-l10n-id="spread_odd_label">Odd Spreads</span>
</button>
<button id="spreadEven" class="secondaryToolbarButton spreadModeButtons spreadEven" title="Join page spreads starting with even-numbered pages" tabindex="67" data-l10n-id="spread_even">
<span data-l10n-id="spread_even_label">Even Spreads</span>
</button>
<div class="horizontalToolbarSeparator spreadModeButtons"></div>
<button id="documentProperties" class="secondaryToolbarButton documentProperties" title="Document Properties…" tabindex="68" data-l10n-id="document_properties">
<button id="documentProperties" class="secondaryToolbarButton documentProperties" title="Document Properties…" tabindex="61" data-l10n-id="document_properties">
<span data-l10n-id="document_properties_label">Document Properties…</span>
</button>
</div>
@ -188,10 +152,10 @@ See https://github.com/adobe-type-tools/cmap-resources
<span data-l10n-id="toggle_sidebar_label">Toggle Sidebar</span>
</button>
<div class="toolbarButtonSpacer"></div>
<button id="viewFind" class="toolbarButton" title="Find in Document" tabindex="12" data-l10n-id="findbar">
<span data-l10n-id="findbar_label">Find</span>
<button id="viewFind" class="toolbarButton group hiddenSmallView" title="Find in Document" tabindex="12" data-l10n-id="findbar">
<span data-l10n-id="findbar_label">Find</span>
</button>
<div class="splitToolbarButton hiddenSmallView">
<div class="splitToolbarButton">
<button class="toolbarButton pageUp" title="Previous Page" id="previous" tabindex="13" data-l10n-id="previous">
<span data-l10n-id="previous_label">Previous</span>
</button>
@ -243,8 +207,8 @@ See https://github.com/adobe-type-tools/cmap-resources
<select id="scaleSelect" title="Zoom" tabindex="23" data-l10n-id="zoom">
<option id="pageAutoOption" title="" value="auto" selected="selected" data-l10n-id="page_scale_auto">Automatic Zoom</option>
<option id="pageActualOption" title="" value="page-actual" data-l10n-id="page_scale_actual">Actual Size</option>
<option id="pageFitOption" title="" value="page-fit" data-l10n-id="page_scale_fit">Page Fit</option>
<option id="pageWidthOption" title="" value="page-width" data-l10n-id="page_scale_width">Page Width</option>
<option id="pageFitOption" title="" value="page-fit" data-l10n-id="page_scale_fit">Fit Page</option>
<option id="pageWidthOption" title="" value="page-width" data-l10n-id="page_scale_width">Full Width</option>
<option id="customScaleOption" title="" value="custom" disabled="disabled" hidden="true"></option>
<option title="" value="0.5" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 50 }'>50%</option>
<option title="" value="0.75" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 75 }'>75%</option>
@ -309,7 +273,8 @@ See https://github.com/adobe-type-tools/cmap-resources
<p id="passwordText" data-l10n-id="password_label">Enter the password to open this PDF file:</p>
</div>
<div class="row">
<input type="password" id="password" class="toolbarField">
<!-- The type="password" attribute is set via script, to prevent warnings in Firefox for all http:// documents. -->
<input id="password" class="toolbarField">
</div>
<div class="buttonRow">
<button id="passwordCancel" class="overlayButton"><span data-l10n-id="password_cancel">Cancel</span></button>
@ -357,13 +322,6 @@ See https://github.com/adobe-type-tools/cmap-resources
<div class="row">
<span data-l10n-id="document_properties_page_count">Page Count:</span> <p id="pageCountField">-</p>
</div>
<div class="row">
<span data-l10n-id="document_properties_page_size">Page Size:</span> <p id="pageSizeField">-</p>
</div>
<div class="separator"></div>
<div class="row">
<span data-l10n-id="document_properties_linearized">Fast Web View:</span> <p id="linearizedField">-</p>
</div>
<div class="buttonRow">
<button id="documentPropertiesClose" class="overlayButton"><span data-l10n-id="document_properties_close">Close</span></button>
</div>

File diff suppressed because it is too large Load diff