From ea2850e9a7ac42ce8d2761160645776452cd2a41 Mon Sep 17 00:00:00 2001 From: Wojciech Maj Date: Sun, 1 Apr 2018 23:20:41 +0200 Subject: [PATCH] Fix typos --- examples/learning/prevnext.html | 2 +- extensions/firefox/tools/l10n.js | 2 +- external/builder/preprocessor2.js | 2 +- external/cmapscompress/README.md | 4 ++-- external/webL10n/l10n.js | 4 ++-- src/core/cmap.js | 10 +++++----- src/core/fonts.js | 6 +++--- src/core/jpx.js | 6 +++--- src/core/obj.js | 2 +- src/core/operator_list.js | 6 +++--- src/core/pattern.js | 2 +- src/display/canvas.js | 2 +- src/display/content_disposition.js | 2 +- src/display/text_layer.js | 4 ++-- web/pdf_presentation_mode.js | 2 +- web/ui_utils.js | 4 ++-- 16 files changed, 30 insertions(+), 30 deletions(-) diff --git a/examples/learning/prevnext.html b/examples/learning/prevnext.html index 618da432c5058..df10988827e99 100644 --- a/examples/learning/prevnext.html +++ b/examples/learning/prevnext.html @@ -30,7 +30,7 @@

'Previous/Next' example

// // In cases when the pdf.worker.js is located at the different folder than the - // pdf.js's one, or the pdf.js is executed via eval(), the workerSrc property + // PDF.js's one, or the PDF.js is executed via eval(), the workerSrc property // shall be specified. // pdfjsLib.GlobalWorkerOptions.workerSrc = diff --git a/extensions/firefox/tools/l10n.js b/extensions/firefox/tools/l10n.js index 74cce0104e43d..f3caa763feb2a 100644 --- a/extensions/firefox/tools/l10n.js +++ b/extensions/firefox/tools/l10n.js @@ -1,6 +1,6 @@ "use strict"; -// Small subset of the webL10n API by Fabien Cazenave for pdf.js extension. +// Small subset of the webL10n API by Fabien Cazenave for PDF.js extension. (function(window) { var gLanguage = ""; var gExternalLocalizerServices = null; diff --git a/external/builder/preprocessor2.js b/external/builder/preprocessor2.js index fcb2949757f56..d53b23726b2da 100644 --- a/external/builder/preprocessor2.js +++ b/external/builder/preprocessor2.js @@ -168,7 +168,7 @@ function postprocessNode(ctx, node) { if (node.callee.type === 'MemberExpression' && isPDFJSPreprocessor(node.callee.object) && node.callee.property.type === 'Identifier') { - // PDFJSDev.xxxx(arg1, arg2, ...) => tranform + // PDFJSDev.xxxx(arg1, arg2, ...) => transform var action = node.callee.property.name; return handlePreprocessorAction(ctx, action, node.arguments, node.loc); diff --git a/external/cmapscompress/README.md b/external/cmapscompress/README.md index 9796eb20b9b52..3d80a18c55b76 100644 --- a/external/cmapscompress/README.md +++ b/external/cmapscompress/README.md @@ -1,6 +1,6 @@ # Quick notes about binary CMap format (bcmap) -The format is designed to package some information from the CMap files located at external/cmap. Please notice for size optimization reasons, the original information blocks can be changed (split or joined) and items in the blocks can be swaped. +The format is designed to package some information from the CMap files located at external/cmap. Please notice for size optimization reasons, the original information blocks can be changed (split or joined) and items in the blocks can be swapped. The data stored in binary format in network byte order (big-endian). @@ -34,7 +34,7 @@ Then records follow. The records starts from the record header encoded as B, whe ## Metadata record The metadata record header bit 4-0 contain id of the metadata: - - 0 – comment, body of the record is encoded comment string (S) + - 0 – comment, body of the record is encoded comment string (S) - 1 – UseCMap, body of the record is usecmap id string (S) ## Data records diff --git a/external/webL10n/l10n.js b/external/webL10n/l10n.js index 19811cd2319ff..77e7117dec051 100644 --- a/external/webL10n/l10n.js +++ b/external/webL10n/l10n.js @@ -145,10 +145,10 @@ document.webL10n = (function(window, document, undefined) { * locale (language) to parse. Must be a lowercase string. * * @param {Function} successCallback - * triggered when the l10n resource has been successully parsed. + * triggered when the l10n resource has been successfully parsed. * * @param {Function} failureCallback - * triggered when the an error has occured. + * triggered when the an error has occurred. * * @return {void} * uses the following global variables: gL10nData, gTextData, gTextProp. diff --git a/src/core/cmap.js b/src/core/cmap.js index d6270ec1b9427..eccaaa6157ef3 100644 --- a/src/core/cmap.js +++ b/src/core/cmap.js @@ -853,7 +853,7 @@ var CMapFactory = (function CMapFactoryClosure() { function parseCMap(cMap, lexer, fetchBuiltInCMap, useCMap) { var previous; - var embededUseCMap; + var embeddedUseCMap; objLoop: while (true) { try { var obj = lexer.getObj(); @@ -872,7 +872,7 @@ var CMapFactory = (function CMapFactoryClosure() { break objLoop; case 'usecmap': if (isName(previous)) { - embededUseCMap = previous.name; + embeddedUseCMap = previous.name; } break; case 'begincodespacerange': @@ -901,10 +901,10 @@ var CMapFactory = (function CMapFactoryClosure() { } } - if (!useCMap && embededUseCMap) { - // Load the usecmap definition from the file only if there wasn't one + if (!useCMap && embeddedUseCMap) { + // Load the useCMap definition from the file only if there wasn't one // specified. - useCMap = embededUseCMap; + useCMap = embeddedUseCMap; } if (useCMap) { return extendCMap(cMap, fetchBuiltInCMap, useCMap); diff --git a/src/core/fonts.js b/src/core/fonts.js index 769a992c66143..f6fdd893d9795 100644 --- a/src/core/fonts.js +++ b/src/core/fonts.js @@ -47,7 +47,7 @@ var SKIP_PRIVATE_USE_RANGE_F000_TO_F01F = false; // except for Type 3 fonts var PDF_GLYPH_SPACE_UNITS = 1000; -// Accented charactars are not displayed properly on Windows, using this flag +// Accented characters are not displayed properly on Windows, using this flag // to control analysis of seac charstrings. var SEAC_ANALYSIS_ENABLED = false; @@ -2107,7 +2107,7 @@ var Font = (function FontClosure() { } } else if (op === 0x2B && !tooComplexToFollowFunctions) { // CALL if (!inFDEF && !inELSE) { - // collecting inforamtion about which functions are used + // collecting information about which functions are used funcId = stack[stack.length - 1]; ttContext.functionsUsed[funcId] = true; if (funcId in ttContext.functionsStackDeltas) { @@ -2132,7 +2132,7 @@ var Font = (function FontClosure() { tooComplexToFollowFunctions = true; } inFDEF = true; - // collecting inforamtion about which functions are defined + // collecting information about which functions are defined lastDeff = i; funcId = stack.pop(); ttContext.functionsDefined[funcId] = { data, i, }; diff --git a/src/core/jpx.js b/src/core/jpx.js index 3379f3301444f..b484f5ba4f92a 100644 --- a/src/core/jpx.js +++ b/src/core/jpx.js @@ -313,7 +313,7 @@ var JpxImage = (function JpxImageClosure() { cod.selectiveArithmeticCodingBypass = !!(blockStyle & 1); cod.resetContextProbabilities = !!(blockStyle & 2); cod.terminationOnEachCodingPass = !!(blockStyle & 4); - cod.verticalyStripe = !!(blockStyle & 8); + cod.verticallyStripe = !!(blockStyle & 8); cod.predictableTermination = !!(blockStyle & 16); cod.segmentationSymbolUsed = !!(blockStyle & 32); cod.reversibleTransformation = data[j++]; @@ -338,8 +338,8 @@ var JpxImage = (function JpxImageClosure() { if (cod.terminationOnEachCodingPass) { unsupported.push('terminationOnEachCodingPass'); } - if (cod.verticalyStripe) { - unsupported.push('verticalyStripe'); + if (cod.verticallyStripe) { + unsupported.push('verticallyStripe'); } if (cod.predictableTermination) { unsupported.push('predictableTermination'); diff --git a/src/core/obj.js b/src/core/obj.js index 872c05cbc76b4..ada0977d13ebe 100644 --- a/src/core/obj.js +++ b/src/core/obj.js @@ -1197,7 +1197,7 @@ var XRef = (function XRefClosure() { if (endobjRegExp.test(tokenStr)) { break; } else { - // Check if an "obj" occurance is actually a new object, + // Check if an "obj" occurrence is actually a new object, // i.e. the current object is missing the 'endobj' operator. let objToken = nestedObjRegExp.exec(tokenStr); diff --git a/src/core/operator_list.js b/src/core/operator_list.js index fad7540365826..7b5767968c88d 100644 --- a/src/core/operator_list.js +++ b/src/core/operator_list.js @@ -444,7 +444,7 @@ var QueueOptimizer = (function QueueOptimizerClosure() { let match = this.match; if (!state && !match && (i + 1 === ii) && !InitialState[fnArray[i]]) { // Micro-optimization for the common case: last item is not - // optimazable, just skipping it. + // optimizable, just skipping it. this.lastProcessed = ii; return; } @@ -452,7 +452,7 @@ var QueueOptimizer = (function QueueOptimizerClosure() { const context = this.context; while (i < ii) { if (match) { - // Already find a block of potetially optimizable items, iterating... + // Already find a block of potentially optimizable items, iterating... const iterate = (0, match.iterateFn)(context, i); if (iterate) { i++; @@ -467,7 +467,7 @@ var QueueOptimizer = (function QueueOptimizerClosure() { break; } } - // Find the potetially optimizable items. + // Find the potentially optimizable items. state = (state || InitialState)[fnArray[i]]; if (!state || Array.isArray(state)) { i++; diff --git a/src/core/pattern.js b/src/core/pattern.js index 236c58fc42f83..83e622c43fa45 100644 --- a/src/core/pattern.js +++ b/src/core/pattern.js @@ -142,7 +142,7 @@ Shadings.RadialAxial = (function RadialAxialClosure() { var colorStops = this.colorStops = []; - // Protect against bad domains so we don't end up in an infinte loop below. + // Protect against bad domains so we don't end up in an infinite loop below. if (t0 >= t1 || step <= 0) { // Acrobat doesn't seem to handle these cases so we'll ignore for // now. diff --git a/src/display/canvas.js b/src/display/canvas.js index 485bad41d8780..a85fa898ec903 100644 --- a/src/display/canvas.js +++ b/src/display/canvas.js @@ -212,7 +212,7 @@ function compileType3Glyph(imgData) { } } - // finding iteresting points: every point is located between mask pixels, + // finding interesting points: every point is located between mask pixels, // so there will be points of the (width + 1)x(height + 1) grid. Every point // will have flags assigned based on neighboring mask pixels: // 4 | 8 diff --git a/src/display/content_disposition.js b/src/display/content_disposition.js index 98c2efa8ddbec..af5261047ebd1 100644 --- a/src/display/content_disposition.js +++ b/src/display/content_disposition.js @@ -163,7 +163,7 @@ function getFilenameFromContentDispositionHeader(contentDisposition) { // Decodes "ext-value" from RFC 5987. let encodingend = extvalue.indexOf('\''); if (encodingend === -1) { - // Some servers send "filename*=" without encoding'language' prefix, + // Some servers send "filename*=" without encoding 'language' prefix, // e.g. in https://github.com/Rob--W/open-in-browser/issues/26 // Let's accept the value like Firefox (57) (Chrome 62 rejects it). return extvalue; diff --git a/src/display/text_layer.js b/src/display/text_layer.js index 3bf75f5843af0..f98930e8ebe0c 100644 --- a/src/display/text_layer.js +++ b/src/display/text_layer.js @@ -48,7 +48,7 @@ var renderTextLayer = (function renderTextLayerClosure() { return !NonWhitespaceRegexp.test(str); } - // Text layers may contain many thousand div's, and using `styleBuf` avoids + // Text layers may contain many thousands of divs, and using `styleBuf` avoids // creating many intermediate strings when building their 'style' properties. var styleBuf = ['left: ', 0, 'px; top: ', 0, 'px; font-size: ', 0, 'px; font-family: ', '', ';']; @@ -340,7 +340,7 @@ var renderTextLayer = (function renderTextLayerClosure() { var xNew; if (affectedBoundary.x2 > boundary.x1) { // In the middle of the previous element, new x shall be at the - // boundary start. Extending if further if the affected bondary + // boundary start. Extending if further if the affected boundary // placed on top of the current one. xNew = affectedBoundary.index > boundary.index ? affectedBoundary.x1New : boundary.x1; diff --git a/web/pdf_presentation_mode.js b/web/pdf_presentation_mode.js index 111815df87018..c1794b5b46c36 100644 --- a/web/pdf_presentation_mode.js +++ b/web/pdf_presentation_mode.js @@ -35,7 +35,7 @@ const SWIPE_ANGLE_THRESHOLD = Math.PI / 6; * @property {HTMLDivElement} viewer - (optional) The viewer element. * @property {PDFViewer} pdfViewer - The document viewer. * @property {EventBus} eventBus - The application event bus. - * @property {Array} contextMenuItems - (optional) The menuitems that are added + * @property {Array} contextMenuItems - (optional) The menu items that are added * to the context menu in Presentation Mode. */ diff --git a/web/ui_utils.js b/web/ui_utils.js index 3b3c1febe218b..2ecdcb0ed7781 100644 --- a/web/ui_utils.js +++ b/web/ui_utils.js @@ -54,7 +54,7 @@ function formatL10nValue(text, args) { } /** - * No-op implemetation of the localization service. + * No-op implementation of the localization service. * @implements {IL10n} */ let NullL10n = { @@ -483,7 +483,7 @@ function waitOnEventOrTimeout({ target, name, delay = 0, }) { if (typeof target !== 'object' || !(name && typeof name === 'string') || !(Number.isInteger(delay) && delay >= 0)) { return Promise.reject( - new Error('waitOnEventOrTimeout - invalid paramaters.')); + new Error('waitOnEventOrTimeout - invalid parameters.')); } let capability = createPromiseCapability();