From fa568e826d39ec0ed28e8934d7c2b6e32ff6df22 Mon Sep 17 00:00:00 2001 From: Noritaka Kobayashi Date: Mon, 7 Jul 2025 09:59:36 +0900 Subject: [PATCH] Fix typos across the codebase --- extensions/chromium/pdfHandler.js | 2 +- src/core/annotation.js | 2 +- src/core/evaluator.js | 4 ++-- src/core/fonts.js | 2 +- src/core/image.js | 4 ++-- src/core/image_resizer.js | 2 +- src/core/xfa/formcalc_parser.js | 2 +- src/display/canvas.js | 2 +- src/display/editor/annotation_editor_layer.js | 2 +- src/shared/util.js | 2 +- test/driver.js | 2 +- test/integration/stamp_editor_spec.mjs | 2 +- web/event_utils.js | 2 +- web/pdf_find_controller.js | 2 +- 14 files changed, 16 insertions(+), 16 deletions(-) diff --git a/extensions/chromium/pdfHandler.js b/extensions/chromium/pdfHandler.js index e0f3818c6..a6ef32d8e 100644 --- a/extensions/chromium/pdfHandler.js +++ b/extensions/chromium/pdfHandler.js @@ -69,7 +69,7 @@ async function registerPdfRedirectRule() { }, }; - // Rules in order of prority (highest priority rule first). + // Rules in order of priority (highest priority rule first). // The required "id" fields will be auto-generated later. const addRules = [ { diff --git a/src/core/annotation.js b/src/core/annotation.js index f5fba7225..2f135d331 100644 --- a/src/core/annotation.js +++ b/src/core/annotation.js @@ -2391,7 +2391,7 @@ class WidgetAnnotation extends Annotation { if (encodingError && intent & RenderingIntentFlag.SAVE) { // We don't have a way to render the field, so we just rely on the - // /NeedAppearances trick to let the different sofware correctly render + // /NeedAppearances trick to let the different software correctly render // this pdf. return { needAppearances: true }; } diff --git a/src/core/evaluator.js b/src/core/evaluator.js index 069c2d38b..25b32505b 100644 --- a/src/core/evaluator.js +++ b/src/core/evaluator.js @@ -2745,7 +2745,7 @@ class PartialEvaluator { // This is not a 0, 90, 180, 270 rotation so: // - remove the scale factor from the matrix to get a rotation matrix // - apply the inverse (which is the transposed) to the positions - // and we can then compare positions of the glyphes to detect + // and we can then compare positions of the glyphs to detect // a whitespace. [posX, posY] = applyInverseRotation(posX, posY, currentTransform); [lastPosX, lastPosY] = applyInverseRotation( @@ -3823,7 +3823,7 @@ class PartialEvaluator { // According to the spec if the font is a simple font we should only map // to unicode if the base encoding is MacRoman, MacExpert, or WinAnsi or // the differences array only contains adobe standard or symbol set names, - // in pratice it seems better to always try to create a toUnicode map + // in practice it seems better to always try to create a toUnicode map // based of the default encoding. if (!properties.composite /* is simple font */) { return new ToUnicodeMap(this._simpleFontToUnicode(properties)); diff --git a/src/core/fonts.js b/src/core/fonts.js index 4a18a7add..bfb9943c6 100644 --- a/src/core/fonts.js +++ b/src/core/fonts.js @@ -2506,7 +2506,7 @@ class Font { } } } - // Adjusting stack not extactly, but just enough to get function id + // Adjusting stack not exactly, but just enough to get function id if (!inFDEF && !inELSE) { let stackDelta = 0; if (op <= 0x8e) { diff --git a/src/core/image.js b/src/core/image.js index 7ccccda63..dbeaaa9c3 100644 --- a/src/core/image.js +++ b/src/core/image.js @@ -237,8 +237,8 @@ class PDFImage { this.jpxDecoderOptions.numComponents = hasColorSpace ? this.numComps : 0; - // If the jpx image has a color space then it musn't be used in order to - // be able to use the color space that comes from the pdf. + // If the jpx image has a color space then it mustn't be used in order + // to be able to use the color space that comes from the pdf. this.jpxDecoderOptions.isIndexedColormap = this.colorSpace.name === "Indexed"; } diff --git a/src/core/image_resizer.js b/src/core/image_resizer.js index b12d1a0ca..adfb476ed 100644 --- a/src/core/image_resizer.js +++ b/src/core/image_resizer.js @@ -83,7 +83,7 @@ class ImageResizer { // TODO: the computation can be a bit long because we potentially allocate // some large canvas, so in the Firefox case this value (and MAX_DIM) can be - // infered from prefs (MAX_AREA = gfx.max-alloc-size / 4, 4 is because of + // inferred from prefs (MAX_AREA = gfx.max-alloc-size / 4, 4 is because of // RGBA). this.#goodSquareLength = this._guessMax( this.#goodSquareLength, diff --git a/src/core/xfa/formcalc_parser.js b/src/core/xfa/formcalc_parser.js index dfbc1cc71..16991c110 100644 --- a/src/core/xfa/formcalc_parser.js +++ b/src/core/xfa/formcalc_parser.js @@ -241,7 +241,7 @@ const OPERAND = false; // operation ('... * - ...' can't be a subtraction). // Each time an operator is met its precedence is compared with the one of the // operator on top of operators stack: -// - if top has precendence on operator then top is applied to the operands +// - if top has precedence on operator then top is applied to the operands // on their stack; // - else just push the operator. // For example: 1 + 2 * 3 diff --git a/src/display/canvas.js b/src/display/canvas.js index df0556ad0..4229a4418 100644 --- a/src/display/canvas.js +++ b/src/display/canvas.js @@ -1027,7 +1027,7 @@ class CanvasGraphics { ); const fillCtx = fillCanvas.context; - // The offset will be the top-left cordinate mask. + // The offset will be the top-left coordinate mask. // If objToCanvas is [a,b,c,d,e,f] then: // - offsetX = min(a, c) + e // - offsetY = min(b, d) + f diff --git a/src/display/editor/annotation_editor_layer.js b/src/display/editor/annotation_editor_layer.js index 796819061..1724bc9ed 100644 --- a/src/display/editor/annotation_editor_layer.js +++ b/src/display/editor/annotation_editor_layer.js @@ -530,7 +530,7 @@ class AnnotationEditorLayer { /** * An editor can have a different parent, for example after having - * being dragged and droped from a page to another. + * being dragged and dropped from a page to another. * @param {AnnotationEditor} editor */ changeParent(editor) { diff --git a/src/shared/util.js b/src/shared/util.js index cc1456a44..2f5e057a8 100644 --- a/src/shared/util.js +++ b/src/shared/util.js @@ -1185,7 +1185,7 @@ function _isValidExplicitDest(validRef, validName, dest) { return true; } -// TOOD: Replace all occurrences of this function with `Math.clamp` once +// TODO: Replace all occurrences of this function with `Math.clamp` once // https://github.com/tc39/proposal-math-clamp/ is generally available. function MathClamp(v, min, max) { return Math.min(Math.max(v, min), max); diff --git a/test/driver.js b/test/driver.js index 67fda3c51..39c030ea8 100644 --- a/test/driver.js +++ b/test/driver.js @@ -377,7 +377,7 @@ class Rasterize { height: height / pageHeight, }); } - // We set the borderWidth to 0.001 to slighly increase the size of the + // We set the borderWidth to 0.001 to slightly increase the size of the // boxes so that they can be merged together. const outliner = new HighlightOutliner(boxes, /* borderWidth = */ 0.001); // We set the borderWidth to 0.0025 in order to have an outline which is diff --git a/test/integration/stamp_editor_spec.mjs b/test/integration/stamp_editor_spec.mjs index a7eac0fb4..24a62496b 100644 --- a/test/integration/stamp_editor_spec.mjs +++ b/test/integration/stamp_editor_spec.mjs @@ -1367,7 +1367,7 @@ describe("Stamp Editor", () => { }); }); - describe("A stamp musn't be on top of the secondary toolbar", () => { + describe("A stamp mustn't be on top of the secondary toolbar", () => { let pages; beforeEach(async () => { diff --git a/web/event_utils.js b/web/event_utils.js index dfca497d5..ee237d377 100644 --- a/web/event_utils.js +++ b/web/event_utils.js @@ -170,7 +170,7 @@ class EventBus { } /** - * NOTE: Only used in the Firefox build-in pdf viewer. + * NOTE: Only used in the Firefox built-in pdf viewer. */ class FirefoxEventBus extends EventBus { #externalServices; diff --git a/web/pdf_find_controller.js b/web/pdf_find_controller.js index 41124f81b..19abf3fca 100644 --- a/web/pdf_find_controller.js +++ b/web/pdf_find_controller.js @@ -722,7 +722,7 @@ class PDFFindController { // kind of whitespaces are replaced by a single " ". if (p1) { - // Escape characters like *+?... to not interfer with regexp syntax. + // Escape characters like *+?... to not interfere with regexp syntax. return `[ ]*\\${p1}[ ]*`; } if (p2) {