Notes:
- showHours could force the use of hours, and was true if the millisecond duration was >=3600000,
but inside formatTime we also end up using hours if rounded division of ms duration by 1000 and
then 3600 was non-0, so it would result in strictly more cases getting hours displayed, e.g.
a 59 minute 59 second 500ms video would get hours shown anyway. So I removed showHours.
- I consolidated attributes into markup and removed runtime initialization of the duration span
- I reorganized duration+position setting to deal with the labeling in 1 function, and a
separate function to deal with normalizing the raw ms duration/position (which can be missing
or infinity) and setting scrubber bounds and the 'modifier' prop which gets used by CSS logic.
Differential Revision: https://phabricator.services.mozilla.com/D166106
The blur is a regression from bug 1740989, but it's really uncovering a
regression from bug 1729342, sorta. Before that, we used to focus the
inner text field on rebuild via focusInnerTextBox().
One could argue that the focus fixup rule should really deal with this,
but I guess since content can't really unattach shadow DOM, it's less of
a general issue and more of an implementation detail.
The test uncovers another pre-existing issue (switching from date ->
test was also broken, and we left a bogus ElementState::FOCUS state in
the element).
Differential Revision: https://phabricator.services.mozilla.com/D158167
Provide reliable keyboard tests for Home/End and PageUp/PageDown for both month and year spinbuttons of the datepicker for `<input type=date>` and `<input type=datetime-local>`. These tests were removed from [the original Datepicker patch 4](https://phabricator.services.mozilla.com/D142743?id=654574) because of failing tests. Using reduced motion pref to utilize instant scrolling behavior to avoid failures during automatic test runs.
Depends on D165646 that implements the respect to the `prefers-reduced-motion` settings and changes the scrolling behavior from `smooth` to `instant` when the pref is on.
Differential Revision: https://phabricator.services.mozilla.com/D166378
Provides a method to scroll a spin button (month or year one, in the case of `<input type=date>` and `<input type=datetime-local>`) without smoothing, based on the user settings.
It also updates the toolkit/content/tests/browser/browser_spinner_keynav.js test to utilize reduced motion pref to avoid intermittent scrolling failing during automated tests.
Differential Revision: https://phabricator.services.mozilla.com/D165646
In `toolkit/content/tests/browser/browser_datetime_datepicker_keynav.js` replace 2 instances of `await BrowserTestUtils.waitForCondition()` with `await BrowserTestUtils.waitForMutationCondition()` per [the recommendation](https://phabricator.services.mozilla.com/D166378#anchor-inline-917416), because if possible, we should avoid polling with waitForCondition. If we're waiting for some DOM to change on us, we can use waitForMutationCondition instead, which uses a MutationObserver rather than an interval for polling.
Differential Revision: https://phabricator.services.mozilla.com/D166456
This fixes the main issue, and makes the test pass by avoiding issues with the
window sticking around after test completion, messing up future runs.
Differential Revision: https://phabricator.services.mozilla.com/D166119
lit calls `element.setAttribute("style", "<our styles>")` on first render of an
element so that it will have the style property set in the markup if it is being
server-side rendered. We don't need that, and it causes CSP errors in
about:logins so this patches out the functionality.
https://github.com/lit/rfcs/issues/13
Differential Revision: https://phabricator.services.mozilla.com/D165240
This worked pre-patch because IsOnMenu() returned true not for all
popups, but only for <menupopup>. Instead, I think it's clearer to just
treat menulists as never-inside-a-menu.
Differential Revision: https://phabricator.services.mozilla.com/D166247
Notes:
- showHours could force the use of hours, and was true if the millisecond duration was >=3600000,
but inside formatTime we also end up using hours if rounded division of ms duration by 1000 and
then 3600 was non-0, so it would result in strictly more cases getting hours displayed, e.g.
a 59 minute 59 second 500ms video would get hours shown anyway. So I removed showHours.
- I consolidated attributes into markup and removed runtime initialization of the duration span
- I reorganized duration+position setting to deal with the labeling in 1 function, and a
separate function to deal with normalizing the raw ms duration/position (which can be missing
or infinity) and setting scrubber bounds and the 'modifier' prop which gets used by CSS logic.
Differential Revision: https://phabricator.services.mozilla.com/D166106
Provides a method to scroll a spin button (month or year one, in the case of `<input type=date>` and `<input type=datetime-local>`) without smoothing, based on the user settings.
Testing: in `about:config`, set `ui.prefersReducedMotion` to `1` (effective immediately), or set `gtk-enable-animations` to `false` in GTK/GNOME, or follow [an appropriate to your OS instructions to activate Reduce Motion mode](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion#user_preferences).
Differential Revision: https://phabricator.services.mozilla.com/D165646
Move most the event handling stuff to the DOM. I've left nsMenuBarFrame
for now, but I will be removing that in the future.
The basic set up is:
* nsMenuParent becomes XULMenuParentElement (menubar or popup, manages
the current active menu item)
* nsMenuFrame -> XULButtonElements that return true for IsMenu().
Can't use XULMenuElement because of <button type=menu>, which
behaves like a, well, menu.
This makes the a11y events for menus (DOMMenuItem{Active,Inactive}) make
sense (before that we were firing duplicate Inactive events etc, and the
event order was rather suspicious).
Differential Revision: https://phabricator.services.mozilla.com/D164210
Move most the event handling stuff to the DOM. I've left nsMenuBarFrame
for now, but I will be removing that in the future.
The basic set up is:
* nsMenuParent becomes XULMenuParentElement (menubar or popup, manages
the current active menu item)
* nsMenuFrame -> XULButtonElements that return true for IsMenu().
Can't use XULMenuElement because of <button type=menu>, which
behaves like a, well, menu.
This makes the a11y events for menus (DOMMenuItem{Active,Inactive}) make
sense (before that we were firing duplicate Inactive events etc, and the
event order was rather suspicious).
Differential Revision: https://phabricator.services.mozilla.com/D164210
On platforms with scrollbar size > dropmarker width the popup is not
guaranteed to be bigger than the menulist after this patch and
bug 1805694 (given the "menu sizes to popup" behavior changed there).
Ensure the popup is sized to the menulist by widening the later.
MANUAL PUSH: Trivial test fix CLOSED TREE
This changes about:neterror to show a specific error page when the DNS failure
occurs for a TRR mode3 page load. This offers the user more information about
the failure, and some options.
This page will be further improved at a later stage when we add a better
DNS over HTTPS settings page.
The page is visible when the browser is using DNS over HTTPS without fallback
to native DNS. To achieve this the user sets `network.trr.mode` to `3` then
loads a page such as `http://nonexistant.test`.
If a top level load's channel returns NS_ERROR_UNKNOWN_HOST we look at
whether the page was indeed loaded with an effectiveTRRMode == TRRONLY
(some loads are excluded from using TRR).
When that is true, we present the error page allowing the user to retry,
exclude the domain from TRR, or open the settings page.
Note: This initial implementation will not work if the
`network.dns.disablePrefetch` pref is set to true. In that case nsHttpChannel
does not get an OnLookupComplete callback, so it doesn't have the
effectiveTRRMode and trrSkipReason. This will be fixed in bug 1805372.
Project plan: https://docs.google.com/document/d/12IGABt1eXI276qHduXXbVZqRFrhLN7Ad3gKEgxz81sE
Copy deck: https://docs.google.com/document/d/130UTox8bQbybjYIwvltR4qBg2hWjsGhuNUHypLwUAEQ
Depends on D164642
Differential Revision: https://phabricator.services.mozilla.com/D164347
This changes about:neterror to show a specific error page when the DNS failure
occurs for a TRR mode3 page load. This offers the user more information about
the failure, and some options.
This page will be further improved at a later stage when we add a better
DNS over HTTPS settings page.
The page is visible when the browser is using DNS over HTTPS without fallback
to native DNS. To achieve this the user sets `network.trr.mode` to `3` then
loads a page such as `http://nonexistant.test`.
If a top level load's channel returns NS_ERROR_UNKNOWN_HOST we look at
whether the page was indeed loaded with an effectiveTRRMode == TRRONLY
(some loads are excluded from using TRR).
When that is true, we present the error page allowing the user to retry,
exclude the domain from TRR, or open the settings page.
Note: This initial implementation will not work if the
`network.dns.disablePrefetch` pref is set to true. In that case nsHttpChannel
does not get an OnLookupComplete callback, so it doesn't have the
effectiveTRRMode and trrSkipReason. This will be fixed in bug 1805372.
Project plan: https://docs.google.com/document/d/12IGABt1eXI276qHduXXbVZqRFrhLN7Ad3gKEgxz81sE
Copy deck: https://docs.google.com/document/d/130UTox8bQbybjYIwvltR4qBg2hWjsGhuNUHypLwUAEQ
Depends on D164642
Differential Revision: https://phabricator.services.mozilla.com/D164347
This changes about:neterror to show a specific error page when the DNS failure
occurs for a TRR mode3 page load. This offers the user more information about
the failure, and some options.
This page will be further improved at a later stage when we add a better
DNS over HTTPS settings page.
The page is visible when the browser is using DNS over HTTPS without fallback
to native DNS. To achieve this the user sets `network.trr.mode` to `3` then
loads a page such as `http://nonexistant.test`.
If a top level load's channel returns NS_ERROR_UNKNOWN_HOST we look at
whether the page was indeed loaded with an effectiveTRRMode == TRRONLY
(some loads are excluded from using TRR).
When that is true, we present the error page allowing the user to retry,
exclude the domain from TRR, or open the settings page.
Note: This initial implementation will not work if the
`network.dns.disablePrefetch` pref is set to true. In that case nsHttpChannel
does not get an OnLookupComplete callback, so it doesn't have the
effectiveTRRMode and trrSkipReason. This will be fixed in bug 1805372.
Project plan: https://docs.google.com/document/d/12IGABt1eXI276qHduXXbVZqRFrhLN7Ad3gKEgxz81sE
Copy deck: https://docs.google.com/document/d/130UTox8bQbybjYIwvltR4qBg2hWjsGhuNUHypLwUAEQ
Depends on D164642
Differential Revision: https://phabricator.services.mozilla.com/D164347
Add a check that the focus returned to the input field and that the Calendar button is focused (when a picker was activated by this button before closing).
Differential Revision: https://phabricator.services.mozilla.com/D165233
For `<input type=date>` and `<input type=datetime-local>`, when a month-year selection dialog is opened from the datepicker/calendar dialog, `Escape` now would only close the month-year selection panel and would keep the datepicker open, returning the focus to the focusable day/gridcell on the calendar grid.
Differential Revision: https://phabricator.services.mozilla.com/D165117
When scrollbar caching is enabled this worked kinda by chance via the
-moz-box-layout: initial declaration there.
Make it work independently of the scrollbar caching pref.
Differential Revision: https://phabricator.services.mozilla.com/D164893
This patch changes our toggle implementation to use a button under the hood, rather than a checkbox input. This was done for a couple of reasons:
* We expect clicking on the toggle to have an immediate effect, rather than only resulting in a change after some secondary action like submitting a form.
* We don't currently use or support an indeterminate/mixed state. Our toggles only ever have two states - like on/off.
* Places toggles are currently used in the code tend to be relying on click events rather than change events
I kept the `role="switch"` and `aria-checked` aspects of the implementation because this sounded like what we're trying to build: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Switch_role
I played around with using `aria-pressed`, which effectively turns a button into a toggle button: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-pressed
This had no effect when used together with `role="switch"` and `aria-checked`, so I removed it. If we think just using `aria-pressed` seems more accurate I could switch to that.
Differential Revision: https://phabricator.services.mozilla.com/D164465
Space bar should have identical behavior as the Enter key it should close the month-year selection panel, returning the focus to the focusable grid cell on the calendar (a day). Closing the entire panel would also suffice, because technically the panel with spinners replaces the calendar panel.
Differential Revision: https://phabricator.services.mozilla.com/D164623
I decided to split this up from bug 1805414 because it's only
tangentially related to the removal of nsMenuFrame.
We have this sizetopopup attribute and behavior that allows menulists to
be sized to the contents of the popup. The popup also expands to the
menulist rect.
This means that layout is by somewhat cyclic and we need to go out of
our way to support it. However, I think we only care about the first
behavior. We don't have many non-intrinsically-sized menulists, and
if we need we can use HTML <select> instead, which does have that
behavior.
Simplify the setup to make sizetopopup only apply to menulists (we don't
have non-menulist usage anyways), and only work in the "popup depends on
the menulist" direction, not the other way around.
This will allow making the popup a regular out-of-flow element. The
change to test_menulist_paging is not needed (I restored the behavior of
eagerly layout menulists, to fix the <select> popup, but I'd like to fix
that eventually, so I'd rather leave them in, they're harmless).
Differential Revision: https://phabricator.services.mozilla.com/D164693
It looks like hostname is sometimes undefined, which triggers a Fluent error.
The HOST_NAME is determined from location.href,
and falls back to an empty string value about which Fluent is much happier.
Differential Revision: https://phabricator.services.mozilla.com/D164538
My guess is that it was done using shadows to not interfere with the
native look, but actually this just works even with native-looking menus
(like the <select> menulist), because the background-color for those is
set on the menupopup, rather than the ::part(content).
So those have effectively 1px of extra padding (due to the transparent
border), but that seems barely perceptible, and worth the consistency
and simplification.
Differential Revision: https://phabricator.services.mozilla.com/D164716