Commit Graph

11186 Commits

Author SHA1 Message Date
Dão Gottwald
1c9dd74f04 Bug 1905311 - Move / remove the rest of browser/base/content/browser.css. r=desktop-theme-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D215190
2024-07-01 09:27:17 +00:00
James Teh
154b408813 Bug 1905021: Don't incorrectly treat the start of a node inside a contentEditable as the end of a line. r=nlapre
Previously, we assumed that CaretAssociationHint::Before always meant the caret was at the insertion point at the end of a line.
However, it can also mean that the caret is before the start of a node in the middle of a line.
To fix this, we need to check for line and paragraph boundaries.
See the code comments for details.

I moved this functionality completely out of HyperTextAccessible and into TextLeafPoint.
First, it was easiest to do these checks with private functions already available to TextLeafPoint.
Second, this ideally belongs in TextLeafPoint anyway; its existence in HyperTextAccessible was vestigial.

Differential Revision: https://phabricator.services.mozilla.com/D215089
2024-07-01 06:24:13 +00:00
acseh
e74b86533c Backed out changeset a5ff95602119 (bug 1905021) as requested for causing accessibility crashes related to selection a=backout 2024-07-01 00:35:00 +03:00
James Teh
d8571e7f91 Bug 1905065: Add test. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D215179
2024-06-28 23:31:05 +00:00
James Teh
08e5d9edbe Bug 1905021: Don't incorrectly treat the start of a node inside a contentEditable as the end of a line. r=nlapre
Previously, we assumed that CaretAssociationHint::Before always meant the caret was at the insertion point at the end of a line.
However, it can also mean that the caret is before the start of a node in the middle of a line.
To fix this, we need to check for line and paragraph boundaries.
See the code comments for details.

I moved this functionality completely out of HyperTextAccessible and into TextLeafPoint.
First, it was easiest to do these checks with private functions already available to TextLeafPoint.
Second, this ideally belongs in TextLeafPoint anyway; its existence in HyperTextAccessible was vestigial.

Differential Revision: https://phabricator.services.mozilla.com/D215089
2024-06-28 23:30:08 +00:00
James Teh
c3b181bc19 Bug 1901457 part 6: Raise UIA Text TextSelectionChanged and TextChanged events. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D214346
2024-06-26 10:15:45 +00:00
James Teh
83137ab39e Bug 1901457 part 5: Implement ITextProvider::GetSelection. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D214345
2024-06-26 10:15:45 +00:00
James Teh
82324325a3 Bug 1901457 part 4: Implement ITextProvider::get_SupportedTextSelection. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D214344
2024-06-26 10:15:44 +00:00
James Teh
89e51400b5 Bug 1901457 part 3: Add a way to get text selection as TextLeafRanges. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D214343
2024-06-26 10:15:44 +00:00
James Teh
d8a12f0303 Bug 1901457 part 2: Refactor TextLeafPoint caret retrieval so that the end of line insertion point can be stored without being tied to the current caret position. r=nlapre
Previously, TextLeafPoint::GetCaret() returned a placeholder representation of the caret.
ActualizeCaret() was then used to get the real caret position, optionally adjusting for the line end depending on the caller's needs.
This causes problems when we need to store the TextLeafPoint information in a UIA text range object because the only way to indicate the line end insertion point is to use the GetCaret() placeholder, but that also means the stored position changes if the caret moves.
For example, if you disabled NVDA's "caret moves review cursor" setting and then moved the caret, the review cursor should stay at the old position, but it didn't previously.

To fix this:

1. TextLeafPoint now has a new mIsEndOfLineInsertionPoint flag which is set to true by GetCaret() if appropriate.
2. GetCaret() sets mAcc and mOffset immediately, rather than needing to call ActualizeCaret() later.
3. TextLeafPoint methods still need to adjust the point to correctly handle the line end insertion point in some cases, but that is now handled by the private TextLeafPoint::AdjustEndOfLine method.
4. FindBoundary now correctly returns the previous character/cluster when requested for this end of line insertion point. Strictly speaking, this bug always existed, but no existing callers ever triggered it.

Differential Revision: https://phabricator.services.mozilla.com/D214342
2024-06-26 10:15:43 +00:00
James Teh
9b513e46b8 Bug 1901457 part 1: When a caret is at the end of a line, have TextLeafPoint::FindBoundary return no character for BOUNDARY_CLUSTER. r=nlapre
We already did this for BOUNDARY_CHAR, but i neglected to update this for cluster in bug 855184.
Without this, FindBoundary with BOUNDARY_CLUSTER on a caret TextLeafPoint when the caret is at the end of a line would return the last cluster instead of no character.

Differential Revision: https://phabricator.services.mozilla.com/D214341
2024-06-26 10:15:43 +00:00
James Teh
470cf7c89f Bug 1901456 part 6: Implement ITextRangeProvider Clone, Compare, CompareEndpoints, ExpandToEnclosingUnit, Move, MoveEndpointByRange AND MoveEndpointByUnit methods. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D214225
2024-06-26 02:03:39 +00:00
James Teh
5dee144317 Bug 1901456 part 5: Provide a way to safely get a TextLeafRange from an ITextRangeProvider pointer provided by a client. r=nlapre
This will be needed for the Compare, CompareEndpoints and MoveEndpointByRange methods.

Differential Revision: https://phabricator.services.mozilla.com/D214224
2024-06-26 02:03:38 +00:00
James Teh
212b9b7518 Bug 1901456 part 4: Implement ITextRangeProvider::GetText. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D214223
2024-06-26 02:03:38 +00:00
James Teh
59796e9178 Bug 1901456 part 3: Implement ITextProvider::get_DocumentRange for editable text controls, with stubs for the other ITextProvider methods. r=nlapre
Unfortunately, this can't be usefully tested without implementing another method, so tests will come in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D214222
2024-06-26 02:03:38 +00:00
James Teh
4761cf95fb Bug 1901456 part 2: Store and reconstitute the TextLeafRange in UiaTextRange using MsaaAccessible strong references. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D214221
2024-06-26 02:03:37 +00:00
James Teh
73aa7d3a46 Bug 1901456 part 1: Add stub ITextRangeProvider implementation. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D214220
2024-06-26 02:03:36 +00:00
Morgan Rae Reschenberg
edd342a116 Bug 1888310: Verify a11y-announcement is a child of ChildView instead of mozRootAccessible r=eeejay
Previously we checked if the announcement was a child of the root acc directly, but it's not clear this worked reliably since we've done `GetObjectOrRepresentedView` for a while, which (should) return the view instead of the root acc. This patch also:
- Dispatches the announcement from NSApp instead of NSWindow, since per chrome and safari notifs fired on non-main windows get dropped
- Modifies the announcement priority from medium to high, so VO interrupts itself to speak this message (this makes the UX more consistent, since the text-inserted/text-deleted notifs from the URL bar seem to occasionally bookend the announcement)
- Updates the browser_app.js test to NOT run in headless mode, since in headless mode NSApp isn't rendered to dispatch the notification. This test contains a task for AXAnnouncementRequested via a11yUtils.announce

Differential Revision: https://phabricator.services.mozilla.com/D206083
2024-06-25 23:06:08 +00:00
Nathan LaPre
9162c8ef57 Bug 1903713: Avoid static nsTHashSet constructor via instance method, r=Jamie
This revision avoids static construction of the nsTHashSet by hiding the set
behind an instance method.

Differential Revision: https://phabricator.services.mozilla.com/D214664
2024-06-24 22:52:21 +00:00
Oliver Medhurst
a3c3d074ca Bug 1877969 - Consume user activation when showing any picker r=dom-core,edgar,geckoview-reviewers,m_kato
Consume transient user activation when showing file/color picker
at any time. Do not open if there is no transent user activation.

Fixed various internal tests broken by this change.

Spec PR: https://github.com/whatwg/html/pull/10344

Differential Revision: https://phabricator.services.mozilla.com/D201096
2024-06-24 10:53:24 +00:00
Cristian Tuns
c6e6389cac Backed out changeset 46970b1c1903 (bug 1877969) for causing xpcshell failures in test_bug1086684.js CLOSED TREE 2024-06-21 11:48:23 -04:00
Oliver Medhurst
c5514c6485 Bug 1877969 - Consume user activation when showing any picker r=dom-core,edgar,geckoview-reviewers,m_kato
Consume transient user activation when showing file/color picker
at any time. Do not open if there is no transent user activation.

Fixed various internal tests broken by this change.

Spec PR: https://github.com/whatwg/html/pull/10344

Differential Revision: https://phabricator.services.mozilla.com/D201096
2024-06-21 14:17:22 +00:00
Masayuki Nakano
d835b38b9f Bug 1675847 - part 5: Make contextmenu event dispatchers use WidgetPointerEvent or PointerEvent r=smaug,pip-reviewers,devtools-reviewers,nchevobbe,mconley
`eContextMenu` event may be fired from `widget`.  Therefore, different from
`ePointerClick` and `ePointerAuxClick`, they may cross the process boundary,
may be handled by APZ and may be dispatched into the DOM after a delay.
Therefore, this patch is complicated than the previous patch.  This adds
* New IPC message handlers for sending/receiving a `WidgetPointerEvent`
* New `DelayedPointerEvent` class and templated `MouseInput::ToWidgetEvent`
* `PresShell::EventHandler` handles `eContextMenu` as same as `WidgetMouseEvent`

Differential Revision: https://phabricator.services.mozilla.com/D213003
2024-06-14 00:18:48 +00:00
Morgan Rae Reschenberg
8c415c1069 Bug 1901853: Update <dd> and <dl> roles to match spec for VO r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D213280
2024-06-13 19:47:05 +00:00
James Teh
808f8aaefd Bug 1901676: Set lastParent and lastParentID in DocAccessibleParent::RecvShowEvent. r=eeejay
In bug 1779578, I changed the way a11y trees are serialised such that the parent id is included for each Accessible.
When de-serialising in DocAccessibleParent::RecvShowEvent, in order to avoid a theoretical performance regression caused by repeatedly looking up the same parent, I added an optimisation to use the last parent if it is the same as the current parent.
Unfortunately, it seems I never actually set the lastParent and lastParentID variables, so this optimisation was a no-op!

This is a micro-optimisation: it doesn't seem to make any observable difference.
However, it seems silly to have effectively dead code and it's a very straightforward fix.

Differential Revision: https://phabricator.services.mozilla.com/D213177
2024-06-12 00:56:29 +00:00
Eitan Isaacson
2bbd949eff Bug 1678712 - Support AXLangauge. r=morgan
The important part here is to have the text leafs inherit their parents' language.

Differential Revision: https://phabricator.services.mozilla.com/D212604
2024-06-11 19:41:20 +00:00
James Teh
c73ce972ef Bug 1813976: Support RemoteAccessible::Language on non-HyperText Accessibles. r=morgan
1. HyperTextAccessibles already cache language and RemoteAccessible::Language uses this.
2. Previously, we didn't cache language for a non-text, non-HyperText Accessible at all. This includes images and HTML radio buttons. Now we cache it as a top level attribute in this case and return it in RemoteAccessible::Language.
3. We previously cached language for a text (leaf) Accessible where the language differed from its parent, but we never used this in RemoteAccessible::Language, only when calculating text attributes. Now we use it in RemoteAccessible::Language as well.
4. Where a text (leaf) Accessible's language is the same as its parent, RemoteAccessible::Language now gets this from the parent.

Differential Revision: https://phabricator.services.mozilla.com/D212503
2024-06-05 23:51:11 +00:00
Sandor Molnar
5c4d387874 Backed out changeset 718208a40b89 (bug 1888310) for causing mochitest failures @ browser_app.js CLOSED TREE 2024-06-05 00:43:46 +03:00
Morgan Rae Reschenberg
4e0ffe1a17 Bug 1888310: Verify a11y-announcement is a child of ChildView instead of mozRootAccessible r=eeejay
Previously we checked if the announcement was a child of the root acc directly, but it's not clear this worked reliably since we've done `GetObjectOrRepresentedView` for a while, which (should) return the view instead of the root acc. This patch also:
- Dispatches the announcement from NSApp instead of NSWindow, since per chrome and safari notifs fired on non-main windows get dropped
- Modifies the announcement priority from medium to high, so VO interrupts itself to speak this message (this makes the UX more consistent, since the text-inserted/text-deleted notifs from the URL bar seem to occasionally bookend the announcement)
- Updates the browser_app.js test to NOT run in headless mode, since in headless mode NSApp isn't rendered to dispatch the notification. This test contains a task for AXAnnouncementRequested via a11yUtils.announce

Differential Revision: https://phabricator.services.mozilla.com/D206083
2024-06-04 20:42:45 +00:00
James Teh
6ffc34fe0a Bug 855184 part 2: Map IA2_TEXT_BOUNDARY_CHAR to cluster. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D212536
2024-06-04 20:36:42 +00:00
James Teh
3b3a1815ea Bug 855184 part 1: Add BOUNDARY_CLUSTER so a11y can query grapheme clusters, AKA user-perceived characters. r=eeejay
Most OS APIs want a cluster when they ask for a "character", except ATK.
Rather than altering BOUNDARY_CHAR, I added a new BOUNDARY_CLUSTER.
Aside from being less risky and causing less churn, there are cases internally where we want to move a TextLeafPoint by character; e.g. to explicitly move to the next/previous Accessible or to move to the next/previous character in an abstract way without worrying about Accessible boundaries.
Calculating clusters is more expensive, so it doesn't make sense to move by cluster in those cases.

Differential Revision: https://phabricator.services.mozilla.com/D212517
2024-06-04 20:36:42 +00:00
Moritz Beier
47de7bd820 Bug 1610530 - Use classes instead of ids to access urlbar elements from UrlbarInput. r=dao,webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D212095
2024-06-04 12:58:52 +00:00
James Teh
5c6a8e23d4 Bug 1900287: Grudgingly refactor GetUiaClientPidsWin11 into a class to make MinGW happy. r=nlapre
In order to keep all of the tragic implementation detail for this function in a single class, I originally put the structs and the thread proc inside the function.
The thread proc was implemented as a lambda which implicitly converts to a function pointer.
Unfortunately, it seems MinGW can't implicitly convert this lambda to a function with the stdcall calling convention.
This is why we can't have nice things.
To deal with this, refactor it into a class so that we can define the thread proc as a static function instead of a lambda.
All of the methods are static; the class is just used to contain the implementation details.

Differential Revision: https://phabricator.services.mozilla.com/D212391
2024-06-03 21:30:17 +00:00
James Teh
01bf6473f9 Bug 1899211: When detecting UIA clients, query the pid of named pipes in another thread to avoid hangs. r=nlapre
Querying some pipe handles can cause a hang and there is no way to prevent this other than terminating the thread.
See the discussion on the bug for more details and research.
Therefore, query the pipes in another thread.
If the thread takes too long, terminate it and resume querying other handles in another thread.

Differential Revision: https://phabricator.services.mozilla.com/D212088
2024-06-03 00:58:57 +00:00
Sandor Molnar
44cb202bdf Backed out changeset 29e984633f5e (bug 1888310) for causing mochitest failures @ accessible/tests/browser/mac/browser_app.js CLOSED TREE 2024-05-31 00:47:54 +03:00
Morgan Rae Reschenberg
9a72ddca2b Bug 1888310: Verify a11y-announcement is a child of ChildView instead of mozRootAccessible r=eeejay
Previously we checked if the announcement was a child of the root acc directly, but it's not clear this worked reliably since we've done `GetObjectOrRepresentedView` for a while, which (should) return the view instead of the root acc. This patch also:
- Dispatches the announcement from NSApp instead of NSWindow, since per chrome and safari notifs fired on non-main windows get dropped
- Modifies the announcement priority from medium to high, so VO interrupts itself to speak this message (this makes the UX more consistent, since the text-inserted/text-deleted notifs from the URL bar seem to occasionally bookend the announcement)
- Updates the browser_app.js test to NOT run in headless mode, since in headless mode NSApp isn't rendered to dispatch the notification. This test contains a task for AXAnnouncementRequested via a11yUtils.announce

Differential Revision: https://phabricator.services.mozilla.com/D206083
2024-05-30 21:01:20 +00:00
Ting-Yu Lin
8016adbafa Bug 1896516 Part 8 - Remove nsIScrollableFrame usages under accessible/. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211495
2024-05-30 06:32:20 +00:00
Ting-Yu Lin
6306934820 Bug 1896516 Part 7 - Remove PresShell::GetRootScrollFrameAsScrollable(). r=layout-reviewers,emilio
`PresShell::GetRootScrollFrameAsScrollable()` is equivalent to
`PresShell::GetRootScrollContainerFrame()`.

In ScrollContainerFrame.h, `DecideScrollableLayer()` has two versions, one has
four parameters, and the other has five parameters with the fifth parameter
`aDirtyRectHasBeenOverriden` having a default value `nullptr`. When we switch
the caller from `nsIScrollableFrame` to `ScrollContainerFrame`, we need to
remove the default value for the fifth parameter to avoid ambiguity.

Differential Revision: https://phabricator.services.mozilla.com/D211494
2024-05-30 06:32:20 +00:00
Ting-Yu Lin
df8ff2d9ac Bug 1896516 Part 3 - Change GetScrollTargetFrame() to return ScrollContainerFrame. r=layout-reviewers,emilio
Also, simplify some callers of `GetScrollTargetFrame()` to drop
`nsIScrollableFrame*` and unnecessary `do_QueryFrame`. We'll continue removing
more `nsIScrollableFrame*` in later parts.

Differential Revision: https://phabricator.services.mozilla.com/D211490
2024-05-30 06:32:18 +00:00
Sebastian Hengst
ccb101be8f Backed out 15 changesets (bug 1896516) for causing scrolling crashes on macOS. a=backout
Backed out changeset fd6904338812 (bug 1896516)
Backed out changeset 2977ff81a23e (bug 1896516)
Backed out changeset c8a6b0e526d6 (bug 1896516)
Backed out changeset 3c06f22da72b (bug 1896516)
Backed out changeset f63b0c4335fe (bug 1896516)
Backed out changeset 6f7ab8adfa6e (bug 1896516)
Backed out changeset 997c9249dbed (bug 1896516)
Backed out changeset c964fccd5180 (bug 1896516)
Backed out changeset 7b481b747b7a (bug 1896516)
Backed out changeset 42e1bbe0ecb6 (bug 1896516)
Backed out changeset 717dac08b607 (bug 1896516)
Backed out changeset 2f0817331dbe (bug 1896516)
Backed out changeset b765169a7a8f (bug 1896516)
Backed out changeset a2d37b98273c (bug 1896516)
Backed out changeset ea9ecb543e66 (bug 1896516)
2024-05-29 11:22:52 +02:00
James Teh
84c3f34421 Bug 1896367: Use changes to ElementState::DISABLED to detect HTML disabled state changes. r=eeejay
Previously, we listened for changes to the disabled attribute itself.
However, this doesn't handle the case that the disabled state is inherited from a fieldset ancestor.
In contrast, DOM notifies us about changes to ElementState::DISABLED on form control descendants when a fieldset gains or loses the disabled attribute.

Differential Revision: https://phabricator.services.mozilla.com/D211688
2024-05-29 05:59:57 +00:00
Eitan Isaacson
2315714492 Bug 1875629 - Add AXContents to outer docs (scroll areas). r=morgan
Without this attribute VoiceOver gets into an unstable state when the cursor or focus
leaves the document.

Differential Revision: https://phabricator.services.mozilla.com/D211617
2024-05-28 20:52:51 +00:00
Ting-Yu Lin
84637bc68a Bug 1896875 - Destroy line list and the frames in reverse order to avoid non-linear time complexity. r=layout-reviewers,eeejay,emilio
This patch is similar to
https://hg.mozilla.org/mozilla-central/rev/e8114275db22

We destroy the line list and the frames in reverse order to avoid unnecessary
first-in-flow and first-continuation cache update.

Differential Revision: https://phabricator.services.mozilla.com/D211681
2024-05-28 16:53:23 +00:00
Ting-Yu Lin
83578c4adb Bug 1896516 Part 8 - Remove nsIScrollableFrame usages under accessible/. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211495
2024-05-28 04:46:19 +00:00
Ting-Yu Lin
9ab65dbb68 Bug 1896516 Part 7 - Remove PresShell::GetRootScrollFrameAsScrollable(). r=layout-reviewers,emilio
`PresShell::GetRootScrollFrameAsScrollable()` is equivalent to
`PresShell::GetRootScrollContainerFrame()`.

In ScrollContainerFrame.h, `DecideScrollableLayer()` has two versions, one has
four parameters, and the other has five parameters with the fifth parameter
`aDirtyRectHasBeenOverriden` having a default value `nullptr`. When we switch
the caller from `nsIScrollableFrame` to `ScrollContainerFrame`, we need to
remove the default value for the fifth parameter to avoid ambiguity.

Differential Revision: https://phabricator.services.mozilla.com/D211494
2024-05-28 04:46:19 +00:00
Ting-Yu Lin
9a9b18c0b6 Bug 1896516 Part 3 - Change GetScrollTargetFrame() to return ScrollContainerFrame. r=layout-reviewers,emilio
Also, simplify some callers of `GetScrollTargetFrame()` to drop
`nsIScrollableFrame*` and unnecessary `do_QueryFrame`. We'll continue removing
more `nsIScrollableFrame*` in later parts.

Differential Revision: https://phabricator.services.mozilla.com/D211490
2024-05-28 04:46:17 +00:00
James Teh
ad246a46f8 Bug 1897597 part 2: Don't treat bidi split continuations as line breaks. r=morgan
Continuations occur when text wraps onto a new line (fluid continuations), but they also occur when the text direction changes (non-fluid continuations).
Previously, TextLeafRange assumed that all continuations were line breaks.
Now, we explicitly treat fluid continuations as line breaks.
It's also possible for a non-fluid continuation to be on a different line if the text direction changes between the end of the previous line and the start of another.
In that case, we must use a line iterator to check whether they are on different lines.

Differential Revision: https://phabricator.services.mozilla.com/D210893
2024-05-27 06:21:04 +00:00
James Teh
b8d61523d1 Bug 1897597 part 1: Split TextLeafRange code to check whether frames are on different lines into a separate function. r=morgan
There should be no functional change here.
However, we're going to need to reuse this elsewhere in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D210986
2024-05-27 06:21:03 +00:00
James Teh
f0250b65b5 Bug 1898198: Fix RemoteAccessible::TakeFocus when the browser UI has focus. r=eeejay
Previously, this didn't move the focus at all in this case.

Differential Revision: https://phabricator.services.mozilla.com/D211314
2024-05-26 21:50:29 +00:00
Eitan Isaacson
3357f914c8 Bug 1895551 - Remove aria attribute from ElementInternals when set to null. r=Jamie,dom-core,edgar
Differential Revision: https://phabricator.services.mozilla.com/D209721
2024-05-24 22:37:12 +00:00