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.
const addRules = [
{

View File

@ -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 };
}

View File

@ -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));

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) {
let stackDelta = 0;
if (op <= 0x8e) {

View File

@ -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";
}

View File

@ -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,

View File

@ -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

View File

@ -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

View File

@ -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) {

View File

@ -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);

View File

@ -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

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;
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 {
#externalServices;

View File

@ -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) {