Fix typos across the codebase

This commit is contained in:
Noritaka Kobayashi 2025-07-07 09:59:36 +09:00
parent 2d0ba7db08
commit fa568e826d
No known key found for this signature in database
14 changed files with 16 additions and 16 deletions

View File

@ -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. // The required "id" fields will be auto-generated later.
const addRules = [ const addRules = [
{ {

View File

@ -2391,7 +2391,7 @@ class WidgetAnnotation extends Annotation {
if (encodingError && intent & RenderingIntentFlag.SAVE) { if (encodingError && intent & RenderingIntentFlag.SAVE) {
// We don't have a way to render the field, so we just rely on the // 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. // this pdf.
return { needAppearances: true }; return { needAppearances: true };
} }

View File

@ -2745,7 +2745,7 @@ class PartialEvaluator {
// This is not a 0, 90, 180, 270 rotation so: // This is not a 0, 90, 180, 270 rotation so:
// - remove the scale factor from the matrix to get a rotation matrix // - remove the scale factor from the matrix to get a rotation matrix
// - apply the inverse (which is the transposed) to the positions // - 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. // a whitespace.
[posX, posY] = applyInverseRotation(posX, posY, currentTransform); [posX, posY] = applyInverseRotation(posX, posY, currentTransform);
[lastPosX, lastPosY] = applyInverseRotation( [lastPosX, lastPosY] = applyInverseRotation(
@ -3823,7 +3823,7 @@ class PartialEvaluator {
// According to the spec if the font is a simple font we should only map // 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 // to unicode if the base encoding is MacRoman, MacExpert, or WinAnsi or
// the differences array only contains adobe standard or symbol set names, // 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. // based of the default encoding.
if (!properties.composite /* is simple font */) { if (!properties.composite /* is simple font */) {
return new ToUnicodeMap(this._simpleFontToUnicode(properties)); return new ToUnicodeMap(this._simpleFontToUnicode(properties));

View File

@ -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) { if (!inFDEF && !inELSE) {
let stackDelta = 0; let stackDelta = 0;
if (op <= 0x8e) { if (op <= 0x8e) {

View File

@ -237,8 +237,8 @@ class PDFImage {
this.jpxDecoderOptions.numComponents = hasColorSpace this.jpxDecoderOptions.numComponents = hasColorSpace
? this.numComps ? this.numComps
: 0; : 0;
// If the jpx image has a color space then it musn't be used in order to // If the jpx image has a color space then it mustn't be used in order
// be able to use the color space that comes from the pdf. // to be able to use the color space that comes from the pdf.
this.jpxDecoderOptions.isIndexedColormap = this.jpxDecoderOptions.isIndexedColormap =
this.colorSpace.name === "Indexed"; this.colorSpace.name === "Indexed";
} }

View File

@ -83,7 +83,7 @@ class ImageResizer {
// TODO: the computation can be a bit long because we potentially allocate // 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 // 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). // RGBA).
this.#goodSquareLength = this._guessMax( this.#goodSquareLength = this._guessMax(
this.#goodSquareLength, this.#goodSquareLength,

View File

@ -241,7 +241,7 @@ const OPERAND = false;
// operation ('... * - ...' can't be a subtraction). // operation ('... * - ...' can't be a subtraction).
// Each time an operator is met its precedence is compared with the one of the // Each time an operator is met its precedence is compared with the one of the
// operator on top of operators stack: // 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; // on their stack;
// - else just push the operator. // - else just push the operator.
// For example: 1 + 2 * 3 // For example: 1 + 2 * 3

View File

@ -1027,7 +1027,7 @@ class CanvasGraphics {
); );
const fillCtx = fillCanvas.context; 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: // If objToCanvas is [a,b,c,d,e,f] then:
// - offsetX = min(a, c) + e // - offsetX = min(a, c) + e
// - offsetY = min(b, d) + f // - offsetY = min(b, d) + f

View File

@ -530,7 +530,7 @@ class AnnotationEditorLayer {
/** /**
* An editor can have a different parent, for example after having * 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 * @param {AnnotationEditor} editor
*/ */
changeParent(editor) { changeParent(editor) {

View File

@ -1185,7 +1185,7 @@ function _isValidExplicitDest(validRef, validName, dest) {
return true; 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. // https://github.com/tc39/proposal-math-clamp/ is generally available.
function MathClamp(v, min, max) { function MathClamp(v, min, max) {
return Math.min(Math.max(v, min), max); return Math.min(Math.max(v, min), max);

View File

@ -377,7 +377,7 @@ class Rasterize {
height: height / pageHeight, 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. // boxes so that they can be merged together.
const outliner = new HighlightOutliner(boxes, /* borderWidth = */ 0.001); const outliner = new HighlightOutliner(boxes, /* borderWidth = */ 0.001);
// We set the borderWidth to 0.0025 in order to have an outline which is // We set the borderWidth to 0.0025 in order to have an outline which is

View File

@ -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; let pages;
beforeEach(async () => { beforeEach(async () => {

View File

@ -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 { class FirefoxEventBus extends EventBus {
#externalServices; #externalServices;

View File

@ -722,7 +722,7 @@ class PDFFindController {
// kind of whitespaces are replaced by a single " ". // kind of whitespaces are replaced by a single " ".
if (p1) { if (p1) {
// Escape characters like *+?... to not interfer with regexp syntax. // Escape characters like *+?... to not interfere with regexp syntax.
return `[ ]*\\${p1}[ ]*`; return `[ ]*\\${p1}[ ]*`;
} }
if (p2) { if (p2) {