commit 0895ef714d19de7b35c74614283fc6a8311d0c7c
parent c2693fb1687c4647473846a1ab15c48e08f63670
Author: Mark Banner <standard8@mozilla.com>
Date: Mon, 22 Dec 2025 12:39:07 +0000
Bug 2004680 - Fix ESLint rule jsdoc/check-tag-names issues in dom. r=dom-core,media-playback-reviewers,smaug,alwu
Differential Revision: https://phabricator.services.mozilla.com/D275757
Diffstat:
10 files changed, 45 insertions(+), 51 deletions(-)
diff --git a/dom/base/test/test_document_wireframe.html b/dom/base/test/test_document_wireframe.html
@@ -270,9 +270,8 @@
* The iframe to load the page in.
* @param {string} page
* The URL of the page to load in the frame.
- * @returns Promise
- * @resolves undefined
- * Once the load event has fired for the frame.
+ * @returns {Promise<Event>}
+ * Resolves once the load event has fired for the frame.
*/
function loadInIframe(frame, page) {
return new Promise(resolve => {
diff --git a/dom/html/test/forms/test_max_attribute.html b/dom/html/test/forms/test_max_attribute.html
@@ -47,14 +47,16 @@ var input = document.createElement("input");
document.getElementById('content').appendChild(input);
/**
- * @aValidity - boolean indicating whether the element is expected to be valid
+ * @param {boolean} aValidity
+ * Indicates whether the element is expected to be valid
* (aElement.validity.valid is true) or not. The value passed is ignored and
* overridden with true if aApply is false.
- * @aApply - boolean indicating whether the min/max attributes apply to this
- * element type.
- * @aRangeApply - A boolean that's set to true if the current input type is a
- * "[candidate] for constraint validation" and it "[has] range limitations"
- * per http://www.whatwg.org/specs/web-apps/current-work/multipage/selectors.html#selector-in-range
+ * @param {boolean} aApply
+ * Indicating whether the min/max attributes apply to this element type.
+ * @param {boolean} aRangeApply
+ * Set to true if the current input type is a "[candidate] for constraint
+ * validation" and it "[has] range limitations" per
+ * http://www.whatwg.org/specs/web-apps/current-work/multipage/selectors.html#selector-in-range
* (in other words, one of the pseudo classes :in-range and :out-of-range
* should apply (which, depends on aValidity)).
* Else (neither :in-range or :out-of-range should match) set to false.
diff --git a/dom/html/test/forms/test_min_attribute.html b/dom/html/test/forms/test_min_attribute.html
@@ -47,14 +47,16 @@ var input = document.createElement("input");
document.getElementById('content').appendChild(input);
/**
- * @aValidity - boolean indicating whether the element is expected to be valid
+ * @param {boolean} aValidity
+ * Indicates whether the element is expected to be valid
* (aElement.validity.valid is true) or not. The value passed is ignored and
* overridden with true if aApply is false.
- * @aApply - boolean indicating whether the min/max attributes apply to this
- * element type.
- * @aRangeApply - A boolean that's set to true if the current input type is a
- * "[candidate] for constraint validation" and it "[has] range limitations"
- * per http://www.whatwg.org/specs/web-apps/current-work/multipage/selectors.html#selector-in-range
+ * @param {boolean} aApply
+ * Indicating whether the min/max attributes apply to this element type.
+ * @param {boolean} aRangeApply
+ * Set to true if the current input type is a "[candidate] for constraint
+ * validation" and it "[has] range limitations" per
+ * http://www.whatwg.org/specs/web-apps/current-work/multipage/selectors.html#selector-in-range
* (in other words, one of the pseudo classes :in-range and :out-of-range
* should apply (which, depends on aValidity)).
* Else (neither :in-range or :out-of-range should match) set to false.
diff --git a/dom/ipc/tests/browser_ProcessPriorityManager.js b/dom/ipc/tests/browser_ProcessPriorityManager.js
@@ -79,9 +79,8 @@ class TabPriorityWatcher {
* @param expectedPriority (String)
* One of the PROCESS_PRIORITY_ constants defined at the
* top of this file.
- * @return Promise
- * @resolves undefined
- * Once the browser reaches the expected priority.
+ * @returns {Promise<void>}
+ * Resolves once the browser reaches the expected priority.
*/
async waitForPriorityChange(childID, expectedPriority) {
await TestUtils.waitForCondition(() => {
@@ -106,9 +105,8 @@ class TabPriorityWatcher {
*
* @param childID
* The childID of the process that we expect to not change priority.
- * @return Promise
- * @resolves undefined
- * Once the WAIT_FOR_CHANGE_TIME_MS duration has passed.
+ * @returns {Promise<void>}
+ * Resolves once the WAIT_FOR_CHANGE_TIME_MS duration has passed.
*/
async ensureNoPriorityChange(childID) {
this.noChangeChildIDs.set(childID, []);
@@ -134,9 +132,8 @@ class TabPriorityWatcher {
* @param expectedPriority (String)
* One of the PROCESS_PRIORITY_ constants defined at the
* top of this file.
- * @return Promise
- * @resolves undefined
- * Once the browser reaches the expected priority.
+ * @returns {Promise<void>}
+ * Resolves once the browser reaches the expected priority.
*/
async waitForBrowserTreePriority(browser, expectedPriority) {
let childIDs = new Set(
@@ -255,10 +252,9 @@ registerCleanupFunction(() => {
* This should be one of the PROCESS_PRIORITY_ strings defined at the
* top of the file.
*
- * @return Promise
- * @resolves undefined
- * Once the tab switch is complete, and the two content processes for the
- * tabs have reached the expected priority levels.
+ * @returns {Promise<void>}
+ * Resolves once the tab switch is complete, and the two content processes for
+ * the tabs have reached the expected priority levels.
*/
async function assertPriorityChangeOnBackground({
fromTab,
diff --git a/dom/manifest/Manifest.sys.mjs b/dom/manifest/Manifest.sys.mjs
@@ -26,7 +26,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
/**
* Generates an hash for the given string.
*
- * @note The generated hash is returned in base64 form. Mind the fact base64
+ * Note: The generated hash is returned in base64 form. Mind the fact base64
* is case-sensitive if you are going to reuse this code.
*/
function generateHash(aString, hashAlg) {
diff --git a/dom/manifest/ValueExtractor.sys.mjs b/dom/manifest/ValueExtractor.sys.mjs
@@ -15,7 +15,7 @@ export class ValueExtractor {
/**
* @param options
* The 'spec' object.
- * @note This function takes a 'spec' object and destructures it to extract
+ * Note: This function takes a 'spec' object and destructures it to extract
* a value. If the value is of the wrong type, it warns the developer
* and returns undefined.
* expectedType: is the type of a JS primitive (string, number, etc.)
diff --git a/dom/media/test/cloneElementVisually_helpers.js b/dom/media/test/cloneElementVisually_helpers.js
@@ -82,9 +82,8 @@ function captureFrameImageData(video) {
* A video element to compare against.
* @param video2 (<video> element)
* A video to compare with video1.
- * @return Promise
- * @resolves
- * Resolves as true if the two videos match.
+ * @returns {Promise<boolean>}
+ * Resolves as true if the two videos match.
*/
async function assertVideosMatch(video1, video2) {
let video1Frame = captureFrameImageData(video1);
@@ -133,10 +132,9 @@ async function assertVideosMatch(video1, video2) {
* @param asyncFn (async function)
* A test function that will be passed the new clone as its
* only argument.
- * @return Promise
- * @resolves
- * When the asyncFn resolves and the clone has been removed
- * from the DOM.
+ * @returns {Promise<void>}
+ * Resolves when the asyncFn has resolved and the clone has been removed from
+ * the DOM.
*/
async function withNewClone(video, asyncFn) {
let clone = video.cloneNode();
@@ -159,9 +157,8 @@ async function withNewClone(video, asyncFn) {
* The video to set the src on.
* @param src (string)
* The URL to set as the source on a video.
- * @return Promise
- * @resolves
- * When the video fires the "canplay" event.
+ * @returns {Promise<Event>}
+ * Resolves when the video fires the "canplay" event.
*/
async function setVideoSrc(video, src) {
let promiseReady = waitForEventOnce(video, "canplay");
@@ -177,9 +174,8 @@ async function setVideoSrc(video, src) {
* The target to monitor for the event.
* @param event (string)
* The name of the event to wait for.
- * @return Promise
- * @resolves
- * When the event fires, and resolves to the event.
+ * @returns {Promise<Event>}
+ * Resolves when the event fires with the event.
*/
function waitForEventOnce(target, event) {
return new Promise(resolve => {
@@ -192,9 +188,8 @@ function waitForEventOnce(target, event) {
* when the decoders have shut down.
*
* @param video (<video> element)
- * @return Promise
- * @resolves
- * When the decoder has shut down.
+ * @returns {Promise<void>}
+ * Resolves when the decoder has shut down.
*/
function waitForShutdownDecoder(video) {
return SimpleTest.promiseWaitForCondition(async () => {
diff --git a/dom/notification/test/browser/browser_permission_dismiss.js b/dom/notification/test/browser/browser_permission_dismiss.js
@@ -17,7 +17,7 @@ const TEST_URL =
*
* @param {number} aButtonIndex Number indicating which button to click.
* See the constants in this file.
- * @note modified from toolkit/components/passwordmgr/test/browser/head.js
+ * Note: modified from toolkit/components/passwordmgr/test/browser/head.js
*/
function clickDoorhangerButton(aButtonIndex, browser) {
let popup = PopupNotifications.getNotification("web-notifications", browser);
diff --git a/dom/security/test/https-first/browser_slow_download.js b/dom/security/test/https-first/browser_slow_download.js
@@ -25,8 +25,8 @@ function promisePanelOpened() {
* @param aDownload
* The Download object to wait upon.
*
- * @return {Promise}
- * @resolves When the download has finished successfully.
+ * @returns {Promise<void>}
+ * Resolves when the download has finished successfully.
* @rejects JavaScript exception if the download failed.
*/
function promiseDownloadStopped(aDownload) {
diff --git a/dom/xhr/tests/test_XHR_timeout.js b/dom/xhr/tests/test_XHR_timeout.js
@@ -50,10 +50,10 @@ function ok(bool, msg) {
* reset the timeout.
* @param {number} resetTo (Optional) The delay to reset the timeout to.
*
- * @note The actual testing takes place in handleEvent(event).
+ * Note: The actual testing takes place in handleEvent(event).
* The requests are generated in startXHR().
*
- * @note If resetAfter and resetTo are omitted, only the initial timeout setting
+ * Note: If resetAfter and resetTo are omitted, only the initial timeout setting
* applies.
*
* @class