From 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:33 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- toolkit/content/aboutLogging.js | 6 +- toolkit/content/aboutNetError.mjs | 12 +- toolkit/content/aboutSupport.js | 2 +- toolkit/content/aboutSupport.xhtml | 4 +- toolkit/content/aboutwebrtc/aboutWebrtc.mjs | 2 +- toolkit/content/contentAreaUtils.js | 3 +- toolkit/content/customElements.js | 2 + toolkit/content/jar.mn | 5 + toolkit/content/license.html | 83 +----- .../content/tests/browser/browser_about_logging.js | 22 +- .../browser/browser_default_audio_filename.js | 2 +- .../browser/browser_default_image_filename.js | 2 +- .../browser_default_image_filename_redirect.js | 2 +- .../content/tests/browser/browser_saveImageURL.js | 2 +- .../browser_save_folder_standalone_image.js | 2 +- .../tests/browser/browser_save_resend_postdata.js | 2 +- .../content/tests/browser/datetime/browser.toml | 5 +- .../datetime/browser_datetime_change_event.js | 46 ++++ toolkit/content/tests/browser/datetime/head.js | 12 +- toolkit/content/tests/chrome/chrome.toml | 2 + .../tests/chrome/test_autocomplete_mac_caret.xhtml | 4 +- .../chrome/test_menulist_initial_selection.xhtml | 55 ++++ toolkit/content/tests/chrome/window_tooltip.xhtml | 6 +- .../test_autocomplete_change_after_focus.html | 2 +- toolkit/content/tests/widgets/chrome.toml | 5 + toolkit/content/tests/widgets/test_moz_button.html | 158 +++++++++++ .../content/tests/widgets/test_moz_page_nav.html | 306 +++++++++++++++++++++ .../content/tests/widgets/test_videocontrols.html | 2 +- toolkit/content/widgets/arrowscrollbox.js | 15 +- toolkit/content/widgets/autocomplete-input.js | 10 +- toolkit/content/widgets/autocomplete-popup.js | 6 +- .../content/widgets/autocomplete-richlistitem.js | 4 +- toolkit/content/widgets/browser-custom-element.js | 4 +- toolkit/content/widgets/datetimebox.js | 2 +- toolkit/content/widgets/dialog.js | 4 +- toolkit/content/widgets/editor.js | 6 +- toolkit/content/widgets/findbar.js | 12 +- toolkit/content/widgets/menu.js | 2 +- toolkit/content/widgets/menulist.js | 3 + toolkit/content/widgets/menupopup.js | 23 +- .../widgets/moz-button-group/moz-button-group.mjs | 2 +- toolkit/content/widgets/moz-button/moz-button.css | 142 ++++++++++ toolkit/content/widgets/moz-button/moz-button.mjs | 90 ++++++ .../widgets/moz-button/moz-button.stories.mjs | 100 +++++++ toolkit/content/widgets/moz-input-box.js | 2 +- .../content/widgets/moz-label/README.stories.md | 4 +- toolkit/content/widgets/moz-label/moz-label.mjs | 2 +- .../widgets/moz-message-bar/moz-message-bar.mjs | 2 +- .../moz-message-bar/moz-message-bar.stories.mjs | 6 + .../widgets/moz-page-nav/moz-page-nav-button.css | 123 +++++++++ .../content/widgets/moz-page-nav/moz-page-nav.css | 76 +++++ .../content/widgets/moz-page-nav/moz-page-nav.mjs | 170 ++++++++++++ .../widgets/moz-page-nav/moz-page-nav.stories.mjs | 77 ++++++ .../widgets/moz-support-link/moz-support-link.mjs | 2 +- toolkit/content/widgets/moz-toggle/moz-toggle.css | 39 +-- toolkit/content/widgets/named-deck.js | 2 +- toolkit/content/widgets/notificationbox.js | 2 +- .../content/widgets/panel-list/README.stories.md | 22 +- toolkit/content/widgets/panel-list/panel-list.css | 4 + toolkit/content/widgets/panel-list/panel-list.js | 59 ++-- .../widgets/panel-list/panel-list.stories.mjs | 45 ++- toolkit/content/widgets/radio.js | 6 +- toolkit/content/widgets/richlistbox.js | 2 +- toolkit/content/widgets/search-textbox.js | 2 +- toolkit/content/widgets/tabbox.js | 8 +- toolkit/content/widgets/text.js | 2 +- toolkit/content/widgets/textrecognition.js | 2 +- toolkit/content/widgets/tree.js | 8 +- toolkit/content/widgets/videocontrols.js | 80 ++---- toolkit/content/widgets/wizard.js | 2 +- toolkit/content/xul.css | 89 +----- 71 files changed, 1625 insertions(+), 394 deletions(-) create mode 100644 toolkit/content/tests/browser/datetime/browser_datetime_change_event.js create mode 100644 toolkit/content/tests/chrome/test_menulist_initial_selection.xhtml create mode 100644 toolkit/content/tests/widgets/test_moz_button.html create mode 100644 toolkit/content/tests/widgets/test_moz_page_nav.html create mode 100644 toolkit/content/widgets/moz-button/moz-button.css create mode 100644 toolkit/content/widgets/moz-button/moz-button.mjs create mode 100644 toolkit/content/widgets/moz-button/moz-button.stories.mjs create mode 100644 toolkit/content/widgets/moz-page-nav/moz-page-nav-button.css create mode 100644 toolkit/content/widgets/moz-page-nav/moz-page-nav.css create mode 100644 toolkit/content/widgets/moz-page-nav/moz-page-nav.mjs create mode 100644 toolkit/content/widgets/moz-page-nav/moz-page-nav.stories.mjs (limited to 'toolkit/content') diff --git a/toolkit/content/aboutLogging.js b/toolkit/content/aboutLogging.js index 5aaf0f9ecc..daff10fbec 100644 --- a/toolkit/content/aboutLogging.js +++ b/toolkit/content/aboutLogging.js @@ -50,7 +50,7 @@ function moduleEnvVarPresent() { * as markers. * * [1]: The keys of the `presets` object defined in - * https://searchfox.org/mozilla-central/source/devtools/client/performance-new/shared/background.jsm.js + * https://searchfox.org/mozilla-central/source/devtools/client/performance-new/shared/background.sys.mjs */ const gOsSpecificLoggingPresets = (() => { @@ -74,7 +74,7 @@ const gOsSpecificLoggingPresets = (() => { const gLoggingPresets = { networking: { modules: - "timestamp,sync,nsHttp:5,cache2:5,nsSocketTransport:5,nsHostResolver:5", + "timestamp,sync,nsHttp:5,cache2:5,nsSocketTransport:5,nsHostResolver:5,EarlyHint:5", l10nIds: { label: "about-logging-preset-networking-label", description: "about-logging-preset-networking-description", @@ -228,7 +228,6 @@ function populatePresets() { $("#log-modules").value = gLoggingPresets[dropdown.value].modules; } setPresetAndDescription(dropdown.value); - setLogModules(); Services.prefs.setCharPref("logging.config.preset", dropdown.value); }; @@ -376,7 +375,6 @@ function parseURL() { $("#set-log-modules-button").disabled = true; $("#logging-preset-dropdown").disabled = true; someElementsDisabled = true; - setLogModules(); updateLogModules(); } if (outputTypeOverriden) { diff --git a/toolkit/content/aboutNetError.mjs b/toolkit/content/aboutNetError.mjs index 83f40fc479..554553fd62 100644 --- a/toolkit/content/aboutNetError.mjs +++ b/toolkit/content/aboutNetError.mjs @@ -430,11 +430,21 @@ function initPage() { tryAgain.hidden = true; break; - // Pinning errors are of type nssFailure2 + // TLS errors and non-overridable certificate errors (e.g. pinning + // failures) are of type nssFailure2. case "nssFailure2": { learnMore.hidden = false; const errorCode = document.getNetErrorInfo().errorCodeString; + RPMRecordTelemetryEvent( + "security.ui.tlserror", + "load", + "abouttlserror", + errorCode, + { + is_frame: (window.parent != window).toString(), + } + ); switch (errorCode) { case "SSL_ERROR_UNSUPPORTED_VERSION": case "SSL_ERROR_PROTOCOL_VERSION_ALERT": { diff --git a/toolkit/content/aboutSupport.js b/toolkit/content/aboutSupport.js index f668fd671f..f9f35e7e76 100644 --- a/toolkit/content/aboutSupport.js +++ b/toolkit/content/aboutSupport.js @@ -1179,7 +1179,7 @@ var snapshotFormatters = { $.new("td", cdmInfo.keySystemName), $.new("td", getVideoRobustness(rvArray)), $.new("td", getAudioRobustness(rvArray)), - $.new("td", getCapabilities(rvArray)), + $.new("td", getCapabilities(rvArray), null, { colspan: "4" }), $.new("td", cdmInfo.clearlead ? "Yes" : "No"), $.new("td", cdmInfo.isHDCP22Compatible ? "Yes" : "No"), ]); diff --git a/toolkit/content/aboutSupport.xhtml b/toolkit/content/aboutSupport.xhtml index d3de7d0019..d19fb64d56 100644 --- a/toolkit/content/aboutSupport.xhtml +++ b/toolkit/content/aboutSupport.xhtml @@ -567,13 +567,13 @@ - + - + diff --git a/toolkit/content/aboutwebrtc/aboutWebrtc.mjs b/toolkit/content/aboutwebrtc/aboutWebrtc.mjs index 3c41a4aa66..7e2c92a4bd 100644 --- a/toolkit/content/aboutwebrtc/aboutWebrtc.mjs +++ b/toolkit/content/aboutwebrtc/aboutWebrtc.mjs @@ -230,7 +230,7 @@ class SavePage extends Control { ]); let FilePicker = makeFilePickerService(); const lazyFileUtils = lazy.FileUtils; - FilePicker.init(window, dialogTitle, FilePicker.modeSave); + FilePicker.init(window.browsingContext, dialogTitle, FilePicker.modeSave); FilePicker.defaultString = LOGFILE_NAME_DEFAULT; const rv = await new Promise(r => FilePicker.open(r)); if (rv != FilePicker.returnOK && rv != FilePicker.returnReplace) { diff --git a/toolkit/content/contentAreaUtils.js b/toolkit/content/contentAreaUtils.js index d9ee83026e..983fd9890d 100644 --- a/toolkit/content/contentAreaUtils.js +++ b/toolkit/content/contentAreaUtils.js @@ -11,7 +11,6 @@ var { XPCOMUtils } = ChromeUtils.importESModule( ChromeUtils.defineESModuleGetters(this, { BrowserUtils: "resource://gre/modules/BrowserUtils.sys.mjs", - Deprecated: "resource://gre/modules/Deprecated.sys.mjs", DownloadLastDir: "resource://gre/modules/DownloadLastDir.sys.mjs", DownloadPaths: "resource://gre/modules/DownloadPaths.sys.mjs", Downloads: "resource://gre/modules/Downloads.sys.mjs", @@ -689,7 +688,7 @@ function promiseTargetFile( let fp = makeFilePicker(); let titleKey = aFpP.fpTitleKey || "SaveLinkTitle"; fp.init( - window, + window.browsingContext, ContentAreaUtils.stringBundle.GetStringFromName(titleKey), Ci.nsIFilePicker.modeSave ); diff --git a/toolkit/content/customElements.js b/toolkit/content/customElements.js index 30958a3a31..b0a8f33fe6 100644 --- a/toolkit/content/customElements.js +++ b/toolkit/content/customElements.js @@ -818,6 +818,8 @@ // like the previous Services.scriptloader.loadSubscript() function function importCustomElementFromESModule(name) { switch (name) { + case "moz-button": + return import("chrome://global/content/elements/moz-button.mjs"); case "moz-button-group": return import( "chrome://global/content/elements/moz-button-group.mjs" diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn index 8b18c94525..d08037a84a 100644 --- a/toolkit/content/jar.mn +++ b/toolkit/content/jar.mn @@ -91,10 +91,15 @@ toolkit.jar: content/global/elements/message-bar.js (widgets/message-bar.js) content/global/elements/menu.js (widgets/menu.js) content/global/elements/menupopup.js (widgets/menupopup.js) + content/global/elements/moz-button.css (widgets/moz-button/moz-button.css) + content/global/elements/moz-button.mjs (widgets/moz-button/moz-button.mjs) content/global/elements/moz-button-group.css (widgets/moz-button-group/moz-button-group.css) content/global/elements/moz-button-group.mjs (widgets/moz-button-group/moz-button-group.mjs) content/global/elements/moz-card.css (widgets/moz-card/moz-card.css) content/global/elements/moz-card.mjs (widgets/moz-card/moz-card.mjs) + content/global/elements/moz-page-nav.css (widgets/moz-page-nav/moz-page-nav.css) + content/global/elements/moz-page-nav-button.css (widgets/moz-page-nav/moz-page-nav-button.css) + content/global/elements/moz-page-nav.mjs (widgets/moz-page-nav/moz-page-nav.mjs) content/global/elements/moz-five-star.css (widgets/moz-five-star/moz-five-star.css) content/global/elements/moz-five-star.mjs (widgets/moz-five-star/moz-five-star.mjs) content/global/elements/moz-input-box.js (widgets/moz-input-box.js) diff --git a/toolkit/content/license.html b/toolkit/content/license.html index 9e0721906b..e9d2642354 100644 --- a/toolkit/content/license.html +++ b/toolkit/content/license.html @@ -104,7 +104,6 @@
  • jQuery License
  • k_exp License
  • Khronos group License
  • -
  • Kiss FFT License
  • #ifdef MOZ_USE_LIBCXX
  • libc++ License
  • #endif @@ -154,9 +153,6 @@
  • Validator License
  • VTune License
  • WebRTC License
  • -#ifdef MOZ_DEFAULT_BROWSER_AGENT -
  • WinToast License
  • -#endif
  • x264 License
  • Xiph.org Foundation License
  • @@ -2041,7 +2037,6 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  • gfx/ots/
  • gfx/ycbcr/
  • ipc/chromium/
  • -
  • media/openmax_dl/
  • toolkit/components/reputationservice/
  • toolkit/components/url-classifier/chromium/
  • tools/profiler/
  • @@ -3116,80 +3111,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -
    - -

    Khronos group License

    - -

    This license applies to the following files:

    - - - -
    -Copyright 2005-2008 The Khronos Group Inc. All Rights Reserved.
    -
    -These materials are protected by copyright laws and contain material
    -proprietary to the Khronos Group, Inc.  You may use these materials
    -for implementing Khronos specifications, without altering or removing
    -any trademark, copyright or other notice from the specification.
    -
    -Khronos Group makes no, and expressly disclaims any, representations
    -or warranties, express or implied, regarding these materials, including,
    -without limitation, any implied warranties of merchantability or fitness
    -for a particular purpose or non-infringement of any intellectual property.
    -Khronos Group makes no, and expressly disclaims any, warranties, express
    -or implied, regarding the correctness, accuracy, completeness, timeliness,
    -and reliability of these materials.
    -
    -Under no circumstances will the Khronos Group, or any of its Promoters,
    -Contributors or Members or their respective partners, officers, directors,
    -employees, agents or representatives be liable for any damages, whether
    -direct, indirect, special or consequential damages for lost revenues,
    -lost profits, or otherwise, arising from or in connection with these
    -materials.
    -
    -Khronos and OpenMAX are trademarks of the Khronos Group Inc.
    -
    - -
    - -

    Kiss FFT License

    - -

    This license applies to files in the directory - media/kiss_fft/.

    - -
    -Copyright (c) 2003-2010 Mark Borgerding
    -
    -All rights reserved.
    -
    -Redistribution and use in source and binary forms, with or without
    -modification, are permitted provided that the following conditions are met:
    -
    -    * Redistributions of source code must retain the above copyright notice,
    -      this list of conditions and the following disclaimer.
    -    * Redistributions in binary form must reproduce the above copyright notice,
    -      this list of conditions and the following disclaimer in the documentation
    -      and/or other materials provided with the distribution.
    -    * Neither the author nor the names of any contributors may be used to
    -      endorse or promote products derived from this software without specific
    -      prior written permission.
    -
    -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
    -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
    -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
    -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
    -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
    -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    -
    -
    #ifdef MOZ_USE_LIBCXX @@ -3695,9 +3616,6 @@ SOFTWARE.
  • third_party/rust/synstructure
  • third_party/rust/void
  • js/src/zydis (unless otherwise specified)
  • -#ifdef MOZ_DEFAULT_BROWSER_AGENT -
  • third_party/WinToast unless otherwise specified
  • -#endif See the individual LICENSE files or headers for copyright owners.

    @@ -5645,6 +5563,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. they are referred to below as "Distributable Code":

    diff --git a/toolkit/content/tests/browser/browser_about_logging.js b/toolkit/content/tests/browser/browser_about_logging.js index f458b36e0d..fdf8eab57b 100644 --- a/toolkit/content/tests/browser/browser_about_logging.js +++ b/toolkit/content/tests/browser/browser_about_logging.js @@ -110,15 +110,12 @@ add_task(async function testURLParameters() { !$("#some-elements-unavailable").hidden, "If modules are selected via URL, a warning should be displayed." ); - var inPageSorted = $("#current-log-modules") - .innerText.split(",") - .sort() - .join(","); - var inURLSorted = modulesInURL.split(",").sort().join(","); + var inInputSorted = $("#log-modules").value.split(",").sort().join(","); + var modulesSorted = modulesInURL.split(",").sort().join(","); Assert.equal( - inPageSorted, - inURLSorted, - "When selecting modules via URL params, the same modules are reflected in the page." + modulesSorted, + inInputSorted, + "When selecting modules via URL params, the log modules aren't immediately set" ); }); } @@ -135,19 +132,16 @@ add_task(async function testURLParameters() { !$("#some-elements-unavailable").hidden, "If a preset is selected via URL, a warning should be displayed." ); - var inPageSorted = $("#current-log-modules") - .innerText.split(",") - .sort() - .join(","); + var inInputSorted = $("#log-modules").value.split(",").sort().join(","); var presetSorted = content .presets() [presetInURL].modules.split(",") .sort() .join(","); Assert.equal( - inPageSorted, + inInputSorted, presetSorted, - "When selecting a preset via URL params, the correct log modules are reflected in the page." + "When selecting a preset via URL params, the correct log modules are reflected in the input." ); }); } diff --git a/toolkit/content/tests/browser/browser_default_audio_filename.js b/toolkit/content/tests/browser/browser_default_audio_filename.js index c32dda6878..2732c0e434 100644 --- a/toolkit/content/tests/browser/browser_default_audio_filename.js +++ b/toolkit/content/tests/browser/browser_default_audio_filename.js @@ -2,7 +2,7 @@ http://creativecommons.org/publicdomain/zero/1.0/ */ var MockFilePicker = SpecialPowers.MockFilePicker; -MockFilePicker.init(window); +MockFilePicker.init(window.browsingContext); registerCleanupFunction(function () { MockFilePicker.cleanup(); }); diff --git a/toolkit/content/tests/browser/browser_default_image_filename.js b/toolkit/content/tests/browser/browser_default_image_filename.js index 9add704664..0f7847020c 100644 --- a/toolkit/content/tests/browser/browser_default_image_filename.js +++ b/toolkit/content/tests/browser/browser_default_image_filename.js @@ -2,7 +2,7 @@ http://creativecommons.org/publicdomain/zero/1.0/ */ var MockFilePicker = SpecialPowers.MockFilePicker; -MockFilePicker.init(window); +MockFilePicker.init(window.browsingContext); const DATA_IMAGE_GIF_URL = "data:image/gif;base64,R0lGODlhEAAOALMAAOazToeHh0tLS/7LZv/0jvb29t/f3//Ub//ge8WSLf/rhf/3kdbW1mxsbP//mf///yH5BAAAAAAALAAAAAAQAA4AAARe8L1Ekyky67QZ1hLnjM5UUde0ECwLJoExKcppV0aCcGCmTIHEIUEqjgaORCMxIC6e0CcguWw6aFjsVMkkIr7g77ZKPJjPZqIyd7sJAgVGoEGv2xsBxqNgYPj/gAwXEQA7"; registerCleanupFunction(function () { diff --git a/toolkit/content/tests/browser/browser_default_image_filename_redirect.js b/toolkit/content/tests/browser/browser_default_image_filename_redirect.js index a3fdd2d19e..82926b3d44 100644 --- a/toolkit/content/tests/browser/browser_default_image_filename_redirect.js +++ b/toolkit/content/tests/browser/browser_default_image_filename_redirect.js @@ -7,7 +7,7 @@ */ let MockFilePicker = SpecialPowers.MockFilePicker; -MockFilePicker.init(window); +MockFilePicker.init(window.browsingContext); add_task(async function () { // This URL will redirect to doggy.png. const URL_FIREBIRD = diff --git a/toolkit/content/tests/browser/browser_saveImageURL.js b/toolkit/content/tests/browser/browser_saveImageURL.js index c936b8ef84..0f7bf4b117 100644 --- a/toolkit/content/tests/browser/browser_saveImageURL.js +++ b/toolkit/content/tests/browser/browser_saveImageURL.js @@ -5,7 +5,7 @@ const IMAGE_PAGE = var MockFilePicker = SpecialPowers.MockFilePicker; -MockFilePicker.init(window); +MockFilePicker.init(window.browsingContext); MockFilePicker.returnValue = MockFilePicker.returnCancel; registerCleanupFunction(function () { diff --git a/toolkit/content/tests/browser/browser_save_folder_standalone_image.js b/toolkit/content/tests/browser/browser_save_folder_standalone_image.js index ce45d04fdc..073e71a88b 100644 --- a/toolkit/content/tests/browser/browser_save_folder_standalone_image.js +++ b/toolkit/content/tests/browser/browser_save_folder_standalone_image.js @@ -43,7 +43,7 @@ async function clearHistoryAndWait() { */ let MockFilePicker = SpecialPowers.MockFilePicker; -MockFilePicker.init(window); +MockFilePicker.init(window.browsingContext); add_task(async function () { const IMAGE_URL = diff --git a/toolkit/content/tests/browser/browser_save_resend_postdata.js b/toolkit/content/tests/browser/browser_save_resend_postdata.js index 5eb1b1c904..3f3e729dab 100644 --- a/toolkit/content/tests/browser/browser_save_resend_postdata.js +++ b/toolkit/content/tests/browser/browser_save_resend_postdata.js @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var MockFilePicker = SpecialPowers.MockFilePicker; -MockFilePicker.init(window); +MockFilePicker.init(window.browsingContext); /** * Test for bug 471962 : diff --git a/toolkit/content/tests/browser/datetime/browser.toml b/toolkit/content/tests/browser/datetime/browser.toml index 6e8580ddc4..747014f386 100644 --- a/toolkit/content/tests/browser/datetime/browser.toml +++ b/toolkit/content/tests/browser/datetime/browser.toml @@ -8,8 +8,9 @@ skip-if = [ "os == 'linux' && fission && socketprocess_networking && !debug", # high frequency intermittent, Bug 1673140 ] +["browser_datetime_change_event.js"] + ["browser_datetime_datepicker.js"] -fail-if = ["a11y_checks"] # Bug 1854538 clicked td.outside may not be accessible # This file was skipped before new tests were written based on it in Bug 1676068 skip-if = [ "tsan", # Frequently times out on TSan @@ -46,7 +47,6 @@ skip-if = [ ] ["browser_datetime_datepicker_min_max.js"] -fail-if = ["a11y_checks"] # Bug 1854538 clicked TD may not be accessible skip-if = [ "tsan", # Frequently times out on TSan "os == 'win' && asan", # fails on asan @@ -61,7 +61,6 @@ skip-if = [ ] ["browser_datetime_datepicker_mousenav.js"] -fail-if = ["a11y_checks"] # Bug 1854538 clicked td.weekend.outside may not be accessible skip-if = [ "tsan", # Frequently times out on TSan "os == 'win' && asan", # fails on asan diff --git a/toolkit/content/tests/browser/datetime/browser_datetime_change_event.js b/toolkit/content/tests/browser/datetime/browser_datetime_change_event.js new file mode 100644 index 0000000000..920653778a --- /dev/null +++ b/toolkit/content/tests/browser/datetime/browser_datetime_change_event.js @@ -0,0 +1,46 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +async function open_change_and_expect_one_change_event(page) { + await helper.openPicker(page); + + let changeEventPromise = helper.promiseChange(); + + // Click the first item (top-left corner) of the calendar + helper.click(helper.getElement(DAYS_VIEW).children[0]); + await changeEventPromise; + + await helper.closePicker(); + + let changeEvents = await SpecialPowers.spawn( + gBrowser.selectedBrowser, + [], + function () { + return content.wrappedJSObject.changeEventCount; + } + ); + is(changeEvents, 1, "Should've got one change event"); + await helper.tearDown(); +} + +add_task(async function test_change_event_simple() { + await open_change_and_expect_one_change_event(`data:text/html, + + + + `); +}); + +add_task(async function test_change_event_with_mutation() { + await open_change_and_expect_one_change_event(`data:text/html, + + + + `); +}); diff --git a/toolkit/content/tests/browser/datetime/head.js b/toolkit/content/tests/browser/datetime/head.js index bbef72873c..46e2c78af5 100644 --- a/toolkit/content/tests/browser/datetime/head.js +++ b/toolkit/content/tests/browser/datetime/head.js @@ -113,15 +113,19 @@ class DateTimeTestHelper { EventUtils.synthesizeMouseAtCenter(element, {}, this.frame.contentWindow); } - /** - * Close the panel and the tab - */ - async tearDown() { + async closePicker() { if (this.panel.state != "closed") { let pickerClosePromise = this.promisePickerClosed(); this.panel.hidePopup(); await pickerClosePromise; } + } + + /** + * Close the panel and the tab + */ + async tearDown() { + await this.closePicker(); BrowserTestUtils.removeTab(this.tab); this.tab = null; } diff --git a/toolkit/content/tests/chrome/chrome.toml b/toolkit/content/tests/chrome/chrome.toml index 70fa12c4b6..3391a2923d 100644 --- a/toolkit/content/tests/chrome/chrome.toml +++ b/toolkit/content/tests/chrome/chrome.toml @@ -224,6 +224,8 @@ support-files = [ ["test_menulist_in_popup.xhtml"] +["test_menulist_initial_selection.xhtml"] + ["test_menulist_keynav.xhtml"] ["test_menulist_null_value.xhtml"] diff --git a/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml b/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml index b49f8a1d5e..005c6ebffe 100644 --- a/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml +++ b/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml @@ -57,9 +57,9 @@ function checkKeyCaretTest(key, expectedStart, expectedEnd, result, testid) keypressFired = true; } } - SpecialPowers.addSystemEventListener(window, "keypress", listener, false); + SpecialPowers.wrap(window).addEventListener("keypress", listener, { mozSystemGroup: true }); synthesizeKey(key, {}); - SpecialPowers.removeSystemEventListener(window, "keypress", listener, false); + SpecialPowers.wrap(window).removeEventListener("keypress", listener, { mozSystemGroup: true }); is(keypressFired, result, `${testid} keypress event should${result ? "" : " not"} be fired`); is(autocomplete.selectionStart, expectedStart, testid + " selectionStart"); is(autocomplete.selectionEnd, expectedEnd, testid + " selectionEnd"); diff --git a/toolkit/content/tests/chrome/test_menulist_initial_selection.xhtml b/toolkit/content/tests/chrome/test_menulist_initial_selection.xhtml new file mode 100644 index 0000000000..19e9beae67 --- /dev/null +++ b/toolkit/content/tests/chrome/test_menulist_initial_selection.xhtml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/toolkit/content/tests/chrome/window_tooltip.xhtml b/toolkit/content/tests/chrome/window_tooltip.xhtml index 6a573f0bd9..b78075de45 100644 --- a/toolkit/content/tests/chrome/window_tooltip.xhtml +++ b/toolkit/content/tests/chrome/window_tooltip.xhtml @@ -15,12 +15,12 @@ + `; + } +} +customElements.define("moz-button", MozButton); diff --git a/toolkit/content/widgets/moz-button/moz-button.stories.mjs b/toolkit/content/widgets/moz-button/moz-button.stories.mjs new file mode 100644 index 0000000000..52a459e807 --- /dev/null +++ b/toolkit/content/widgets/moz-button/moz-button.stories.mjs @@ -0,0 +1,100 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +import { html } from "../vendor/lit.all.mjs"; +// eslint-disable-next-line import/no-unassigned-import +import "./moz-button.mjs"; + +export default { + title: "UI Widgets/Moz Button", + component: "moz-button", + argTypes: { + l10nId: { + options: [ + "moz-button-labelled", + "moz-button-titled", + "moz-button-aria-labelled", + ], + control: { type: "select" }, + }, + size: { + options: ["default", "small"], + control: { type: "radio" }, + }, + }, + parameters: { + actions: { + handles: ["click"], + }, + status: "in-development", + fluent: ` +moz-button-labelled = Button +moz-button-primary = Primary +moz-button-destructive = Destructive +moz-button-titled = + .title = View logins +moz-button-aria-labelled = + .aria-label = View logins +`, + }, +}; + +const Template = ({ type, size, l10nId, iconUrl, disabled }) => html` + + +`; + +export const Default = Template.bind({}); +Default.args = { + type: "default", + size: "default", + l10nId: "moz-button-labelled", + iconUrl: "chrome://global/skin/icons/more.svg", + disabled: false, +}; +export const DefaultSmall = Template.bind({}); +DefaultSmall.args = { + type: "default", + size: "small", + l10nId: "moz-button-labelled", + iconUrl: "chrome://global/skin/icons/more.svg", + disabled: false, +}; +export const Primary = Template.bind({}); +Primary.args = { + ...Default.args, + type: "primary", + l10nId: "moz-button-primary", +}; +export const Destructive = Template.bind({}); +Destructive.args = { + ...Default.args, + type: "destructive", + l10nId: "moz-button-destructive", +}; +export const Icon = Template.bind({}); +Icon.args = { + ...Default.args, + type: "icon", + l10nId: "moz-button-titled", +}; +export const IconSmall = Template.bind({}); +IconSmall.args = { + ...Icon.args, + size: "small", +}; +export const IconGhost = Template.bind({}); +IconGhost.args = { + ...Icon.args, + type: "icon ghost", +}; diff --git a/toolkit/content/widgets/moz-input-box.js b/toolkit/content/widgets/moz-input-box.js index 4704db6dc5..6e7b7b3f29 100644 --- a/toolkit/content/widgets/moz-input-box.js +++ b/toolkit/content/widgets/moz-input-box.js @@ -92,7 +92,7 @@ }); if (this.spellcheck) { - this.menupopup.addEventListener("popuphiding", event => { + this.menupopup.addEventListener("popuphiding", () => { if (this.spellCheckerUI) { this.spellCheckerUI.clearSuggestionsFromMenu(); this.spellCheckerUI.clearDictionaryListFromMenu(); diff --git a/toolkit/content/widgets/moz-label/README.stories.md b/toolkit/content/widgets/moz-label/README.stories.md index a3492ebefa..f5e4e2dd14 100644 --- a/toolkit/content/widgets/moz-label/README.stories.md +++ b/toolkit/content/widgets/moz-label/README.stories.md @@ -3,10 +3,10 @@ `moz-label` is an extension of the built-in `HTMLLabelElement` that provides accesskey styling and formatting as well as some click handling logic. ```html story -