Skip to content

Fix typos in src/ #39606

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/3p-frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export function getDefaultBootstrapBaseUrl(parentWindow, opt_srcFileBasename) {
}

/**
* Function to return the development boostrap base URL
* Function to return the development bootstrap base URL
* @param {!Window} parentWindow
* @param {string} srcFileBasename
* @return {string}
Expand Down
2 changes: 1 addition & 1 deletion src/amp-story-player/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -456,4 +456,4 @@ AMP provides some channels that you can opt-in to get the latest changes. To opt

If you have found a bug or have an issue request, file a [Github issue](https://github.com/ampproject/amphtml/issues?q=is%3Aissue+is%3Aopen+label%3A%22WG%3A+stories%22+) and tag the @ampproject/wg-stories working group.

For questions / disscusion, join the [amp-story slack channel](https://github.com/ampproject/amphtml/blob/main/docs/contributing.md#discussion-channels) and ping us!.
For questions / discussion, join the [amp-story slack channel](https://github.com/ampproject/amphtml/blob/main/docs/contributing.md#discussion-channels) and ping us!.
2 changes: 1 addition & 1 deletion src/amp-story-player/amp-story-component-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class AmpStoryComponentManager {
}

/**
* Builds and layouts the players when appropiate.
* Builds and layouts the players when appropriate.
* @public
*/
loadPlayers() {
Expand Down
12 changes: 6 additions & 6 deletions src/amp-story-player/amp-story-player-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ const LOG_TYPE_ENUM = {
};

/**
* NOTE: If udpated here, update in amp-story.js
* NOTE: If updated here, update in amp-story.js
* @private @const {number}
*/
const PANEL_ASPECT_RATIO_THRESHOLD = 31 / 40;
Expand Down Expand Up @@ -930,7 +930,7 @@ export class AmpStoryPlayer {
}

/**
* Triggers when swithing from one story to another.
* Triggers when switching from one story to another.
* @private
*/
onNavigation_() {
Expand Down Expand Up @@ -987,7 +987,7 @@ export class AmpStoryPlayer {
}

/**
* Fetches more stories if appropiate.
* Fetches more stories if appropriate.
* @param {number} remaining Number of stories remaining in the player.
* @private
*/
Expand Down Expand Up @@ -1263,7 +1263,7 @@ export class AmpStoryPlayer {
// 1. Wait for current story to load before evaluating neighbor stories.
this.currentStoryPromise_(story)
.then(() => this.maybeGetCacheUrl_(story.href))
// 2. Set iframe src when appropiate
// 2. Set iframe src when appropriate
.then((storyUrl) => {
if (!this.sanitizedUrlsAreEquals_(storyUrl, story.iframe.src)) {
this.setSrc_(story, storyUrl);
Expand Down Expand Up @@ -1706,7 +1706,7 @@ export class AmpStoryPlayer {
}

/**
* Updates the visbility state of the exit control button.
* Updates the visibility state of the exit control button.
* TODO(#30031): delete this once new custom UI API is ready.
* @param {boolean} isVisible
* @private
Expand Down Expand Up @@ -1754,7 +1754,7 @@ export class AmpStoryPlayer {
}

/**
* Dispatches end of stories event when appropiate.
* Dispatches end of stories event when appropriate.
* @param {!Object} data
* @private
*/
Expand Down
2 changes: 1 addition & 1 deletion src/amp.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ if (self.console) {
self.location.href
);
}
// This code is eleminated in prod build through a babel transformer.
// This code is eliminated in prod build through a babel transformer.
if (getMode().localDev) {
self.document.documentElement.setAttribute('esm', mode.isEsm() ? 1 : 0);
}
Expand Down
2 changes: 1 addition & 1 deletion src/base-element.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ declare namespace AMP {
element?: Element
): Promise<void>;
mutateElementSkipRemeasure(mutator: any): Promise<void>;
collapsedCalback(element: AmpElement): void;
collapsedCallback(element: AmpElement): void;
expand(): void;
mutatedAttributesCallback(mutations: Mutations): void;
onLayoutMeasure(): void;
Expand Down
2 changes: 1 addition & 1 deletion src/chunk.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ class Chunks {
*/
executeAsap_(idleDeadline) {
// If the user-agent supports isInputPending, use it to break to a macro task as necessary.
// Otherwise If we've spent over 5 millseconds executing the
// Otherwise If we've spent over 5 milliseconds executing the
// last instruction yield back to the main thread.
// 5 milliseconds is a magic number.
if (
Expand Down
6 changes: 3 additions & 3 deletions src/cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ function tryGetDocumentCookie_(win) {
* - highestAvailableDomain: If true, set the cookie at the widest domain
* scope allowed by the browser. E.g. on example.com if we are currently
* on www.example.com.
* - domain: Explicit domain to set. domain overrides HigestAvailableDomain
* - domain: Explicit domain to set. domain overrides HighestAvailableDomain
* - allowOnProxyOrigin: Allow setting a cookie on the AMP Cache.
* - sameSite: The SameSite_Enum value to use when setting the cookie.
* - secure: Whether the cookie should contain Secure (only sent over https).
*/
export function setCookie(win, name, value, expirationTime, options = {}) {
checkOriginForSettingCookie(win, options, name);
let domain = undefined;
// Respect explicitly set domain over higestAvailabeDomain
// Respect explicitly set domain over highestAvailableDomain
if (options.domain) {
domain = options.domain;
} else if (options.highestAvailableDomain) {
Expand All @@ -106,7 +106,7 @@ export function setCookie(win, name, value, expirationTime, options = {}) {
}

/**
* Attemp to find the HighestAvailableDomain on
* Attempt to find the HighestAvailableDomain on
* @param {!Window} win
* @return {?string}
*/
Expand Down
2 changes: 1 addition & 1 deletion src/core/3p-frame-messaging.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function listen(element, eventType, listener, opt_evtListenerOpts) {
* @return {string}
*/
export function serializeMessage(type, sentinel, data = {}, rtvVersion = null) {
// TODO: consider wrap the data in a "data" field. { type, sentinal, data }
// TODO: consider wrap the data in a "data" field. { type, sentinel, data }
const message = data;
message['type'] = type;
message['sentinel'] = sentinel;
Expand Down
2 changes: 1 addition & 1 deletion src/core/constants/enums.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Registred singleton on AMP doc.
* Registered singleton on AMP doc.
* @enum {number}
*/
export const AMPDOC_SINGLETON_NAME_ENUM = {
Expand Down
2 changes: 1 addition & 1 deletion src/core/context/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function rediscoverChildren(node) {
}

/**
* Sets the property's input value. This is analagous to a CSS specified
* Sets the property's input value. This is analogous to a CSS specified
* value. Several values for the same property can be set on a node - one
* per each setter. A repeated call for the same setter overwrites a
* previously set input. This is similar to how the same CSS property can be
Expand Down
4 changes: 2 additions & 2 deletions src/core/context/values.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class Values {
}

/**
* Sets the property's input value. This is analagous to a CSS specified
* Sets the property's input value. This is analogous to a CSS specified
* value. Several values for the same property can be set on a node - one
* per each setter. A repeated call for the same setter overwrites a
* previously set input. This is similar to how the same CSS property can be
Expand Down Expand Up @@ -475,7 +475,7 @@ export class Values {
const {key} = used.prop;
used.counter++;
if (used.counter > 5) {
// A simple protection from infinte loops.
// A simple protection from infinite loops.
rethrowAsync(`cyclical prop: ${key}`);
used.pending = Pending_Enum.NOT_PENDING;
return;
Expand Down
2 changes: 1 addition & 1 deletion src/core/data-structures/priority-queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class PriorityQueue {
break;
}
// Stop searching once p[i] >= target AND p[i-1] < target.
// This way, we'll return the index of the first occurence of `target`
// This way, we'll return the index of the first occurrence of `target`
// priority (if any), which preserves FIFO order of same-priority items.
if (this.queue_[i].priority < target) {
lo = i + 1;
Expand Down
4 changes: 2 additions & 2 deletions src/core/dom/css-selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export function escapeCssSelectorIdent(ident) {
}

/**
* Escapes an ident in a way that can be used by :nth-child() psuedo-class.
* Escapes an ident in a way that can be used by :nth-child() pseudo-class.
*
* See https://github.com/w3c/csswg-drafts/issues/2306.
*
Expand All @@ -98,7 +98,7 @@ export function escapeCssSelectorIdent(ident) {
*/
export function escapeCssSelectorNth(ident) {
const escaped = String(ident);
// Ensure it doesn't close the nth-child psuedo class.
// Ensure it doesn't close the nth-child pseudo class.
devAssert(escaped.indexOf(')') === -1);
return escaped;
}
2 changes: 1 addition & 1 deletion src/core/dom/globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ declare global {
replaceSync: (text: string) => void;
}

// Fullscreen proprties
// Fullscreen properties
interface Element {
requestFullScreen: any;
exitFullscreen: any;
Expand Down
2 changes: 1 addition & 1 deletion src/core/dom/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ export function isRTL(doc) {
}

/**
* Escapes `<`, `>` and other HTML charcaters with their escaped forms.
* Escapes `<`, `>` and other HTML characters with their escaped forms.
* @param {string} text
* @return {string}
*/
Expand Down
2 changes: 1 addition & 1 deletion src/core/dom/media-query-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function parseMediaQueryListExpr(win, exprString) {
}
}

// Then, skip to the begining to the function's name.
// Then, skip to the beginning to the function's name.
const funcEnd = div - 1;
if (div > 0) {
div--;
Expand Down
4 changes: 2 additions & 2 deletions src/core/dom/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {isScopeSelectorSupported, prependSelectorsWith} from './css-selectors';

/**
* Asserts that name is just an alphanumeric word, and does not contain
* advanced CSS selector features like attributes, psuedo-classes, class names,
* advanced CSS selector features like attributes, pseudo-classes, class names,
* nor ids.
* @param {string} name
*/
Expand Down Expand Up @@ -109,7 +109,7 @@ export function matches(el, selector) {
* up the DOM subtree.
* @param {HTMLElement} element
* @param {function(HTMLElement):boolean} callback
* @param {HTMLElement=} opt_stopAt optional elemnt to stop the search at.
* @param {HTMLElement=} opt_stopAt optional element to stop the search at.
* @return {?HTMLElement}
*/
export function closest(element, callback, opt_stopAt) {
Expand Down
4 changes: 2 additions & 2 deletions src/core/dom/video/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ const AUTOPLAY_SUPPORTED_WIN_PROP = '__AMP_AUTOPLAY';
/**
* Determines autoplay support.
*
* Note that even if platfrom supports autoplay, users or browsers can disable
* autoplay to save data / battery. This detects both platfrom support and
* Note that even if platform supports autoplay, users or browsers can disable
* autoplay to save data / battery. This detects both platform support and
* when autoplay has been disabled by the user.
*
* @param {Window} win
Expand Down
2 changes: 1 addition & 1 deletion src/core/dom/web-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function isShadowCssSupported() {
/**
* Returns `true` if the passed function is native to the browser, and is not
* polyfilled
* @param {Function|undefined} func A function that is attatched to a JS
* @param {Function|undefined} func A function that is attached to a JS
* object.
* @return {boolean}
*/
Expand Down
2 changes: 1 addition & 1 deletion src/experiments/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export function toggleExperiment(

/**
* Calculate whether the experiment is on or off based off of its default value,
* stored overriden value, or the global config frequency given.
* stored overridden value, or the global config frequency given.
* @param {Window} win
* @return {ExperimentTogglesMap}
*/
Expand Down
2 changes: 1 addition & 1 deletion src/extension-analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function insertAnalyticsElement(
/**
* A class that handles customEvent reporting of extension element through
* amp-analytics. This class is not exposed to extension element directly to
* restrict the genration of the config Please use CustomEventReporterBuilder to
* restrict the generation of the config Please use CustomEventReporterBuilder to
* build a CustomEventReporter instance.
*/
class CustomEventReporter {
Expand Down
4 changes: 2 additions & 2 deletions src/friendly-iframe-embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ function mergeHtml(spec) {

const result = [];

// Preambule.
// Preamble.
if (ip > 0) {
result.push(originalHtml.substring(0, ip));
}
Expand Down Expand Up @@ -468,7 +468,7 @@ export class FriendlyIframeEmbed {
}

/**
* Signal that indicates that all DOM elements have been tranferred to live
* Signal that indicates that all DOM elements have been transferred to live
* embed DOM.
*/
renderCompleted() {
Expand Down
4 changes: 2 additions & 2 deletions src/iframe-attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export function getContextMetadata(
// values with name
// ampcontext.js and this file are compiled in different compilation unit

// Note: Field names can by perserved by using JsonObject, or by adding
// perserved name to extern. We are doing both right now.
// Note: Field names can by preserved by using JsonObject, or by adding
// preserved name to extern. We are doing both right now.
// Please also add new introduced variable
// name to the extern list.
attributes['_context'] = {
Expand Down
2 changes: 1 addition & 1 deletion src/iframe-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function isDescendantWindow(ancestor, descendant) {
}

/**
* Removes any listenFors registed on listenSentinel that do not have
* Removes any listenFors registered on listenSentinel that do not have
* a contentWindow (the frame was removed from the DOM tree).
* @param {!Array<!WindowEventsDef>} listenSentinel
*/
Expand Down
2 changes: 1 addition & 1 deletion src/inabox/inabox-resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export class InaboxResources {
}

/**
* Builds any pending resouces if document is ready, or next element has been
* Builds any pending resources if document is ready, or next element has been
* added to DOM.
* @private
*/
Expand Down
4 changes: 2 additions & 2 deletions src/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {registerServiceBuilder} from './service-helpers';

const TAG_ = 'Input';

const MAX_MOUSE_CONFIRM_ATTEMPS_ = 3;
const MAX_MOUSE_CONFIRM_ATTEMPTS_ = 3;
const CLICK_TIMEOUT_ = 300;

/**
Expand Down Expand Up @@ -261,7 +261,7 @@ export class Input {
mouseCanceled_() {
// Repeat, if attempts allow.
this.mouseConfirmAttemptCount_++;
if (this.mouseConfirmAttemptCount_ <= MAX_MOUSE_CONFIRM_ATTEMPS_) {
if (this.mouseConfirmAttemptCount_ <= MAX_MOUSE_CONFIRM_ATTEMPTS_) {
listenOnce(
this.win.document,
'mousemove',
Expand Down
4 changes: 2 additions & 2 deletions src/multidoc-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export class MultidocManager {

/**
* Closes the document, resolving when visibility changes and services have
* been cleand up. The document can no longer be activated again.
* been cleaned up. The document can no longer be activated again.
* @return {Promise}
*/
amp['close'] = () => {
Expand Down Expand Up @@ -361,7 +361,7 @@ export class MultidocManager {
// Must be a font definition: no other stylesheets are allowed.
if (parentLinks[href]) {
dev().fine(TAG, '- stylesheet already included: ', href);
// To accomodate icon fonts whose stylesheets include
// To accommodate icon fonts whose stylesheets include
// the class definitions in addition to the font definition,
// we re-import the stylesheet into the shadow document.
// Note: <link> in shadow mode is not yet fully supported on
Expand Down
Loading
Loading