Commit Graph

10148 Commits

Author SHA1 Message Date
Mark Banner
8a275d4d92 Bug 1780017 - Migrate urlbar consumers to use ESM imports directly. r=adw,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D152057
2022-07-26 15:11:30 +00:00
Emilio Cobos Álvarez
42b7f1a58c Bug 1780788 - Use abstract strings as in-arguments for ipdl. r=nika,necko-reviewers,media-playback-reviewers,alwu,dragana
This prevents copies and avoids the hack we have to avoid this, which
right now is using nsDependent{C,}String.

Non-virtual actors can still use `nsString` if they need to on the
receiving end.

Differential Revision: https://phabricator.services.mozilla.com/D152519
2022-07-25 20:19:48 +00:00
smolnar
dc4f2d6a41 Backed out 5 changesets (bug 1780017, bug 1780347) for causing bc failures in browser/base/content/test/performance/browser_preferences_usage.js CLOSED TREE
Backed out changeset 86c3a9142535 (bug 1780347)
Backed out changeset 35abe35417a0 (bug 1780017)
Backed out changeset f448f044f028 (bug 1780017)
Backed out changeset a400cbe83084 (bug 1780017)
Backed out changeset 0a23c9e27f01 (bug 1780017)
2022-07-25 21:00:07 +03:00
Mike Conley
90013f044d Bug 1779516 - Make sure input / change events fire for range elements when changing their value via the a11y API. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D151847
2022-07-25 16:38:31 +00:00
Mark Banner
539b5dac0d Bug 1780017 - Migrate urlbar consumers to use ESM imports directly. r=adw,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D152057
2022-07-25 12:46:48 +00:00
Andreea Pavel
8d57d5a509 Bug 1779541 - change disabling condition for specific mac versions r=jmaher DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D152611
2022-07-25 03:25:03 +00:00
James Teh
bb8a4b5e7e Bug 1779975: Check whether a LocalAccessible has its own content before trying to get MarkupMapInfo from it. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D152254
2022-07-22 00:05:21 +00:00
Neia Finch
034d8039a6 Bug 1645904 - Fix swapped parameters for nsIAccessibleVirtualCursorChangeEvent r=eeejay
The fields are unused, but there's no reason to propagate them
incorrectly.

Differential Revision: https://phabricator.services.mozilla.com/D134907
2022-07-21 16:59:49 +00:00
Eitan Isaacson
f3cd181291 Bug 1778585 - Don't register non-top-level accessibles if there is no top-level regeistered. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D152328
2022-07-21 16:57:04 +00:00
Cosmin Sabou
31deb146e7 Bug 1779541 - disable browser_caching_actions.js on macOS opt due to permafailures. r=intermittent-reviewers,MasterWayZ DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D152334
2022-07-21 00:50:50 +00:00
Mark Banner
4bfafd41fa Bug 1779982 - Migrate places consumers to use ESM imports directly. r=mak,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D152005
2022-07-20 22:34:21 +00:00
smolnar
102b779608 Backed out 8 changesets (bug 1779982, bug 1780017, bug 1780347) for causing doc generate failures. CLOSED TREE
Backed out changeset 3f22c0f99cf1 (bug 1780347)
Backed out changeset 6f20b7e4b21b (bug 1780017)
Backed out changeset ae6062c69aeb (bug 1780017)
Backed out changeset e668d7778d97 (bug 1780017)
Backed out changeset e158fc41594b (bug 1780017)
Backed out changeset d4c69c956271 (bug 1779982)
Backed out changeset 145212fd826d (bug 1779982)
Backed out changeset 54079aaa1857 (bug 1779982)
2022-07-20 22:43:53 +03:00
Emilio Cobos Álvarez
92c9ff22dc Bug 1780385 - Remove canvas hit region api. r=jrmuizel
Add a pref for MouseEvent.region since that wasn't un-exposed. No other
browser supports it so we can probably safely remove it, but just in
case.

Differential Revision: https://phabricator.services.mozilla.com/D152274
2022-07-20 16:52:47 +00:00
Mark Banner
fd37e0e9da Bug 1780017 - Migrate urlbar consumers to use ESM imports directly. r=adw,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D152057
2022-07-20 15:50:42 +00:00
Mark Banner
23086da9b9 Bug 1779982 - Migrate places consumers to use ESM imports directly. r=mak,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D152005
2022-07-20 15:50:40 +00:00
Iulian Moraru
1108246986 Backed out 7 changesets (bug 1779982, bug 1780017) for causing multiple failures. CLOSED TREE
Backed out changeset f33a58aa2f3f (bug 1780017)
Backed out changeset e21c85d61b91 (bug 1780017)
Backed out changeset 213ee5578e7c (bug 1780017)
Backed out changeset ea9b3bf42ea1 (bug 1780017)
Backed out changeset d2d8530f3c4d (bug 1779982)
Backed out changeset 088e5148c307 (bug 1779982)
Backed out changeset 267e08f3868a (bug 1779982)
2022-07-20 15:44:53 +03:00
Mark Banner
ac90e83952 Bug 1780017 - Migrate urlbar consumers to use ESM imports directly. r=adw,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D152057
2022-07-20 10:36:51 +00:00
Mark Banner
e84aaa1b85 Bug 1779982 - Migrate places consumers to use ESM imports directly. r=mak,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D152005
2022-07-20 10:36:49 +00:00
Morgan Reschenberg
e8b96a564c Bug 1778550: Trim whitespace on mozAcc titles, prune empty mozTextLeafAccs from tree r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D151328
2022-07-18 15:48:17 +00:00
James Teh
6c7598c3fe Bug 1772050: Don't call Attributes() in Android's HandleLiveRegionEvent. r=eeejay
Attributes() might do computation that we'll just throw away; e.g. building a CachedTableAccessible.
In a content process, cached data structures like this will never get used by a client, so building them will always be wasteful.
Instead, use nsAccUtils::SetLiveContainerAttributes, which only computes live region stuff.

Differential Revision: https://phabricator.services.mozilla.com/D151799
2022-07-14 21:58:37 +00:00
Andrew Osmond
a9049b5248 Bug 1779519 - gfxFontCache expiration tracker operations should be more atomic. r=jfkthame
gfxFontCache acquires and releases its mutex during various operations.
In order to keep the state internally consistent, we should only release
the lock after the full operation is complete. This involves moving the
deletion of gfxFont to outside the lock via a temporary discard array.

The expiration state should not be protected by the gfxFont's mutex
since we don't hold it during most operations. Instead we should hold
gfxFontCache's mutex because then we can guarantee the operation is
atomic, particularly when a worker wants a font, and the main thread is
aging the generations.

When a font is returned from gfxFontCache, we now return it already
removed from the tracker, and with its refcount updated. This avoids any
potential races between the expiration timer and a worker accessing the
font, as well as simplying the callers so they don't need to be aware of
addref-ing manually in case the result is to be discarded (so that it
gets readded to the tracker).

Differential Revision: https://phabricator.services.mozilla.com/D151821
2022-07-14 19:53:09 +00:00
criss
ba063e13c6 Backed out changeset e4cd98b5984d (bug 1779519) for causing build bustages. CLOSED TREE 2022-07-14 22:06:53 +03:00
Andrew Osmond
9f767ee84a Bug 1779519 - gfxFontCache expiration tracker operations should be more atomic. r=jfkthame
gfxFontCache acquires and releases its mutex during various operations.
In order to keep the state internally consistent, we should only release
the lock after the full operation is complete. This involves moving the
deletion of gfxFont to outside the lock via a temporary discard array.

The expiration state should not be protected by the gfxFont's mutex
since we don't hold it during most operations. Instead we should hold
gfxFontCache's mutex because then we can guarantee the operation is
atomic, particularly when a worker wants a font, and the main thread is
aging the generations.

When a font is returned from gfxFontCache, we now return it already
removed from the tracker, and with its refcount updated. This avoids any
potential races between the expiration timer and a worker accessing the
font, as well as simplying the callers so they don't need to be aware of
addref-ing manually in case the result is to be discarded (so that it
gets readded to the tracker).

Differential Revision: https://phabricator.services.mozilla.com/D151821
2022-07-14 18:35:49 +00:00
James Teh
ef6f7fb547 Bug 1757126 part 4: Support AccessKey on cached RemoteAccessible. r=morgan
1. Move AccessKey to base Accessible.
2. Retrieve AccessKey from the cache for RemoteAccessible.
3. Update XPCOM and platform specific code accordingly.

Differential Revision: https://phabricator.services.mozilla.com/D151202
2022-07-14 05:48:16 +00:00
James Teh
96dc8466b6 Bug 1757126 part 3: Push AccessKey to the parent process cache. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D151201
2022-07-14 05:48:16 +00:00
James Teh
2d82055fe8 Bug 1757126 part 2: Move KeyBinding to base Accessible header. r=morgan
We'll need this to unify AccessKey.

Differential Revision: https://phabricator.services.mozilla.com/D151200
2022-07-14 05:48:16 +00:00
James Teh
52a9b98ce9 Bug 1757126 part 1: Remove RemoteAccessible::KeyboardShortcut. r=morgan,ipc-reviewers,nika
KeyboardShortcut is only supported for XUL menu items.
XUL menu items can never be remote, so there's no point in querying this via IPDL.

Differential Revision: https://phabricator.services.mozilla.com/D151199
2022-07-14 05:48:15 +00:00
Norisz Fay
d152ee99bf Backed out 4 changesets (bug 1757126) for causing build bustages on xpcAccessible.cpp CLOSED TREE
Backed out changeset e57b1129fd48 (bug 1757126)
Backed out changeset 6ee5d245c2fc (bug 1757126)
Backed out changeset b0809e6a3de3 (bug 1757126)
Backed out changeset 4d10b2dfdc99 (bug 1757126)
2022-07-14 04:18:36 +03:00
James Teh
4ea684224b Bug 1770878: Don't fire collapsed selection events on the container of a focused text field. r=morgan
These events were clobbering the text field selection in the cache.
They aren't useful to clients anyway.

Differential Revision: https://phabricator.services.mozilla.com/D151004
2022-07-14 00:50:38 +00:00
James Teh
e83581aacd Bug 1757126 part 4: Support AccessKey on cached RemoteAccessible. r=morgan
1. Move AccessKey to base Accessible.
2. Retrieve AccessKey from the cache for RemoteAccessible.
3. Update XPCOM and platform specific code accordingly.

Differential Revision: https://phabricator.services.mozilla.com/D151202
2022-07-14 00:49:47 +00:00
James Teh
1e23a19e0f Bug 1757126 part 3: Push AccessKey to the parent process cache. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D151201
2022-07-14 00:49:46 +00:00
James Teh
b64daafc2b Bug 1757126 part 2: Move KeyBinding to base Accessible header. r=morgan
We'll need this to unify AccessKey.

Differential Revision: https://phabricator.services.mozilla.com/D151200
2022-07-14 00:49:46 +00:00
James Teh
01bc6196d8 Bug 1757126 part 1: Remove RemoteAccessible::KeyboardShortcut. r=morgan,ipc-reviewers,nika
KeyboardShortcut is only supported for XUL menu items.
XUL menu items can never be remote, so there's no point in querying this via IPDL.

Differential Revision: https://phabricator.services.mozilla.com/D151199
2022-07-14 00:49:45 +00:00
James Teh
c838f807ed Bug 1762116: When a global ARIA attribute is added to an element, create an Accessible if there isn't one already. r=morgan
We don't create Accessibles for all elements.
If an element has a global ARIA attribute when it is shown, we do create an Accessible for it.
However, previously, if we didn't initially create an Accessible for an element (e.g. no global ARIA attributes) and it subsequently gained a global ARIA attribute, we didn't create an Accessible at that point.
We now explicitly handle this case when such an attribute is added.

Differential Revision: https://phabricator.services.mozilla.com/D151348
2022-07-14 00:48:47 +00:00
James Teh
e29e5e6308 Bug 1778644: When a row is added to a table, push a cache update for the table's layout guess. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D151454
2022-07-14 00:47:55 +00:00
James Teh
21a943f29d Bug 1779149: Remove/fix incorrect assertions in CachedTableAccessible. r=morgan
1. When updating the row/col map, there can be overlapping cells - we even have code to support that - so don't assert that there is no existing cell.
2. When retrieving the caption, the role assertion was accidentally reversed.

Differential Revision: https://phabricator.services.mozilla.com/D151569
2022-07-14 00:45:26 +00:00
James Teh
cd91557c45 Bug 1779162: Don't walk ancestors unnecessarily in CachedTableCellAccessible::RowHeaderCells. r=morgan
Previously, we used CellAt, but this returns the Accessible, discarding the CachedTableCellAccessible.
RowHeaderCells needs both, so it then called AsTableCellBase, which must walk ancestors to get the table.
We already have the table and access to its private data, so use it directly.
This is probably an insignificant performance improvement, but the unnecessary indirection was bothering me.

Differential Revision: https://phabricator.services.mozilla.com/D151571
2022-07-14 00:44:56 +00:00
James Teh
bbcfab7595 Bug 1779303: Don't add null attribute values for RemoteAccessibles with markup attributes that must be fetched from DOM. r=morgan
Some markup elements expose Accessible attributes which must be retrieved from DOM; e.g. the datetime attribute of the datetime element.
We don't cache these yet for RemoteAccessible.
Previously, these were unintentionally exposed from MarkupAttributes with null values.
For now, these should be skipped instead until we have caching code for them.
This fixes crashes whenever a client tries to fetch attributes from such an element.

Differential Revision: https://phabricator.services.mozilla.com/D151659
2022-07-14 00:21:27 +00:00
Norisz Fay
c58fc06b93 Backed out changeset 588fd65ea989 (bug 1778550) for causing mochitest failures on browser_hierarchy.js, browser_rootgroup.js, browser_text_leaf.js CLOSED TREE 2022-07-14 03:20:35 +03:00
Morgan Reschenberg
4da022c85c Bug 1778550: Trim whitespace on mozAcc titles, prune empty mozTextLeafAccs from tree r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D151328
2022-07-13 23:03:40 +00:00
Tooru Fujisawa
a4edb84be9 Bug 1777486 - Part 5: Remove unnecessary XPCOMUtils.jsm imports. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D151217
2022-07-12 04:21:35 +00:00
Tooru Fujisawa
54623364da Bug 1777486 - Part 2: Migrate XPCOMUtils.jsm consumers with automatic migration. r=webdriver-reviewers,geckoview-reviewers,preferences-reviewers,application-update-reviewers,pip-reviewers,kmag,owlish,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D151214
2022-07-12 04:21:34 +00:00
James Teh
d2d7992aaf Bug 1748755: Support IAccessibleText::get_new/oldText for cached RemoteAccessible. r=morgan
1. Make ia2AccessibleText::UpdateTextChangeData (and sLastTextChangeAcc) use HyperTextAccessibleBase instead of HyperTextAccessibleWrap.
2. Make ProxyTextChangeEvent call UpdateTextChangeData when the cache is enabled.
3. Don't send sync text change events when the cache is enabled. They don't need to be sync because clients query the cache, not the content process a11y tree. Even if the content process a11y tree mutates, the cache can't update until in-process clients have synchronously handled the event.

Differential Revision: https://phabricator.services.mozilla.com/D139677
2022-07-12 02:45:58 +00:00
James Teh
2e5729d4e9 Bug 1757121 part 5: Expose live region attributes on cached RemoteAccessibles. r=morgan
As part of this, aria-relevant is now exposed via object attributes.
This is necessary to ensure it is included in the cache.
There's no good reason not to expose it anyway, since we already expose the other live region attributes.

Differential Revision: https://phabricator.services.mozilla.com/D150380
2022-07-12 02:45:58 +00:00
James Teh
d0d3ec2479 Bug 1757121 part 4: Acquire the Android lock while shutting down the accessibility service. r=eeejay
RemoteAccessibleBase::Attributes will soon use the service to query markup attributes.
Thus, the service must not shut down while a client call is being handled on the UI thread.

Differential Revision: https://phabricator.services.mozilla.com/D150722
2022-07-12 02:45:57 +00:00
James Teh
d2615d1719 Bug 1757121 part 3: Normalize true/false/mixed ARIA tokens to atoms. r=morgan
This will be needed for easier checking of aria-atomic.
It is also more efficient in terms of cache storage, since we previously pushed strings for these values.
This moves the code from GetARIAToken into NormalizeARIAToken, since GetARIAToken isn't used any more and it makes sense to handle normalization in one place.

Differential Revision: https://phabricator.services.mozilla.com/D150379
2022-07-12 02:45:57 +00:00
James Teh
99afe5c014 Bug 1757121 part 2: Rewrite nsAccUtils::SetLiveContainerAttributes to use the a11y tree instead of the DOM tree. r=morgan
This makes it possible for it to work for RemoteAccessible.
There is a functional change here in that using the a11y tree means we traverse parents set via aria-owns, where previously we only walked the DOM ancestry.
I doubt this will have any impact in the wild and Chromium already does this anyway.

Differential Revision: https://phabricator.services.mozilla.com/D150378
2022-07-12 02:45:56 +00:00
James Teh
b40ace7f06 Bug 1757121 part 1: Allow nsAccessibilityService::MarkupAttribute/MarkupAttributes to take an Accessible. r=morgan
Previously, these methods took a DOM nsIContent, making it impossible for them to work for RemoteAccessible.
GetMarkupMapInfoForNode has been renamed to GetMarkupMapInfoFor and has overloads for nsIContent and Accessible.
MarkupAttribute is a template which can take either, as we still need the nsIContent version elsewhere.
MarkupAttributes now only takes an Accessible, as it can get the nsIContent from the Accessible if necessary.

Differential Revision: https://phabricator.services.mozilla.com/D150377
2022-07-12 02:45:56 +00:00
James Teh
143b3ab931 Bug 1768269: Use IgnoredErrorResult instead of ErrorResult in LocalAccessible::IsActiveDescendant. r=eeejay
QuerySelector can fail if the id is invalid; e.g. if it contains a quote (") character.
ErrorResult treats a failure as an exception, so it asserts.
We explicitly check for and handle failure ourselves, so use IgnoredErrorResult instead.

Differential Revision: https://phabricator.services.mozilla.com/D151564
2022-07-12 02:44:31 +00:00
Eitan Isaacson
87bdd97025 Bug 1776919 - Add Accessible::DebugPrint for debugging. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D150497
2022-07-12 02:41:02 +00:00
Butkovits Atila
ed1ef2fc65 Bug 1778220 - disable browser_test_zoom.js on Linux_64 & Win for frequent failures. r=intermittent-reviewers,MasterWayZ DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D151434
2022-07-11 18:04:49 +00:00
Andreea Pavel
7738a75fdd Backed out 11 changesets (Bug 1777486) for failing bc at browser_startup.js on a CLOSED TREE
Backed out changeset b6c4c386f1a6 (Bug 1777486)
Backed out changeset 195cc2de8433 (Bug 1777486)
Backed out changeset 20c746fb1648 (Bug 1777486)
Backed out changeset d5fd8173d62d (Bug 1777486)
Backed out changeset 6d758fab5a3e (Bug 1777486)
Backed out changeset e938b601ba15 (Bug 1777486)
Backed out changeset 0c4ea0b9416b (Bug 1777486)
Backed out changeset 0559c53cc668 (Bug 1777486)
Backed out changeset eea573d3a9f9 (Bug 1777486)
Backed out changeset 9ce3a6496a49 (bug 1777486)
Backed out changeset b0867652fc48 (bug 1777486)
2022-07-11 22:24:40 +03:00
Tooru Fujisawa
6ee7d4ed56 Bug 1777486 - Part 5: Remove unnecessary XPCOMUtils.jsm imports. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D151217
2022-07-11 15:09:15 +00:00
Tooru Fujisawa
8cd6ed7409 Bug 1777486 - Part 2: Migrate XPCOMUtils.jsm consumers with automatic migration. r=webdriver-reviewers,geckoview-reviewers,preferences-reviewers,application-update-reviewers,pip-reviewers,kmag,owlish,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D151214
2022-07-11 15:09:13 +00:00
Tooru Fujisawa
52c95734e7 Bug 1667455 - Part 9: Stop importing Services.jsm from chrome-priv HTML code, single-line cases. r=kmag,necko-reviewers,geckoview-reviewers,extension-reviewers,m_kato,dragana
Differential Revision: https://phabricator.services.mozilla.com/D150898
2022-07-11 12:41:52 +00:00
Tooru Fujisawa
47c8f80432 Bug 1667455 - Part 6: Stop importing Services.jsm from chrome-priv JS code, non-top-level or multi-line cases. r=kmag,perftest-reviewers,AlexandruIonescu,sparky
Differential Revision: https://phabricator.services.mozilla.com/D150895
2022-07-11 12:41:51 +00:00
Tooru Fujisawa
bf93d07148 Bug 1667455 - Part 5: Stop importing Services.jsm from chrome-priv JS code, top-level single-line cases. r=kmag,webdriver-reviewers,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,extension-reviewers,application-update-reviewers,pip-reviewers,twisniewski,m_kato,jdescottes,mconley,AlexandruIonescu,mossop
Differential Revision: https://phabricator.services.mozilla.com/D150894
2022-07-11 12:41:50 +00:00
Tooru Fujisawa
f3a8c52c53 Bug 1667455 - Part 4: Stop importing Services.jsm from JSM. r=kmag,webdriver-reviewers,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,application-update-reviewers,pip-reviewers,twisniewski,devtools-reviewers,m_kato,jdescottes,ochameau,mconley,sfoster,AlexandruIonescu
Differential Revision: https://phabricator.services.mozilla.com/D150893
2022-07-11 12:41:50 +00:00
Morgan Reschenberg
e1807daa21 Bug 1767304: Support ValueDescription, Orientation, Min, Max on AXIncrementors r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D151080
2022-07-07 21:31:17 +00:00
Butkovits Atila
41fa540cb7 Bug 1771934 - Lint fix. a=fix. CLOSED TREE 2022-07-07 02:07:45 +03:00
Eitan Isaacson
1916ea7d90 Bug 1771934 - Unregister all SessionAccessibility accessibles when top doc is shut down. r=Jamie
The associated PresShell of the root doc can be used for retrieving the
SessionAccessibility. If the PresShell is about to go away, we should
unregister all the accessibles.

Differential Revision: https://phabricator.services.mozilla.com/D150661
2022-07-06 22:26:08 +00:00
Nika Layzell
7ced96212e Bug 1778211 - Reject xpidl CDATA containing 'virtual', r=xpcom-reviewers,necko-reviewers,mccr8,dragana
We'll probably want to do something more accurate in the future with a
custom clang static analysis pass which validates that XPIDL interfaces
have the expected vtable and struct layout, however doing so would be
more involved than the string matching done in this patch.

In addition to checking for extra virtual methods, we'll likely also
want to check for data members on interfaces, and reject them unless the
class is marked as `[builtinclass]` in addition to some other attribute
which we'll need to add to prevent them from being implemented in Rust
(as c++ data members will not be reflected by the rust macro).

There were 2 instances of a comment which contained the word 'virtual'
within a CDATA block. These comments were moved out of the CDATA block
to avoid triggering the error.

Differential Revision: https://phabricator.services.mozilla.com/D151068
2022-07-06 14:53:06 +00:00
James Teh
7558f52d0c Bug 1777409: Fix IAccessible::accFocus for non-tab remote documents such as extension sidebars. r=morgan
Previously, we retrieved the active tab.
However, remote documents might not be within a tab; e.g. extension sidebars.
Instead, we now use BrowserParent::GetFocused to get the focused document.

Differential Revision: https://phabricator.services.mozilla.com/D150706
2022-07-05 21:04:27 +00:00
James Teh
71f8cac441 Bug 1777410: Fix IAccessible::accChild for extension sidebars. r=morgan
Extension sidebars are remote documents.
However, they are embedded inside a XUL <window>, which is a sub-document of the root document.
Previously, our accChild code required that the remote document be embedded in the same local document as the Accessible on which accChild was called.
This meant that calling accChild on the root with the id of an Accessible in an extension sidebar failed.
To fix this, allow a remote document to be embedded in a descendant local document.

Differential Revision: https://phabricator.services.mozilla.com/D150716
2022-07-05 21:03:13 +00:00
Morgan Rae Reschenberg
644b66ac98 Bug 1775329: Support cached OffsetAtPoint in HyperTextAccessibleBase r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D150049
2022-07-05 19:50:45 +00:00
Morgan Rae Reschenberg
1d91ffd52f Bug 1776275: Consistently fetch fullZoom from top level browsing context in tests, cache on the top level doc in core r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D150291
2022-07-05 19:50:45 +00:00
Mike Conley
49438bb09a Bug 1774262 - Make search-textbox component easier to theme. r=mstriemer,desktop-theme-reviewers,dao,freddyb
This allows consumers of the component to override the clear search icon
and change the width of the focus outline.

Differential Revision: https://phabricator.services.mozilla.com/D149563
2022-06-30 22:07:01 +00:00
criss
fc6d3e181e Backed out 2 changesets (bug 1775329, bug 1776275) for causing mochitest failures on browser_test_zoom_text.js. CLOSED TREE
Backed out changeset 72519abf87ee (bug 1775329)
Backed out changeset 365e262b3dad (bug 1776275)
2022-06-29 23:39:31 +03:00
Morgan Rae Reschenberg
a68d0f55b4 Bug 1775329: Support cached OffsetAtPoint in HyperTextAccessibleBase r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D150049
2022-06-29 19:00:14 +00:00
Morgan Rae Reschenberg
3fd29fdf82 Bug 1776275: Consistently fetch fullZoom from top level browsing context in tests, cache on the top level doc in core r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D150291
2022-06-29 19:00:13 +00:00
Bogdan Szekely
a0e2dc5103 Backed out 5 changesets (bug 1748755, bug 1757121) for causing reftest failures on 448064.xhtml CLOSED TREE
Backed out changeset 4ff1f0c0d866 (bug 1748755)
Backed out changeset 41328f13fe58 (bug 1757121)
Backed out changeset 27631b3a007f (bug 1757121)
Backed out changeset 2d4cc5953773 (bug 1757121)
Backed out changeset 8d874e7a2a8f (bug 1757121)
2022-06-29 12:25:04 +03:00
James Teh
ee4cfc52be Bug 1748755: Support IAccessibleText::get_new/oldText for cached RemoteAccessible. r=morgan
1. Make ia2AccessibleText::UpdateTextChangeData (and sLastTextChangeAcc) use HyperTextAccessibleBase instead of HyperTextAccessibleWrap.
2. Make ProxyTextChangeEvent call UpdateTextChangeData when the cache is enabled.
3. Don't send sync text change events when the cache is enabled. They don't need to be sync because clients query the cache, not the content process a11y tree. Even if the content process a11y tree mutates, the cache can't update until in-process clients have synchronously handled the event.

Differential Revision: https://phabricator.services.mozilla.com/D139677
2022-06-29 07:04:13 +00:00
James Teh
b2ec52f4a2 Bug 1757121 part 4: Expose live region attributes on cached RemoteAccessibles. r=morgan
As part of this, aria-relevant is now exposed via object attributes.
This is necessary to ensure it is included in the cache.
There's no good reason not to expose it anyway, since we already expose the other live region attributes.

Differential Revision: https://phabricator.services.mozilla.com/D150380
2022-06-29 07:04:13 +00:00
James Teh
20f696d41d Bug 1757121 part 3: Normalize true/false/mixed ARIA tokens to atoms. r=morgan
This will be needed for easier checking of aria-atomic.
It is also more efficient in terms of cache storage, since we previously pushed strings for these values.
This moves the code from GetARIAToken into NormalizeARIAToken, since GetARIAToken isn't used any more and it makes sense to handle normalization in one place.

Differential Revision: https://phabricator.services.mozilla.com/D150379
2022-06-29 07:04:12 +00:00
James Teh
46c2de7cf7 Bug 1757121 part 2: Rewrite nsAccUtils::SetLiveContainerAttributes to use the a11y tree instead of the DOM tree. r=morgan
This makes it possible for it to work for RemoteAccessible.
There is a functional change here in that using the a11y tree means we traverse parents set via aria-owns, where previously we only walked the DOM ancestry.
I doubt this will have any impact in the wild and Chromium already does this anyway.

Differential Revision: https://phabricator.services.mozilla.com/D150378
2022-06-29 07:04:12 +00:00
James Teh
a39fe994da Bug 1757121 part 1: Allow nsAccessibilityService::MarkupAttribute/MarkupAttributes to take an Accessible. r=morgan
Previously, these methods took a DOM nsIContent, making it impossible for them to work for RemoteAccessible.
GetMarkupMapInfoForNode has been renamed to GetMarkupMapInfoFor and has overloads for nsIContent and Accessible.
MarkupAttribute is a template which can take either, as we still need the nsIContent version elsewhere.
MarkupAttributes now only takes an Accessible, as it can get the nsIContent from the Accessible if necessary.

Differential Revision: https://phabricator.services.mozilla.com/D150377
2022-06-29 07:04:12 +00:00
Narcis Beleuzu
53df7af2fd Backed out 1 changesets (bug 1771934) for crashes on WeakPtr.h . CLOSED TREE
Backed out changeset 5956f91b3975 (bug 1771934)
2022-06-29 00:26:14 +03:00
Morgan Rae Reschenberg
08c0e3cd98 Bug 1775361: Wait for a show event on the imagemap before querying its firstChild r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D150175
2022-06-28 20:15:04 +00:00
Eitan Isaacson
681cf4b1f5 Bug 1771934 - Return null accessible when SessionAcc is not fully attached. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D149295
2022-06-28 19:40:08 +00:00
Ryan VanderMeulen
3187ab6878 Bug 1776496 - Re-enable some passing browser-chrome tests. r=preferences-reviewers,Gijs
Differential Revision: https://phabricator.services.mozilla.com/D150280
2022-06-27 13:57:41 +00:00
James Teh
e998d303d0 Bug 1773930: Expose xml-roles object attribute on cached RemoteAccessible. r=morgan
This also changes LocalAccessible::Attributes to ignore the edge case of an empty role attribute when calculating xml-roles.
This is consistent with how we handle the role attribute elsewhere (see aria::GetRoleMapIndex) and makes it easier to handle this consistently between local and remote.

Differential Revision: https://phabricator.services.mozilla.com/D149594
2022-06-24 05:28:53 +00:00
Joel Maher
5bf232d7af Bug 1776212 - cleanup e10s in manifest conditions for bc/dt. r=aryx,necko-reviewers,extension-reviewers,preferences-reviewers,dragana,zombie
Differential Revision: https://phabricator.services.mozilla.com/D150127
2022-06-23 17:49:07 +00:00
James Teh
4c4dccc52b Bug 1774197 part 3: Correctly recurse into iframe documents in RemoteAccessibleBase::ChildAtPoint. r=morgan
We were previously looking for a doc (IsDoc), but we'll never get any doc in a viewport cache except for the doc whose viewport we are searching.
Instead, if we encounter an iframe, we'll hit an OuterDoc (IsOuterDoc) which is the Accessible for the iframe element.
In that case, we walk *inside* that OuterDoc to get its embedded document, then recurse from there if appropriate.

Differential Revision: https://phabricator.services.mozilla.com/D149247
2022-06-23 04:57:04 +00:00
James Teh
e03a5619fd Bug 1774197 part 2: Don't include the document in the viewport cache. r=morgan
Sometimes, the document occurs too early in the viewport cache, perhaps even right at the start.
We weren't benefitting from it being in the cache anyway, since we always skipped it.
We already have a fallback in ChildAtPoint for the case where we didn't find a matching Accessible, so we rely on that to handle returning the document when appropriate.

Differential Revision: https://phabricator.services.mozilla.com/D149493
2022-06-23 04:57:04 +00:00
James Teh
d73cd7641e Bug 1774197 part 1: Move sending of the viewport cache to ProcessQueuedCacheUpdates. r=morgan
This was moved to a post refresh observer on the misunderstanding that this would allow us to benefit from retained display lists.
In reality, it doesn't; work would need to be done in layout to benefit from those, and since there are different display lists for hit testing and painting, this may not be feasible anyway.
Furthermore, the post refresh implementation was broken because WillRefresh often removes the post refresh observer, which meant that a viewport cache update was never actually pushed!
We could fix this by adding the post refresh observer only if the viewport cache is dirty, removing the post refresh observer in DidRefresh and also removing the post refresh observer in Shutdown only if the viewport cache is dirty.
However, given that we can't benefit from retained display lists anyway, using a post refresh observer doesn't serve any purpose at this stage.
Among other things, this fixes intermittent problems with image maps, which often get inserted into the tree after the initial tree is built.

Differential Revision: https://phabricator.services.mozilla.com/D149492
2022-06-23 04:57:04 +00:00
Morgan Rae Reschenberg
fdd6afc666 Bug 1772861: Cache offset for cross-proc iframe docs r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D148832
2022-06-21 20:23:18 +00:00
James Teh
1a49b1e666 Bug 1760739 part 6: Add unified GroupPosition and TotalItemCount support for aria-row/colcount/index. r=eeejay
While this removes most of the local-specific code, we can't remove ARIARowAccessible::GroupPosition yet because it also calculates row index/count compensating for intervening Accessibles between tables and rows.
Eventually, we should fix that properly in AccGroupInfo, at which point we can remove this.

Differential Revision: https://phabricator.services.mozilla.com/D149225
2022-06-16 06:25:52 +00:00
James Teh
32aea8c6e2 Bug 1760739 part 5: Add Accessible method to retrieve an integer ARIA attribute. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D149224
2022-06-16 06:25:51 +00:00
James Teh
b8d51ef048 Bug 1760739 part 4: Normalize aria-row/colcount/index as integers. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D149223
2022-06-16 06:25:51 +00:00
James Teh
237c1cc6fa Bug 1760739 part 3: Expose ARIA object attributes for cached RemoteAccessibles. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D149222
2022-06-16 06:25:51 +00:00
James Teh
70b810b3c0 Bug 1760739 part 2: Provide a way for ARIAMap's AttrIterator to expose values other than strings. r=eeejay
Previously, AttrIterator always exposed string values.
Soon, we'll be using this for caching, so we don't want to convert token values to strings.
We'll eventually need to expose numeric values as well.
To achieve this, an ExposeAttr method was added which takes an AccAttributes and sets the attribute on it using an appropriately typed value.

In addition, a small optimisation was made so we don't search the ARIA attributes map twice for each attribute we query.
The string version of AttrName was also removed, since it wasn't used.
Unfortunately, AttrValue can't be removed yet because our old UIA implementation depends on it, but that will have to be rewritten at some point in future.

Differential Revision: https://phabricator.services.mozilla.com/D149221
2022-06-16 06:25:50 +00:00
James Teh
06433bf920 Bug 1760739 part 1: Remove propagation of ARIA object attributes from iframes to documents. r=eeejay
This behaviour doesn't currently work for OOP iframes.
While we could make it work for OOP iframes using the cache, it isn't covered by the spec, nor does any other browser support it.

Differential Revision: https://phabricator.services.mozilla.com/D149220
2022-06-16 06:25:50 +00:00
James Teh
977aa35653 Bug 1774393: Support BoundsInCSSPixels for cached RemoteAccessible. r=morgan
Our hit testing tests need this.
This adds a base Accessible::BoundsInCSSPixels implementation which relies on BoundsInAppUnits.
BoundsInAppUnits was also moved to Accessible, but it is implemented differently for local and remote, so the base method is abstract.
I also did a drive-by removal of a pointless conditional in xpcAccessible::GetBounds.

Differential Revision: https://phabricator.services.mozilla.com/D149374
2022-06-16 01:03:26 +00:00
Eitan Isaacson
afad4c3c85 Bug 1755377 - Send list of accessibles that are un/selected to parent cache. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D149313
2022-06-15 17:08:38 +00:00
James Teh
2b226822c0 Bug 1774193: Allow IAccessible::accHitTest to use RemoteAccessible's ChildAtPoint. r=morgan
When the cache is enabled, this now also fetches the deepest descendant instead of a direct child.
In addition, I removed some unnecessary/misleading comments.

Differential Revision: https://phabricator.services.mozilla.com/D149240
2022-06-14 22:18:29 +00:00
James Teh
23c3b53d41 Bug 1773996: Don't queue a11y cache updates if we're never going to send them. r=morgan
This was wasting memory for the parent process, and when the cache was disabled, all content processes.
QueueCacheUpdate now checks whether we are actually sending cache updates before it queues anything.
Simple calls rely on this check, rather than guarding the call to QueueCacheUpdate themselves.
We still call QueueCacheUpdate conditionally for more complex cases which would have to do work before calling QueueCacheUpdate, since we don't want to pointlessly do that prerequisite work.

Differential Revision: https://phabricator.services.mozilla.com/D149231
2022-06-14 22:10:37 +00:00
Morgan Reschenberg
574b6f1192 Bug 1773745: Add FullKeyboardAccess to A11Y_INSTANTIATORS r=eeejay,spohl
Differential Revision: https://phabricator.services.mozilla.com/D148941
2022-06-13 22:38:42 +00:00
Morgan Rae Reschenberg
894d3bd827 Bug 1772609: Support cached hittesting on image maps r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D148556
2022-06-13 22:28:36 +00:00
Morgan Rae Reschenberg
2fbf4cf4f2 Bug 1758689: Create and maintain a viewport cache for hittesting r=Jamie,emilio
This hittesting approach is borrowed from our Android implementation.
We maintain a cache of ID's for accessibles which are visible in the viewport.
This cache is created with a call to `nsLayoutUtils::GetFramesForArea`, which
returns frames in the viewport, in hittesting order.

In the parent process, we walk through the cache, keeping track of accs whose
bounds contain the hittesting point. Depending on if we're searching for the
direct child, or the deepest child, we walk the entire cache or return the
first match.

Each document (in the content process) maintains a dirty bit, which gets set
any time an acc it contains bundles either a text update, or an update that
affects bounds. We check whether this bit is set in `DidRefresh` after getting
a notification from our post-refresh observer. If that bit is set, we
queue a cache update for the `::Viewport` domain on the current document.

Because this cache depends on the viewport being painted, we include the
`IgnorePaintSuppression` flag in our `GetFramesForArea` call. This ensures
the display lists are built before the page finishes loading.

Differential Revision: https://phabricator.services.mozilla.com/D147225
2022-06-13 22:28:36 +00:00
James Teh
19d797513c Bug 1773104: Hold a reference to the BrowsingContext when deferring the sending of a PDocAccessible constructor. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D148747
2022-06-13 21:57:15 +00:00
James Teh
73a4914387 Bug 1772170: Ensure cached Accessibles and offsets are valid before returning them in DocAccessibleParent::SelectionRanges. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D148745
2022-06-13 21:56:23 +00:00
Emilio Cobos Álvarez
9fc2aa47fc Bug 1773558 - Move fixed-point font types to Rust. r=layout-reviewers,jfkthame
Now that cbindgen and rust support const generics, it seems more simple.

This centralizes all the relevant font constants etc in rust and avoids
conversions when going from rust to C++ and vice versa.

Differential Revision: https://phabricator.services.mozilla.com/D148847
2022-06-13 00:59:23 +00:00
Noemi Erli
841e350bc4 Backed out changeset 7585591a9bad (bug 1773558) for causing failures in system-fonts.html 2022-06-12 19:02:33 +03:00
Emilio Cobos Álvarez
e441089ca0 Bug 1773558 - Move fixed-point font types to Rust. r=layout-reviewers,jfkthame
Now that cbindgen and rust support const generics, it seems more simple.

This centralizes all the relevant font constants etc in rust and avoids
conversions when going from rust to C++ and vice versa.

Differential Revision: https://phabricator.services.mozilla.com/D148847
2022-06-12 10:48:58 +00:00
Eitan Isaacson
32e8c940bd Bug 1773102 - Accomodate xul label[value] in offset conversions and spelling errors. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D148677
2022-06-12 06:59:18 +00:00
criss
c6b2c5db61 Backed out 9 changesets (bug 1772006) causing build bustages on nsTString.cpp. CLOSED TREE
Backed out changeset f17c7565707b (bug 1772006)
Backed out changeset c725fe1f5882 (bug 1772006)
Backed out changeset d19663161261 (bug 1772006)
Backed out changeset b6611ab002d9 (bug 1772006)
Backed out changeset 790f42b64af9 (bug 1772006)
Backed out changeset 79a734b4e4d9 (bug 1772006)
Backed out changeset 42730aae16ea (bug 1772006)
Backed out changeset b2542aef3054 (bug 1772006)
Backed out changeset 962bfea4a309 (bug 1772006)
2022-06-11 01:13:42 +03:00
criss
87ebda9e82 Backed out 2 changesets (bug 1758689, bug 1772609) for causing nsRefreshDriver related failures. CLOSED TREE
Backed out changeset 05a9ffa21ad0 (bug 1772609)
Backed out changeset c2233b3830ef (bug 1758689)
2022-06-11 00:53:17 +03:00
Nika Layzell
b3c13bf114 Bug 1772006 - Part 6: Simplify and move the string searching APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,eeejay,dragana,barret
The biggest set of APIs from ns[T]StringObsolete which are still heavily used
are the string searching APIs. It appears the intention was for these to be
replaced by the `FindInReadable` APIs, however that doesn't appear to have
happened.

In addition, the APIs have some quirks around their handling of mixed character
widths. These APIs generally supported both narrow strings and the native
string type, probably because char16_t string literals weren't available until
c++11. Finally they also used easy-to-confuse unlabeled boolean and integer
optional arguments to control behaviour.

These patches do the following major changes to the searching APIs:

1. The ASCII case-insensitive search method was split out as
   LowerCaseFindASCII, rather than using a boolean. This should be less
   error-prone and more explicit, and allows the method to continue to use
   narrow string literals for all string types (as only ASCII is supported).
2. The other [R]Find methods were restricted to only support arguments with
   matching character types. I considered adding a FindASCII method which would
   use narrow string literals for both wide and narrow strings but it would've
   been the same amount of work as changing all of the literals to unicode
   literals.
   This ends up being the bulk of the changes in the patch.
3. All find methods were re-implemented using std::basic_string_view's find
   algorithm or stl algorithms to reduce code complexity, and avoid the need to
   carry around the logic from nsStringObsolete.cpp.
4. The implementations were moved to nsTStringRepr.cpp.
5. An overload of Find was added to try to catch callers which previously
   called `Find(..., false)` or `Find(..., true)` to set case-sensitivity, due
   to booleans normally implicitly coercing to `index_type`. This should
   probably be removed at some point, but may be useful during the transition.

Differential Revision: https://phabricator.services.mozilla.com/D148300
2022-06-10 21:12:08 +00:00
Morgan Rae Reschenberg
07d928d6bf Bug 1772609: Support cached hittesting on image maps r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D148556
2022-06-10 21:10:18 +00:00
Morgan Rae Reschenberg
90900e0fef Bug 1758689: Create and maintain a viewport cache for hittesting r=Jamie,emilio
This hittesting approach is borrowed from our Android implementation.
We maintain a cache of ID's for accessibles which are visible in the viewport.
This cache is created with a call to `nsLayoutUtils::GetFramesForArea`, which
returns frames in the viewport, in hittesting order.

In the parent process, we walk through the cache, keeping track of accs whose
bounds contain the hittesting point. Depending on if we're searching for the
direct child, or the deepest child, we walk the entire cache or return the
first match.

Each document (in the content process) maintains a dirty bit, which gets set
any time an acc it contains bundles either a text update, or an update that
affects bounds. We check whether this bit is set in `DidRefresh` after getting
a notification from our post-refresh observer. If that bit is set, we
queue a cache update for the `::Viewport` domain on the current document.

Because this cache depends on the viewport being painted, we include the
`IgnorePaintSuppression` flag in our `GetFramesForArea` call. This ensures
the display lists are built before the page finishes loading.

Differential Revision: https://phabricator.services.mozilla.com/D147225
2022-06-10 21:10:18 +00:00
Morgan Rae Reschenberg
10b7310064 Bug 1771514: Add design review and preliminary HCM documentation r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D147522
2022-06-08 16:18:32 +00:00
Emilio Cobos Álvarez
507022b002 Bug 1772138 - Simplify FlattenedChildIterator. r=smaug
It has a lot of XBL / Shadow DOM v0 cruft that we can remove.
mDefaultChild is unused, and ExplicitChildIterator is just basically a
loop over GetFirstChild() / GetNextSibling() so remove it..

Differential Revision: https://phabricator.services.mozilla.com/D147870
2022-06-08 14:34:46 +00:00
Emilio Cobos Álvarez
adc65b1456 Bug 1773070 - Rename/remove some eventState/s variables. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D148558
2022-06-07 23:09:54 +00:00
Emilio Cobos Álvarez
12bd84f0c5 Bug 1773070 - While at it rename ContentStateChanged to ElementStateChanged, and make it take elements. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D148553
2022-06-07 23:09:54 +00:00
Emilio Cobos Álvarez
255763ef57 Bug 1773070 - Unify Gecko and Servo EventState/ElementState bits. r=smaug
Add a dom/base/rust crate called just "dom" where we can share these.

Most of the changes are automatic:

  s/mozilla::EventStates/mozilla::dom::ElementState/
  s/EventStates/ElementState/
  s/NS_EVENT_STATE_/ElementState::/
  s/NS_DOCUMENT_STATE_/DocumentState::/

And so on. This requires a new cbindgen version to avoid ugly casts for
large shifts.

Differential Revision: https://phabricator.services.mozilla.com/D148537
2022-06-07 23:09:52 +00:00
Eitan Isaacson
1032053809 Bug 1772026 - Wait for initialized PresShell (unless about:blank) before doc DoInitialUpdate. r=Jamie
This prevents a case where a blank page that never has an
initialized PresShell keeps the refresh observer.

Differential Revision: https://phabricator.services.mozilla.com/D148146
2022-06-07 18:08:26 +00:00
Sylvestre Ledru
42f6811d95 Bug 1519636 - Reformat recent changes to the Google coding style r=andi,media-playback-reviewers,necko-reviewers,padenot,dragana
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D148375
2022-06-07 12:32:55 +00:00
James Teh
0c1571c44a Bug 1771934: Acquire the Android a11y lock in some additional places. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D147854
2022-06-07 06:14:45 +00:00
James Teh
6e2fd8c6e0 Bug 1771931 part 4: Clarify some code regarding CachedTableAccessible creation and cleanup. r=morgan
First, move the cached table cleanup code out of LocalAccessible::UnbindFromParent and into Shutdown.
This makes no practical difference - it gets called either way when the document shuts down - but it's a bit clearer what's happening this way.

Second, add an assertion to CachedTableAccessible::GetFrom to ensure it is only ever given a table.
I don't think it would ever be given anything else, but this makes that clearer.

Differential Revision: https://phabricator.services.mozilla.com/D148089
2022-06-04 02:22:47 +00:00
James Teh
9135f9822a Bug 1771931 part 3: Pre-allocate row/col arrays in CachedTableAccessible. r=morgan
Rather than allocating elements one by one, bulk allocate as many as we know for sure we'll need.

Differential Revision: https://phabricator.services.mozilla.com/D148088
2022-06-04 02:22:47 +00:00
James Teh
89f61f81ed Bug 1771931 part 2: Gracefully handle row/colspan 0 for CachedTableAccessible. r=morgan
We're seeing crashes in the wild where we're trying to allocate a very large number of array elements.
This suggests that the column index is underflowing.
The only way I can think of that this could happen is if colspan is 0 on the first cell, in which case we'd do 0 + 0 - 1 and underflow.
That shouldn't be possible - layout shouldn't ever give us a row/colspanof 0 - but perhaps it's happening anyway.
If this happens, we'll now gracefully treat it as a span of 1.
I also added an assertion in case this helps us to track this down properly in future.

Differential Revision: https://phabricator.services.mozilla.com/D148087
2022-06-04 02:22:46 +00:00
James Teh
d95ab86a63 Bug 1771931 part 1: Clean up CachedTableAccessibles when a DocAccessibleParent is destroyed. r=morgan
When a DocAccessibleParent is destroyed, we don't call Shutdown on its RemoteAccessibles to avoid pointless cleanup overhead.
Previously, this meant we weren't cleaning up associated CachedTableAccessibles.
We now explicitly clean these up in DocAccessibleParent::Destroy.

Differential Revision: https://phabricator.services.mozilla.com/D148086
2022-06-04 02:22:46 +00:00
James Teh
9d9377be5e Bug 1699339: Fire name/description change event when text in a hidden aria-labelledby/describedby subtree changes. r=eeejay,morgan
We already handled this for visible aria-labelledby/describedby subtrees based on a11y events.
However, when a subtree is hidden (whether via CSS or aria-hidden), it is completely removed from the a11y tree, so we can't use a11y events.
Instead, when a node is added to the DOM, we walk its ancestors looking for an aria-labelledby/describedby target.
We stop if the node or an ancestor has an Accessible, since that means it will be handled elsewhere.
This also limits the number of ancestors we walk for each inserted node, thus decreasing the performance impact of this change.
This doesn't catch all possible mutations in a hidden subtree (e.g. removals or direct text node changes), but this at least fixes a case in Gmail.
Given performance risks, I think it makes sense to address specific cases as they arise.

Differential Revision: https://phabricator.services.mozilla.com/D147559
2022-06-04 02:20:54 +00:00
Jonathan Kew
f117f58e47 Bug 1771609 - patch 3 - Remove nsAutoLineIterator, as it no longer serves any useful purpose since the iterator is owned by the target frame. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D147579
2022-06-03 22:05:36 +00:00
Eitan Isaacson
9a0fb5f823 Bug 1772032 - Use DOM document node for getting SessionAcc instance. r=Jamie
Remove assert for doc to be last accessible to be removed because
in a doc shutdown scenario it will be the first to be removed.

Differential Revision: https://phabricator.services.mozilla.com/D148045
2022-06-02 22:10:04 +00:00
Norisz Fay
6cb54103b1 Backed out changeset 516dad1c0595 (bug 1772032) for causing geckoview-junit failures CLOSED TREE 2022-06-02 22:43:15 +03:00
Eitan Isaacson
c6fb2fffb7 Bug 1772032 - Use DOM document node for getting SessionAcc instance. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D148045
2022-06-02 19:01:14 +00:00
James Teh
52b0b92e8d Bug 1766546: Implement SetCaretOffset for cached Windows RemoteAccessible. r=morgan
We implement setting of the caret using HyperText rather than TextLeafPoint because caret stuff, including events, still uses HyperText internally for now.

This moves the async IPDL method already used on non-Windows into the base classes so Windows can use it.
We keep the COM implementation for Windows RemoteAccessible without the cache.
SetCaretOffset was moved into HyperTextAccessibleBase and platform methods were updated accordingly.
Finally, I did some drive-by cleanup (no user impact) and changed GetCaretOffset in ATK and XPCOM to use HyperTextAccessibleBase.
GetCaretOffset was moved to the base some time ago, but ATK and XPCOM weren't updated at the time.

Differential Revision: https://phabricator.services.mozilla.com/D147852
2022-06-01 19:34:09 +00:00
James Teh
5f868bebc7 Bug 1771736 part 2: Only push a cache update for text if the text actually changes. r=morgan
Layout sends a11y text update notifications during reflow even if the text hasn't changed.
TextUpdater already detects this case, so just move our cache update calls to TextUpdater.

Differential Revision: https://phabricator.services.mozilla.com/D147656
2022-06-01 00:35:26 +00:00
James Teh
1fcd045e66 Bug 1771736 part 1: Update cached spelling errors when a spelling error is removed. r=morgan,smaug
I originally thought we didn't need to be explicitly notified about removals because a correction always triggers a text change and we push a cache update for spelling errors whenever the text changes.
However, it seems that even when a correction is made and the text changes, the spell check ranges aren't yet up to date.
Previously, we were pushing a cache update whenever text was reflowed, which was taking care of this.
Soon, we don't want to push text cache updates if the text doesn't actually change.
We remove the reliance on these redundant text updates by having an explicit notification for spell check removals.

Differential Revision: https://phabricator.services.mozilla.com/D147655
2022-06-01 00:35:26 +00:00
James Teh
8cda799e04 Bug 1756728 part 3: Remove now unused PDocAccessible::URL. r=morgan,ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D147718
2022-06-01 00:34:18 +00:00
James Teh
196146ecb6 Bug 1756728 part 2: Support retrieving the URL for cached remote documents. r=morgan
The BrowsingContext already has this information, so we use that instead of redundantly caching it in RemoteAccessible.
This implementation works even when the a11y cache is disabled, so stop using the sync IPDL URL method.
We can't entirely unify the URL method because we don't have a base class for local/remote documents.
However, a method was added in nsAccUtils to unify this as much as possible.

Differential Revision: https://phabricator.services.mozilla.com/D147717
2022-06-01 00:34:17 +00:00
James Teh
4d3f66b120 Bug 1756728 part 1: Make it possible to retrieve a BrowsingContext from a DocAccessibleParent. r=morgan
Previously, even for remote in-process iframes, it was only possible to retrieve the top level BrowsingContext for the remote process by getting the managing BrowserParent.
This makes it possible to get the correct BrowsingContext even for in-process iframes.

Differential Revision: https://phabricator.services.mozilla.com/D147716
2022-06-01 00:34:17 +00:00
Eitan Isaacson
766f8978fc Bug 1772019 - Wait for PresShell to be initialized before doing WillRefresh tick. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D147812
2022-05-31 22:56:32 +00:00
Eitan Isaacson
efc6b17146 Bug 1771271 - Check for mCachedFields for all remote accessibles in BoundsWithOffset. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D147791
2022-05-31 19:24:27 +00:00
serge-sans-paille
d815003637 Bug 1771369 - Cleanup accessible/atk includes r=sylvestre DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D147445
2022-05-31 10:06:54 +00:00
Emilio Cobos Álvarez
9c190fff4b Bug 1771564 - Constify ComputedStyle usage in nsComputedDOMStyle. r=dholbert
None of the consumer need to mutate styles, and this saves some ugly
const_casting on the next patch.

Doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D147555
2022-05-28 01:04:24 +00:00
James Teh
0dd4ed02ef Bug 1737919 part 5: Add tests for cached spelling errors. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D147245
2022-05-27 10:56:41 +00:00
James Teh
7564ed957c Bug 1737919 part 4: Update cached spelling errors when a spelling error is added without the text changing. r=morgan,smaug
We already have an nsISelectionListener, but that only tells us that a change happened somewhere in the selection, not which range changed.
We don't want to push a cache update for all ranges when only one changed.
Therefore, this patch adds an accessibility notification in mozInlineSpellChecker::AddRange.
We don't need this for removed ranges because the text will change for any spelling error corrections and text updates trigger spelling error cache updates.

Differential Revision: https://phabricator.services.mozilla.com/D147244
2022-05-27 10:56:41 +00:00
James Teh
3daa72eb49 Bug 1737919 part 3: Support spelling errors for cached RemoteAccessibles. r=morgan
Even though spelling errors can cross Accessibles and are represented in the DOM as ranges, we cache them for each text leaf.
This is necessary so that we correctly update the offsets when text is inserted or removed from a leaf.
We cache them as an array of offsets, including both the start and end offset for each range.
We use -1 as the start offset to indicate when a spelling error starts in a previous Accessible.
When a spelling error starts in an Accessible but ends in a subsequent one, we simply don't include an end offset in the array.
This structure means we can easily query spelling error points or ranges with a binary search.

Differential Revision: https://phabricator.services.mozilla.com/D147243
2022-05-27 10:56:41 +00:00
James Teh
e02ce0a43e Bug 1737919 part 2: Support spelling errors in TextLeafPoint for LocalAccessibles. r=morgan
The implementation searches for spelling errors in each leaf, as this is how we will need to do it for RemoteAccessibles.

Differential Revision: https://phabricator.services.mozilla.com/D147242
2022-05-27 10:56:40 +00:00
James Teh
efe397519e Bug 1737919 part 1: TextLeafPoint::FindTextAttrsStart: Don't allow the caller to supply origin attributes. r=morgan
This was done for LocalAccessibles to avoid the need to fetch attributes twice when we're simultaneously fetching boundaries and returning the attributes to a client.
However, GetTextAttributes will soon handle spelling errors, so it will no longer return the same data as GetTextAttributesLocalAcc (which doesn't handle spelling errors).
This breaks the equality checks in FindTextAttrsStart.
Aside from this, this argument was somewhat confusing.

For now, just remove aOriginAttrs, which means there will be some redundant calls to GetTextAttributesLocalAcc.
Parent process documents shouldn't be that large anyway.
If this ends up being a real problem, we can either revert to the local HyperTextAccessible implementation of text attributes or implement a smarter temporary cache.

Differential Revision: https://phabricator.services.mozilla.com/D147241
2022-05-27 10:56:40 +00:00
James Teh
732a2400fe Bug 1771259: Fix crash when calling TextLeafPoint::CharBounds on the insertion point at the end of a text box. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D147397
2022-05-27 03:00:34 +00:00
James Teh
447e69d94a Bug 1769166: Update the cache when text bounds change. r=morgan
We detect this in the same way that we detect whether we need to push line starts; i.e. a text update or a bounds change.
Since this is tied to the Text and Bounds domains, I removed the separate TextBounds domain.

Differential Revision: https://phabricator.services.mozilla.com/D147396
2022-05-27 03:00:34 +00:00
James Teh
0ea37698e8 Bug 1771060: Make use of the line cursor in IsLocalAccAtLineStart to improve performance. r=jfkthame
For block frames, nsLineIterator doesn't use the line cursor, so switch to nsBlockInFlowLineIterator.
We don't actually care about the line number here anyway.

Differential Revision: https://phabricator.services.mozilla.com/D147237
2022-05-27 01:22:07 +00:00
James Teh
a5eb156496 Bug 1770162: Fix MsaaIdGenerator timer assertion during shutdown. r=morgan
There can be LocalAccessibles which don't die until the final cycle collection during XPCOM shutdown.
MsaaIdGenerator::ReleaseID (called during deletion of a LocalAccessible) uses a timer when the cache is enabled, but timers can't be used after XPCOM shutdown.
This was causing an assertion.
In addition, because MsaaIdGenerator is a static instance, the timer could be deleted after XPCOM shutdown, causing a warning.
To fix this:

1. If accessibility is shut down, just release ids immediately.
2. Clean up any remaining ids and the timer on XPCOM shutdown.

A better solution would be to create and terminate MsaaIdGenerator during a11y startup and shutdown, but this is a bit tricky while we still have the non-cache code paths.
Once we don't need the non-cache code, MsaaIdGenerator will become a lot simpler, so this refactor will be easier then.

Differential Revision: https://phabricator.services.mozilla.com/D146866
2022-05-23 22:05:52 +00:00
Morgan Rae Reschenberg
c3d3119342 Bug 1768054: Traverse embedded chars when computing text bounds. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D145908
2022-05-23 21:43:12 +00:00
Florian Quèze
cd5e71dee5 Bug 1745024 - avoid keeping an 'Accessibility notifications' refresh observer for initial about:blank documents, r=Jamie.
Differential Revision: https://phabricator.services.mozilla.com/D143747
2022-05-21 00:23:09 +00:00
Eitan Isaacson
c42dbc8b0f Bug 1769640 - P1: Cache content AUPDP in DocAccessibleParents. r=morgan,emilio
This change allows us to remove the `FullZoom` multiplier and fixes text
bounds caclulations in a zoomed page.

Testing: The current browser scroll/bounds tests pass (with the
exception of fission iframes which were already broken).

Differential Revision: https://phabricator.services.mozilla.com/D146507
2022-05-20 16:39:50 +00:00
Mark Banner
7c198e01fd Bug 1769569 - Fix remaining ESLint no-undef and no-unused-vars issues in sjs files. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D146452
2022-05-18 08:13:19 +00:00
Andrew McCreight
c8c5c819df Bug 1514936, part 1 - Remove the outer argument to nsIFactory::createInstance. r=xpcom-reviewers,preferences-reviewers,nika,Gijs
This patch won't actually build, because a few bits of code are used
for both nsIFactory::createInstance and static components, and static
components are not fixed until the next patch.

The first place is nsLoadGroupConstructor, which uses an nsIFactory
macro to create a static component constructor. (This could be worked
around by expanding the macro to the state before this patch.)

The other issue is that nsAppShellConstructor is used in an nsIFactory
on OSX, but as a static component on all other platforms. This could
be worked around by wrapping nsAppShellConstructor in an adaptor that
passes in the extra null argument to nsAppShellConstructor.

Differential Revision: https://phabricator.services.mozilla.com/D146456
2022-05-17 20:24:19 +00:00
Sebastian Hengst
c552340e0c Backed out 5 changesets (bug 1769569) for causing devtools' browser/browser_page_redirection.js to fail. CLOSED TREE
Backed out changeset 66a42eb3a366 (bug 1769569)
Backed out changeset d3cc9629cd9a (bug 1769569)
Backed out changeset edcd3dade079 (bug 1769569)
Backed out changeset 29d8dd058b7a (bug 1769569)
Backed out changeset 1aed34fdf2d3 (bug 1769569)
2022-05-17 19:49:17 +02:00
Mark Banner
5865f044db Bug 1769569 - Fix remaining ESLint no-undef and no-unused-vars issues in sjs files. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D146452
2022-05-17 16:50:33 +00:00
James Teh
592446771c Bug 1768219: Don't walk ancestors on all Accessibles to find an action when serialising the IPC tree. r=eeejay
This was causing a performance regression.
We now only do this for text leaf and image Accessibles, which gets us back to where we were before bug 1395181.
This means we can't support "click ancestor" on ATK.
There weren't requests for this on ATK anyway.
In future, we can probably support this using the information in the cache.

Differential Revision: https://phabricator.services.mozilla.com/D146528
2022-05-17 06:31:45 +00:00
Nika Layzell
2b307c5cea Bug 1754004 - Part 2: Remove the PFileDescriptorSet interface, r=asuth,necko-reviewers,kershaw
This interface should no longer be required due to the changes in part 1
limiting the complexity of IPCStream instances and limiting the number of file
descriptors which a single stream can attach to a message.

Removing this interface is necessary to serialize nsIInputStream instances over
arbitrary toplevel protocols and non-protocol IPC in the future.

Differential Revision: https://phabricator.services.mozilla.com/D141039
2022-05-13 14:16:09 +00:00
Eitan Isaacson
dbd21dbf8b Bug 1768927 - Preload localized role strings and heading levels at init. r=Jamie
We can't use the StringBundle object off the main thread. We need to
pre-load all the strings we may use. This is a small set of roles. We
also need formatted heading levels, so we preload heading level 1 to 6.

Differential Revision: https://phabricator.services.mozilla.com/D146112
2022-05-13 05:00:55 +00:00
Eitan Isaacson
85225ac3d9 Bug 1768972 - Introduce FireEvent to avoid android monitor lock reentry. r=Jamie
We rely on Recv events to be called from child processes and not from
other Recv events. If this happens we risk reentry in regards to the
android monitor lock. So this patch introduces FireEvent for internal
use where secondary events need to be fired like a reorder when a new
sub-document is added.

Differential Revision: https://phabricator.services.mozilla.com/D146134
2022-05-12 22:41:44 +00:00
Eitan Isaacson
4bec8d9205 Bug 1768913 - Don't send window content changed event when loaded about:blank. r=morgan
Testing note - this enables junit tests to start and pass more reliably
when caching is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D146106
2022-05-11 22:09:12 +00:00
Morgan Reschenberg
5e491aa675 Bug 1763212: Add tests for vertical text caching r=Jamie
Depends on D143527

Differential Revision: https://phabricator.services.mozilla.com/D144893
2022-05-11 20:47:36 +00:00
Noemi Erli
45276205df Backed out 22 changesets (bug 1696894, bug 1759569, bug 1754031, bug 1759563, bug 1759572, bug 1754004) for causing leack failures CLOSED TREE
Backed out changeset 673ecd5337e1 (bug 1754004)
Backed out changeset ecbf5f3c51de (bug 1754004)
Backed out changeset fc6c39f56d21 (bug 1754004)
Backed out changeset 5b3d58fbaf9d (bug 1696894)
Backed out changeset 2e56c89cf55d (bug 1754004)
Backed out changeset b7723490f025 (bug 1754004)
Backed out changeset 1dfbf61ff5dd (bug 1754004)
Backed out changeset e73abb071bb3 (bug 1754004)
Backed out changeset f9abe4fbf501 (bug 1754004)
Backed out changeset ee7aeb631cd9 (bug 1754004)
Backed out changeset d66aacfcf983 (bug 1754004)
Backed out changeset 5c2872ad6912 (bug 1754004)
Backed out changeset e1ae48f30d2c (bug 1754004)
Backed out changeset 849b63707d7f (bug 1754004)
Backed out changeset 36563e3b1e04 (bug 1754004)
Backed out changeset ccb4be659107 (bug 1754004)
Backed out changeset 659581d4159b (bug 1754004)
Backed out changeset 611ea76d7a9c (bug 1754004)
Backed out changeset 9b24b561698c (bug 1759572)
Backed out changeset f820e0f209ff (bug 1759563)
Backed out changeset 8d82066fa181 (bug 1759569)
Backed out changeset a2835afab1ad (bug 1754031)
2022-05-11 06:16:25 +03:00
Eitan Isaacson
7e7246091a Bug 1768726 - Make RemoteAccessibleBase::BoundsWithOffset thread safe for Android. r=morgan
In Android we need to keep the remote accessible methods thread safe. That means no direct references to local accessibles, or anything DOM or layout.

We have the advantage of always being remote except for a 0 offset browser element, and no support for full page zoom.

Also removed the visual/layout viewport offset in the bounds method since
the top level doc will always have its visual and layout viewport match.

Differential Revision: https://phabricator.services.mozilla.com/D146006
2022-05-10 22:57:32 +00:00
James Teh
780d656a9c Bug 1768391: Invalidate the remote HyperText offsets cache when we mutate the tree. r=eeejay
Previously, we invalidated this cache when the reorder event arrived.
Because the mutation and the reorder event happen in separate IPDL calls, it's possible for a client call to arrive between them.
If that client call queried HyperText offsets, this could result in returning incorrect information to the client or even a parent process crash.
Now, we invalidate the cache during the mutation, so there's no possibility of an intervening client call.
It made sense to put this invalidation call in RemoteAccessibleBase, so I also moved the call to invalidate for text leaf updates into RemoteAccessibleBase so that they're both in the same class.

Differential Revision: https://phabricator.services.mozilla.com/D145845
2022-05-10 22:56:57 +00:00
Nika Layzell
728ba534f6 Bug 1754004 - Part 2: Remove the PFileDescriptorSet interface, r=asuth,necko-reviewers,kershaw
This interface should no longer be required due to the changes in part 1
limiting the complexity of IPCStream instances and limiting the number of file
descriptors which a single stream can attach to a message.

Removing this interface is necessary to serialize nsIInputStream instances over
arbitrary toplevel protocols and non-protocol IPC in the future.

Differential Revision: https://phabricator.services.mozilla.com/D141039
2022-05-10 22:27:42 +00:00
James Teh
3a25e381f9 Bug 1766270: Null check IPCDoc() in Android DocAccessibleWrap::CacheViewportCallback. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D145847
2022-05-10 22:19:53 +00:00
James Teh
be0257f0e6 Bug 1767887: Fix TextLeafPoint paragraph boundary search for the second leaf Accessible and beyond after a block. r=morgan
The code checks whether the origin is inside the block, since if not, the block ends before the origin.
However, it previously didn't handle the case where there was a leaf outside the block between the block and the origin.
An additional check has now been added to handle this case.
This required the code to be restructured somewhat, which hopefully also makes it easier to read/debug.

Differential Revision: https://phabricator.services.mozilla.com/D145867
2022-05-09 23:41:02 +00:00
Morgan Reschenberg
4e6096c73d Bug 1735101: Cache char, line coordinate info to support computing TextBounds and CharBounds in the parent process r=Jamie
Depends on D144767

Differential Revision: https://phabricator.services.mozilla.com/D143527
2022-05-09 20:30:27 +00:00
James Teh
7d2201e688 Bug 1192108: Fire focus events after mutation events but before any other events. r=eeejay
It's critical that we fire mutation events first because our RemoteAccessible tree is created thus and we can't fire events on RemoteAccessibles we haven't created yet.
Beyond that, though, focus events are of primary importance.
See the comments in EventQueue::ProcessEventQueue for the reasons.

Differential Revision: https://phabricator.services.mozilla.com/D145319
2022-05-06 23:59:43 +00:00
Cristian Tuns
3a72bf74a9 Backed out changeset a83bfbf2de62 (bug 1735101) for causing mochitest failures on browser_caching_text_bounds.js CLOSED TREE 2022-05-06 17:35:52 -04:00
Morgan Reschenberg
f40daec464 Bug 1735101: Cache char, line coordinate info to support computing TextBounds and CharBounds in the parent process r=Jamie
Depends on D144767

Differential Revision: https://phabricator.services.mozilla.com/D143527
2022-05-06 20:10:59 +00:00
Noemi Erli
39469989c9 Backed out 22 changesets (bug 1759572, bug 1759563, bug 1754004, bug 1754031, bug 1759569, bug 1696894) for causing multiple failures CLOSED TREE
Backed out changeset d69647a725a1 (bug 1754004)
Backed out changeset 09fc506865d7 (bug 1754004)
Backed out changeset 648e3dd4b62f (bug 1754004)
Backed out changeset 3465158ee230 (bug 1696894)
Backed out changeset b08475bbfbd9 (bug 1754004)
Backed out changeset dfabce587a56 (bug 1754004)
Backed out changeset cebe8d5dda34 (bug 1754004)
Backed out changeset 55b4b0c9a504 (bug 1754004)
Backed out changeset e8649de9dd22 (bug 1754004)
Backed out changeset 0f480fc861c0 (bug 1754004)
Backed out changeset e515b7edd1c8 (bug 1754004)
Backed out changeset fe90db9158ac (bug 1754004)
Backed out changeset c6388d682d48 (bug 1754004)
Backed out changeset 2374420d9fed (bug 1754004)
Backed out changeset 44dfd76472aa (bug 1754004)
Backed out changeset 000fb99de0cf (bug 1754004)
Backed out changeset 0ca1856b5fc9 (bug 1754004)
Backed out changeset 10c3683b998b (bug 1754004)
Backed out changeset 4abc98ed6b99 (bug 1759572)
Backed out changeset cdd271a5af42 (bug 1759563)
Backed out changeset fadb6cc0d81c (bug 1759569)
Backed out changeset 44be9709a93e (bug 1754031)
2022-05-06 04:28:47 +03:00
Nika Layzell
0308ac11a4 Bug 1754004 - Part 2: Remove the PFileDescriptorSet interface, r=asuth,necko-reviewers,kershaw
This interface should no longer be required due to the changes in part 1
limiting the complexity of IPCStream instances and limiting the number of file
descriptors which a single stream can attach to a message.

Removing this interface is necessary to serialize nsIInputStream instances over
arbitrary toplevel protocols and non-protocol IPC in the future.

Differential Revision: https://phabricator.services.mozilla.com/D141039
2022-05-05 23:34:21 +00:00
James Teh
65c8359c0d Bug 1766794: Lazily cache HyperText offsets for RemoteAccessibles. r=eeejay
We already had a similar cache in local HyperTextAccessible.
This improves performance significantly when walking the text attributes of a container with a large number of text leaf children, such as is encountered when using view source.
This patch unifies that cache across local and remote.
For simplicity, the cache invalidation strategy is more naive/aggressive.

Differential Revision: https://phabricator.services.mozilla.com/D145079
2022-05-05 11:14:12 +00:00
Sebastian Hengst
400d67b480 Merge autoland to mozilla-central. a=merge 2022-05-05 11:38:28 +02:00
Sebastian Hengst
7ddbeea9d6 Backed out 17 changesets (bug 1696894, bug 1754004) for causing crashes e.g. bug 1767808, and hanging Gmail (bug 1767918). a=backout DONTBUILD
Backed out changeset 63f17a06eba9 (bug 1754004)
Backed out changeset 017e1552d549 (bug 1754004)
Backed out changeset 010dfd821cf3 (bug 1696894)
Backed out changeset 96a39c2ba7a3 (bug 1754004)
Backed out changeset a147df47a0e3 (bug 1754004)
Backed out changeset 9018dd592230 (bug 1754004)
Backed out changeset 234ff9e092c2 (bug 1754004)
Backed out changeset c4f1e86992b6 (bug 1754004)
Backed out changeset 51bd50b57dd5 (bug 1754004)
Backed out changeset d95e7ad0eafa (bug 1754004)
Backed out changeset 35a69828091c (bug 1754004)
Backed out changeset 6802a4326963 (bug 1754004)
Backed out changeset e40e810e18fc (bug 1754004)
Backed out changeset 82b38c12b298 (bug 1754004)
Backed out changeset 0a6cf0817bf5 (bug 1754004)
Backed out changeset 6d8e51b3e8d7 (bug 1754004)
Backed out changeset 2059c2d0d880 (bug 1754004)
2022-05-05 11:27:42 +02:00
Butkovits Atila
7854b3ad09 Backed out changeset a81a40b250b4 (bug 1766794) for causing marionette failures. CLOSED TREE 2022-05-05 08:42:09 +03:00
James Teh
3754f65b27 Bug 1766794: Lazily cache HyperText offsets for RemoteAccessibles. r=eeejay
We already had a similar cache in local HyperTextAccessible.
This improves performance significantly when walking the text attributes of a container with a large number of text leaf children, such as is encountered when using view source.
This patch unifies that cache across local and remote.
For simplicity, the cache invalidation strategy is more naive/aggressive.

Differential Revision: https://phabricator.services.mozilla.com/D145079
2022-05-05 04:31:12 +00:00
Narcis Beleuzu
d4b6401f96 Backed out changeset 337ded6c2bfd (bug 1192108) for geckoview failures on testMoveCaretAccessibilityFocus . CLOSED TREE 2022-05-05 04:17:34 +03:00
James Teh
b129b887c5 Bug 1192108: Fire focus events after mutation events but before any other events. r=eeejay
It's critical that we fire mutation events first because our RemoteAccessible tree is created thus and we can't fire events on RemoteAccessibles we haven't created yet.
Beyond that, though, focus events are of primary importance.
See the comments in EventQueue::ProcessEventQueue for the reasons.

Differential Revision: https://phabricator.services.mozilla.com/D145319
2022-05-04 20:35:14 +00:00
Eitan Isaacson
83568bcd62 Bug 1765433 - P3: Get bundle and do pivot in UI thread for remote accessibles. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D144896
2022-05-04 18:00:47 +00:00
Eitan Isaacson
239896a063 Bug 1765433 - P2: Add AccessibilityNodeInfo population methods. r=Jamie
We cannot use GeckoBundle anymore because it cannot be constructed in
the UI thread. Instead, have a set of populate methods that take
arguments and set the correct fields in the AccessibilityNodeInfo, or
its optional info objects.

These fields can be called both in the Gecko and UI thread.

Differential Revision: https://phabricator.services.mozilla.com/D144895
2022-05-04 18:00:47 +00:00
James Teh
4e792c6a29 Bug 1766954: TextLeafRange: Don't call nsIFrame::RenderedText for pre-formatted text. r=eeejay
For pre-formatted text, the content text and rendered text are the same.
Therefore, there's no point calling nsIFrame::RenderedText, which is quite slow for nodes containing a large chunk of text.
This improves performance significantly when caching line start offsets for large plain text files such as logs.

Differential Revision: https://phabricator.services.mozilla.com/D145080
2022-05-04 04:18:11 +00:00
Nika Layzell
310e31989e Bug 1754004 - Part 2: Remove the PFileDescriptorSet interface, r=asuth,necko-reviewers,kershaw
This interface should no longer be required due to the changes in part 1
limiting the complexity of IPCStream instances and limiting the number of file
descriptors which a single stream can attach to a message.

Removing this interface is necessary to serialize nsIInputStream instances over
arbitrary toplevel protocols and non-protocol IPC in the future.

Differential Revision: https://phabricator.services.mozilla.com/D141039
2022-05-03 23:30:32 +00:00
Mike Hommey
08edf30a1b Bug 1766561 - Add missing l modifier for long formatting. r=Jamie,media-playback-reviewers,gfx-reviewers,nika,necko-reviewers,mhowell,rkraesig,gerald,application-update-reviewers,bytesized,alwu,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D144917
2022-05-03 20:49:08 +00:00
Mike Hommey
f047620639 Bug 1766561 - Use proper formatting directives for LPARAM and WPARAM. r=Jamie,rkraesig
Unfortunately, while with MSVC one would use the `I` modifier to format
LPARAM/LONG_PTR, it doesn't work with clang-cl on 32-bits, because
LONG_PTR there is long, but `I` expects an int.

Differential Revision: https://phabricator.services.mozilla.com/D144916
2022-05-03 20:49:08 +00:00
Butkovits Atila
d0dadcb6f5 Backed out 19 changesets (bug 1759569, bug 1754004, bug 1759563, bug 1754031, bug 1696894, bug 1759572) for causing wpt failures. CLOSED TREE
Backed out changeset 110a8dce4b5d (bug 1696894)
Backed out changeset a62dab05c6cd (bug 1754004)
Backed out changeset 7cf122f6e19f (bug 1754004)
Backed out changeset 2aa9a0a9adbc (bug 1754004)
Backed out changeset cde16b2cdbfb (bug 1754004)
Backed out changeset 452fe0a15c99 (bug 1754004)
Backed out changeset eace8d4756ef (bug 1754004)
Backed out changeset 5e1fad91e935 (bug 1754004)
Backed out changeset eb6de0b1ab8e (bug 1754004)
Backed out changeset 1ac1908ed3d0 (bug 1754004)
Backed out changeset 473cad5b22ab (bug 1754004)
Backed out changeset 1923922be138 (bug 1754004)
Backed out changeset c7966d91f89e (bug 1754004)
Backed out changeset df5ce1f6712c (bug 1754004)
Backed out changeset a3f3f9761ada (bug 1754004)
Backed out changeset c8ec86e0a33b (bug 1759572)
Backed out changeset 6c102f8e3d4a (bug 1759563)
Backed out changeset bd3a2fcf4f0c (bug 1759569)
Backed out changeset 2541d8face65 (bug 1754031)
2022-05-03 06:00:22 +03:00
Butkovits Atila
c1773abb87 Backed out changeset 4e3e696ff054 (bug 1766954) for causing bustages at nsStyleStruct.h. CLOSED TREE 2022-05-03 03:43:58 +03:00
Butkovits Atila
c08407380b Backed out changeset e12dbde5824b (bug 1766794) for causing build bustages. CLOSED TREE 2022-05-03 01:57:32 +03:00
James Teh
4828f4d449 Bug 1766954: TextLeafRange: Don't call nsIFrame::RenderedText for pre-formatted text. r=eeejay
For pre-formatted text, the content text and rendered text are the same.
Therefore, there's no point calling nsIFrame::RenderedText, which is quite slow for nodes containing a large chunk of text.
This improves performance significantly when caching line start offsets for large plain text files such as logs.

Differential Revision: https://phabricator.services.mozilla.com/D145080
2022-05-02 22:40:43 +00:00
James Teh
5c02aef5a0 Bug 1766794: Lazily cache HyperText offsets for RemoteAccessibles.
We already have a similar cache in local HyperTextAccessible.
Unfortunately, we can't use common code here because we don't want to waste memory having a member variable on all RemoteAccessibles, but local HyperTextAccessibles don't have mCachedFields.
This improves performance significantly when walking the text attributes of a container with a large number of text leaf children, such as is encountered when using view source.

Differential Revision: https://phabricator.services.mozilla.com/D145079
2022-05-02 22:40:43 +00:00
James Teh
9c548e5244 Bug 1767169: When processing queued cache updates, ensure Accessibles haven't been detached from the document. r=eeejay
In bug 1739560, I moved the processing of queued cache updates before the firing of mutation events.
That means that Accessibles removed from the tree might not be shut down (and thus defunct) yet, since we have this limbo "not in document" state.
Therefore, as well as skipping defunct Accessibles, we must also skip Accessibles that are no longer in the document.

Differential Revision: https://phabricator.services.mozilla.com/D145176
2022-05-02 22:38:07 +00:00
James Teh
71595ec7c0 Bug 1767173: When retrieving the cached name, set name string to void when it is empty but not explicitly set empty using alt="". r=eeejay
This distinction between void and empty exists in LocalAccessible, so we should be consistent in RemoteAccessible.
This fixes exposure of explicit-name when the name is empty.
To facilitate this, we no longer assume the name flag is not in the cache just because the name string isn't in the cache, since it could be eNoNameOnPurpose.

Differential Revision: https://phabricator.services.mozilla.com/D145179
2022-05-02 22:37:24 +00:00
Nika Layzell
7cb1970841 Bug 1754004 - Part 2: Remove the PFileDescriptorSet interface, r=asuth,necko-reviewers,kershaw
This interface should no longer be required due to the changes in part 1
limiting the complexity of IPCStream instances and limiting the number of file
descriptors which a single stream can attach to a message.

Removing this interface is necessary to serialize nsIInputStream instances over
arbitrary toplevel protocols and non-protocol IPC in the future.

Differential Revision: https://phabricator.services.mozilla.com/D141039
2022-05-02 20:44:22 +00:00
Butkovits Atila
99ebfd6f14 Merge mozilla-central to autoland. CLOSED TREE 2022-04-29 12:59:59 +03:00
Butkovits Atila
6d3bc9da27 Merge autoland to mozilla-central. a=merge 2022-04-29 12:46:43 +03:00
Mike Hommey
e55237be4d Bug 1766377 - Fix sign-compare warnings related to Windows constants. r=rkraesig,gfx-reviewers,sotaro
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const unsigned long' and 'const long' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned long, long>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
toolkit/components/maintenanceservice/tests/gtest/ServiceStartInteractiveOnly.cpp(51,3): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned long, long, nullptr>' requested here
  ASSERT_EQ(GetLastError(), ERROR_ACCESS_DENIED);
  ^
obj-build/dist/include/gtest/gtest.h(1871,31): note: expanded from macro 'ASSERT_EQ'
                              ^
obj-build/dist/include/gtest/gtest.h(1855,54): note: expanded from macro 'GTEST_ASSERT_EQ'
  ASSERT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const unsigned long' and 'const long' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned long, long>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
toolkit/library/gtest/TestUCRTDepends.cpp(52,5): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned long, long, nullptr>' requested here
    EXPECT_EQ(GetLastError(), ERROR_FILE_NOT_FOUND);
    ^
obj-build/dist/include/gtest/gtest.h(1842,54): note: expanded from macro 'EXPECT_EQ'
  EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
ipc/chromium/src/base/thread_local_win.cc(18,14): error: comparison of integers of different signs: 'base::ThreadLocalPlatform::SlotType' (aka 'int') and 'DWORD' (aka 'unsigned long') [-Werror,-Wsign-compare]
  CHECK(slot != TLS_OUT_OF_INDEXES);
        ~~~~ ^  ~~~~~~~~~~~~~~~~~~

ipc/glue/WindowsMessageLoop.cpp(381,44): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare]
        if (objId == OBJID_CLIENT || objId == MOZOBJID_UIAROOT) {
                                     ~~~~~ ^  ~~~~~~~~~~~~~~~~
ipc/glue/WindowsMessageLoop.cpp(381,19): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'LONG' (aka 'long') [-Werror,-Wsign-compare]
        if (objId == OBJID_CLIENT || objId == MOZOBJID_UIAROOT) {
            ~~~~~ ^  ~~~~~~~~~~~~
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const unsigned long' and 'const long' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned long, long>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
xpcom/tests/windows/TestPoisonIOInterposer.cpp(108,5): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned long, long, nullptr>' requested here
    EXPECT_EQ(::GetLastError(), ERROR_IO_PENDING);
    ^
obj-build/dist/include/gtest/gtest.h(1842,54): note: expanded from macro 'EXPECT_EQ'
  EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
gfx/thebes/gfxGDIFont.cpp(454,13): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'HRESULT' (aka 'long') [-Werror,-Wsign-compare]
    if (ret == E_PENDING) {
        ~~~ ^  ~~~~~~~~~
accessible/windows/msaa/Compatibility.cpp(120,21): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'HRESULT' (aka 'long') [-Werror,-Wsign-compare]
  if (exceptionCode == RPC_E_CANTCALLOUT_ININPUTSYNCCALL && NS_IsMainThread()) {
      ~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
widget/windows/WinIMEHandler.cpp(166,35): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'LONG' (aka 'long') [-Werror,-Wsign-compare]
      static_cast<DWORD>(aLParam) == OBJID_CARET) {
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~
widget/windows/nsWindow.cpp(541,37): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'LONG' (aka 'long') [-Werror,-Wsign-compare]
        static_cast<DWORD>(aLParam) != OBJID_CLIENT ||
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~

Differential Revision: https://phabricator.services.mozilla.com/D144692
2022-04-29 09:14:11 +00:00
Norisz Fay
6e06e2da92 Backed out 4 changesets (bug 1766377) for causing mochitest failures on HyperTextAccessible.cpp CLOSED TREE
Backed out changeset 6335511477a4 (bug 1766377)
Backed out changeset e8108d6fab9f (bug 1766377)
Backed out changeset 80d16d55c490 (bug 1766377)
Backed out changeset 1a6583d6e52e (bug 1766377)
2022-04-29 07:35:11 +03:00
James Teh
acf1d4f77c Bug 1739560: Update line starts in the cache when they change. r=morgan
If text or bounds change, it's very likely that line starts have changed too, so we push an update for them.
However, if a non-rectangular text span changes its line wrapping without changing its text, the bounds might not change.
In that case, we still get a bounds cache update request; we just determine not to push bounds.
This happens a lot, though.
To limit this, we compare against the cached first line start in LocalAccessible and push an update only if it's different.

If text and bounds both change, we don't want to push two separate cache updates.
We use queued cache updates to prevent this.
This necessitated moving where we send queued cache updates so that we do it before firing mutation events, since clients might need the text to be up to date when handling those events.

Differential Revision: https://phabricator.services.mozilla.com/D144949
2022-04-29 00:44:11 +00:00
Mike Hommey
4f1f2540f6 Bug 1766377 - Fix sign-compare warnings related to IDL constants. r=anti-tracking-reviewers,necko-reviewers,kershaw,timhuang
dom/network/TCPSocket.cpp(973,38): error: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'nsISocketTransport::(unnamed enum at obj-aarch64-pc-mingw32/dist/include/nsISocketTransport.h:102:3)' [-Werror,-Wsign-compare]
  if (static_cast<uint32_t>(aStatus) !=
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
dom/security/ReferrerInfo.cpp(216,26): error: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'nsIWebProgressListener::(unnamed enum at obj-aarch64-pc-mingw32/dist/include/nsIWebProgressListener.h:41:3)' [-Werror,-Wsign-compare]
          rejectedReason !=
          ~~~~~~~~~~~~~~ ^
toolkit/components/antitracking/StorageAccess.cpp(175,23): error: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'nsIWebProgressListener::(unnamed enum at obj-aarch64-pc-mingw32/dist/include/nsIWebProgressListener.h:41:3)' [-Werror,-Wsign-compare]
  if (aRejectedReason ==
      ~~~~~~~~~~~~~~~ ^
toolkit/components/antitracking/StorageAccess.cpp(415,26): error: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'nsIWebProgressListener::(unnamed enum at obj-aarch64-pc-mingw32/dist/include/nsIWebProgressListener.h:41:3)' [-Werror,-Wsign-compare]
         aRejectedReason ==
         ~~~~~~~~~~~~~~~ ^
toolkit/components/antitracking/StorageAccess.cpp(428,26): error: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'nsIWebProgressListener::(unnamed enum at obj-aarch64-pc-mingw32/dist/include/nsIWebProgressListener.h:41:3)' [-Werror,-Wsign-compare]
  return aRejectedReason ==
         ~~~~~~~~~~~~~~~ ^

Differential Revision: https://phabricator.services.mozilla.com/D144693
2022-04-29 00:43:31 +00:00
Mike Hommey
c7ad9c4633 Bug 1766377 - Fix sign-compare warnings related to Windows constants. r=rkraesig,gfx-reviewers,sotaro
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const unsigned long' and 'const long' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned long, long>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
toolkit/components/maintenanceservice/tests/gtest/ServiceStartInteractiveOnly.cpp(51,3): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned long, long, nullptr>' requested here
  ASSERT_EQ(GetLastError(), ERROR_ACCESS_DENIED);
  ^
obj-build/dist/include/gtest/gtest.h(1871,31): note: expanded from macro 'ASSERT_EQ'
                              ^
obj-build/dist/include/gtest/gtest.h(1855,54): note: expanded from macro 'GTEST_ASSERT_EQ'
  ASSERT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const unsigned long' and 'const long' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned long, long>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
toolkit/library/gtest/TestUCRTDepends.cpp(52,5): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned long, long, nullptr>' requested here
    EXPECT_EQ(GetLastError(), ERROR_FILE_NOT_FOUND);
    ^
obj-build/dist/include/gtest/gtest.h(1842,54): note: expanded from macro 'EXPECT_EQ'
  EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
ipc/chromium/src/base/thread_local_win.cc(18,14): error: comparison of integers of different signs: 'base::ThreadLocalPlatform::SlotType' (aka 'int') and 'DWORD' (aka 'unsigned long') [-Werror,-Wsign-compare]
  CHECK(slot != TLS_OUT_OF_INDEXES);
        ~~~~ ^  ~~~~~~~~~~~~~~~~~~

ipc/glue/WindowsMessageLoop.cpp(381,44): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare]
        if (objId == OBJID_CLIENT || objId == MOZOBJID_UIAROOT) {
                                     ~~~~~ ^  ~~~~~~~~~~~~~~~~
ipc/glue/WindowsMessageLoop.cpp(381,19): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'LONG' (aka 'long') [-Werror,-Wsign-compare]
        if (objId == OBJID_CLIENT || objId == MOZOBJID_UIAROOT) {
            ~~~~~ ^  ~~~~~~~~~~~~
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const unsigned long' and 'const long' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned long, long>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
xpcom/tests/windows/TestPoisonIOInterposer.cpp(108,5): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned long, long, nullptr>' requested here
    EXPECT_EQ(::GetLastError(), ERROR_IO_PENDING);
    ^
obj-build/dist/include/gtest/gtest.h(1842,54): note: expanded from macro 'EXPECT_EQ'
  EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
gfx/thebes/gfxGDIFont.cpp(454,13): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'HRESULT' (aka 'long') [-Werror,-Wsign-compare]
    if (ret == E_PENDING) {
        ~~~ ^  ~~~~~~~~~
accessible/windows/msaa/Compatibility.cpp(120,21): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'HRESULT' (aka 'long') [-Werror,-Wsign-compare]
  if (exceptionCode == RPC_E_CANTCALLOUT_ININPUTSYNCCALL && NS_IsMainThread()) {
      ~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
widget/windows/WinIMEHandler.cpp(166,35): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'LONG' (aka 'long') [-Werror,-Wsign-compare]
      static_cast<DWORD>(aLParam) == OBJID_CARET) {
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~
widget/windows/nsWindow.cpp(541,37): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'LONG' (aka 'long') [-Werror,-Wsign-compare]
        static_cast<DWORD>(aLParam) != OBJID_CLIENT ||
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~

Differential Revision: https://phabricator.services.mozilla.com/D144692
2022-04-29 00:43:31 +00:00
Morgan Reschenberg
32487fa3e7 Bug 1763214: Convert ImagePosition, ImageSize to use cached bounds r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D142996
2022-04-28 17:03:49 +00:00
Morgan Reschenberg
278582922a Bug 1763191: Add suppport for cached remote accessibles in coordinate conversion functions r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D142970
2022-04-28 16:58:19 +00:00
James Teh
16c792ed33 Bug 1766560: Don't ignore the first line start of a RemoteAccessible when retrieving the next line. r=morgan
The code previously returned failure for array index 0, but it did this for both movement directions.
It should only do this for eDirPrevious, since we decrement index in that case.

Differential Revision: https://phabricator.services.mozilla.com/D144785
2022-04-28 10:42:11 +00:00
Butkovits Atila
19ed218d60 Backed out changeset a901a6c26367 (bug 1766560) for causing failures at browser_caching_text. CLOSED TREE 2022-04-28 05:47:17 +03:00
James Teh
60745bde34 Bug 1748393: Fire a name change event when a document's title changes. r=morgan
This causes the cache to be updated.

Differential Revision: https://phabricator.services.mozilla.com/D144770
2022-04-28 02:12:29 +00:00
James Teh
ff8c09efee Bug 1766560: Don't ignore the first line start of a RemoteAccessible when retrieving the next line. r=morgan
The code previously returned failure for array index 0, but it did this for both movement directions.
It should only do this for eDirPrevious, since we decrement index in that case.

Differential Revision: https://phabricator.services.mozilla.com/D144785
2022-04-28 02:11:53 +00:00
James Teh
6743bc23ee Bug 1766206: TextLeafPoint: When determining whether an Accessible is at the start of a line, compare with the last continuation of the previous leaf. r=morgan
Previously, we were always comparing with the primary frame of the previous leaf.
If the previous leaf crossed lines, this meant we incorrectly reported that the following leaf started a new line even if it didn't, since the primary frame of the previous leaf was always on a different line.
Now, we use the last continuation (line) of the previous leaf.
This way, if the next leaf continues the final line of the previous leaf, they will have the same line number and so we won't incorrectly report that the next leaf starts a new line.

Differential Revision: https://phabricator.services.mozilla.com/D144781
2022-04-28 02:09:16 +00:00
Eitan Isaacson
9995cf770e Bug 1765430 - P4: Remove RemoteAccessibleWrap. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D144483
2022-04-27 22:44:46 +00:00
Eitan Isaacson
c9311969b2 Bug 1765430 - P3: Refactor Android Pivot methods. r=Jamie
This creates a clearer distinction between local pivots and remote
pivots. The former happens in the parent process and the latter happens
in the remote content process.

Differential Revision: https://phabricator.services.mozilla.com/D144482
2022-04-27 22:44:45 +00:00
Eitan Isaacson
f45be3470b Bug 1765430 - P2: Manage Android accessible/id mappings in SessionAccessibility. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D144481
2022-04-27 22:44:45 +00:00
Eitan Isaacson
15f4639e31 Bug 1765430 - P1: Move ToBundle to SessionAccessibility. r=Jamie
Since remote accessibles won't share AccessibleWrap as a base class
anymore this can't be an instance method. Move it to
SessionAccessibility, the sole consumer.

Note: ToBundle will hopefully get removed entirely once CTW is fully adopted.

Differential Revision: https://phabricator.services.mozilla.com/D144480
2022-04-27 22:44:45 +00:00
Butkovits Atila
20e2d30582 Backed out 4 changesets (bug 1765430) for causing android bustage. CLOSED TREE
Backed out changeset 72e27e3813d3 (bug 1765430)
Backed out changeset 47bbf5bd9315 (bug 1765430)
Backed out changeset e8161b463a3b (bug 1765430)
Backed out changeset 30c05f76d21e (bug 1765430)
2022-04-28 01:15:37 +03:00
Eitan Isaacson
3ee5a34515 Bug 1765430 - P4: Remove RemoteAccessibleWrap. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D144483
2022-04-27 21:01:36 +00:00
Eitan Isaacson
4dd84acb54 Bug 1765430 - P3: Refactor Android Pivot methods. r=Jamie
This creates a clearer distinction between local pivots and remote
pivots. The former happens in the parent process and the latter happens
in the remote content process.

Differential Revision: https://phabricator.services.mozilla.com/D144482
2022-04-27 21:01:36 +00:00
Eitan Isaacson
a010f500aa Bug 1765430 - P2: Manage Android accessible/id mappings in SessionAccessibility. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D144481
2022-04-27 21:01:35 +00:00
Eitan Isaacson
d5e1e3314e Bug 1765430 - P1: Move ToBundle to SessionAccessibility. r=Jamie
Since remote accessibles won't share AccessibleWrap as a base class
anymore this can't be an instance method. Move it to
SessionAccessibility, the sole consumer.

Note: ToBundle will hopefully get removed entirely once CTW is fully adopted.

Differential Revision: https://phabricator.services.mozilla.com/D144480
2022-04-27 21:01:35 +00:00
Mark Banner
1f8462cfdd Bug 1766238 - Stop using the target argument for ChromeUtils.import in accessibility tests. r=Jamie
Depends on D144561

Differential Revision: https://phabricator.services.mozilla.com/D144562
2022-04-27 08:38:35 +00:00
Eitan Isaacson
0b6b34fe31 Bug 1766514 - Use base implementation of TableIsProbablyForLayout when cache is enabled. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D144750
2022-04-26 23:17:48 +00:00
James Teh
7fabfd3b74 Bug 1766142: Expose explicit-name object attribute for cached RemoteAccessibles. r=morgan
The cache already includes this info.
We just needed to use it when exposing attributes to clients.

Differential Revision: https://phabricator.services.mozilla.com/D144684
2022-04-26 23:15:01 +00:00
Eitan Isaacson
03381c5118 Bug 1765655 - Introduce Accessible::DebugDescription in debug builds. r=morgan
Depends on D144234

Differential Revision: https://phabricator.services.mozilla.com/D144235
2022-04-26 16:44:54 +00:00
James Teh
4e63bbff78 Bug 1765460 part 2: Add the scroll offset of the parent in ParentRelativeBounds. r=morgan
This means that cached bounds stay the same regardless of scroll offset.
The scroll position gets subtracted later when calculating absolute bounds.

Differential Revision: https://phabricator.services.mozilla.com/D144392
2022-04-26 07:05:50 +00:00
James Teh
38d42cbd8e Bug 1765460 part 1: Fix testBoundsInContent to correctly enforce both low and high constraints. r=morgan
We use two constraints to ensure the bounds fall within 5 px of the expected values in either direction.
However, the function was using || , so only one constraint was being enforced.
In practice, this meant that we wouldn't fail for any value.
Change this to && to enforce both constraints.

Differential Revision: https://phabricator.services.mozilla.com/D144391
2022-04-26 07:05:49 +00:00
James Teh
60be7cd6d6 Bug 1765944: Fix transform cache updates. r=morgan
The frame might not be transformed yet when MaybeQueueCacheUpdateForStyleChanges is called.
In that case, frame->IsTransformed() will return false.
However, newStyle->StyleDisplay()->HasTransform(frame) returns true, so we can use that.

Differential Revision: https://phabricator.services.mozilla.com/D144429
2022-04-25 22:19:00 +00:00
James Teh
4f1f309c35 Bug 1765964: Don't push scrollPosition to the cache if it's 0. r=morgan
In addition, don't send DeleteEntry for Transform for an initial cache update, since there's nothing to delete.
These fixes don't change the behaviour for users, but optimise both cache storage and IPC trafic.

Differential Revision: https://phabricator.services.mozilla.com/D144421
2022-04-25 22:14:36 +00:00
James Teh
a3b482acc2 Bug 1395181 part 2: Support click handlers added to the root element. r=eeejay
Normally, we treat the body as the DOM node for a DocAccessible.
However, a click listener can be added to the root element; e.g. the html element.
We now treat a click listener added to the root element the same as if one were added to the body.

This required a change to nsAccessibilityService to use the DocAccessible when click listeners change for the root element so a cache update is pushed.
This change was made for the body also, since we weren't pushing a cache update for click listener changes on the body either.

Differential Revision: https://phabricator.services.mozilla.com/D144278
2022-04-22 23:13:36 +00:00
James Teh
ddd6d00a57 Bug 1395181 part 1: Support "click ancestor" action on descendants when an ancestor has an action. r=eeejay
Previously, we supported an action on text leaf and image accessibles if an ancestor was a link or was clickable.
However, we didn't support it on any other kind of descendant, nor could clients differentiate between a click handler on the descendant itself vs an action propagated because of an ancestor.
In addition, the click was performed on the ancestor element itself, rather than bubbling up to the ancestor.
This was probably never a real problem given the limited scope, but it meant that the actual event target was lost.

This has been replaced by a "click ancestor" action supported on all descendants of ancestors providing an action.
The click is dispatched to the descendant and bubbles up to the ancestor.
Aside from consistency and the ability to differentiate the action, this allows clients to stop relying on simulating clicks themselves to directly target a descendant.
This avoids problems caused by obscured web elements, obscured browser windows and other weird screen coordinate issues.
It thus fixes several problems reported by NVDA screen reader users.

Differential Revision: https://phabricator.services.mozilla.com/D144252
2022-04-22 23:13:36 +00:00
Eitan Isaacson
395df0c9f2 Bug 1765651 - Put DOMNodeID in Accessible. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D144234
2022-04-22 16:31:42 +00:00
James Teh
cc18ee7d76 Bug 1764500: Fire correct state change events when designMode is changed on a document. r=eeejay
Previously, we used the obs_documentCreated observer message fired by editor.
However, this is fired when an editor is created anywhere in the document, even if it's for a descendant.
This meant that we were firing an editable state change on the document when a descendant became contentEditable.
In turn, this resulted in the document always having the editable state in the cache if there was a contentEditable descendant.

This message also isn't fired if an editor already exists (e.g. for a contentEditable descendant) and designMode is turned on for the document.
This meant that we wouldn't fire an event in that case, resulting in an incorrect cache.

There is no usable equivalent to detect when designMode is turned off.
While there is obs_documentWillBeDestroyed, that doesn't ever seem to get fired.
This meant that we didn't fire a state change when designMode was turned off, also resulting in an incorrect cache.

To fix all of these issues, we now watch for NS_EVENT_STATE_READWRITE changes on the root element of the document.
Because we use the root element (not the body), this should avoid duplicate state changes for contentEditable changes on the body, which get handled by LocalAccessible::DOMAttributeChanged.

Finally, we previously fired only an editable state change, but changing the editable state of a document also impacts the read-only state.
This too resulted in an incorrect cache.
We now fire a read-only state change as well.

Differential Revision: https://phabricator.services.mozilla.com/D143969
2022-04-22 00:02:29 +00:00
Morgan Reschenberg
420ef979b8 Bug 1765000: Ignore missing view when running in headless mode r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D143852
2022-04-20 22:16:07 +00:00
James Teh
fef89de8c9 Bug 1743966: Move ScrollTo into Accessible and support it for Windows RemoteAccessibles. r=morgan
Aside from adding ScrollTo to the Windows PDocAccessible IPDL, This mostly just moves methods into base classes and adapts platform code to use the unified Accessible::ScrollTo.

Differential Revision: https://phabricator.services.mozilla.com/D143655
2022-04-18 21:55:39 +00:00
Iulian Moraru
c97a26b3a1 Backed out changeset b424302d8ba0 (bug 1763191) for causing Bp-hybrid bustages on nsAccUtils. CLOSED TREE 2022-04-18 20:47:55 +03:00
Morgan Reschenberg
c2f7f702bd Bug 1763191: Add suppport for cached remote accessibles in coordinate conversion functions r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D142970
2022-04-18 15:53:18 +00:00
James Teh
a69dcf58d4 Bug 1764249: Make HyperTextAccessibleBase::CroppedSelectionRanges remove collapsed ranges when called on a document. r=morgan
There's no point cropping ranges when called on the document, but we still want to remove collapsed ranges.
The path to hell is paved with premature optimisation. :(

Differential Revision: https://phabricator.services.mozilla.com/D143579
2022-04-13 21:22:49 +00:00
James Teh
800dd1d2a8 Bug 1760735: Support TableAccessibleBase in AccGroupInfo. r=eeejay
This enables AccGroupInfo::TotalItemCount to work for CachedTableAccessibles.
This still doesn't yet support aria-row/colcount for cached RemoteAccessibles.

Differential Revision: https://phabricator.services.mozilla.com/D141818
2022-04-12 23:49:57 +00:00
James Teh
fa5d442869 Bug 1760939 part 2: Move LinkCount to HyperTextAccessibleBase. r=eeejay
This updates the XPCOM, ATK and Windows implementations too.

Differential Revision: https://phabricator.services.mozilla.com/D142028
2022-04-11 23:20:14 +00:00
James Teh
709573652e Bug 1760939 part 1: Move EmbeddedChildCount to Accessible. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D142027
2022-04-11 23:20:13 +00:00
James Teh
28d9ce246b Bug 1735970 part 18: Add browser tests to exercise table support for both local and remote Accessibles. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D141221
2022-04-01 09:50:02 +00:00
James Teh
dbbb25abc4 Bug 1735970 part 17: Load a11y browser test snippets in standards mode instead of quirks mode. r=morgan
This is needed to make rowspan="0" work, as this is ignored in quirks mode.

Differential Revision: https://phabricator.services.mozilla.com/D141220
2022-04-01 09:50:02 +00:00
James Teh
77ee8feb56 Bug 1735970 part 16: Support TableAccessibleBase and TableCellAccessibleBase on Mac. r=morgan
We can use the base classes for both local and cached remote Accessibles.
However, non-cached RemoteAccessibles need to be handled separately still because we can't implement the table interfaces for those.

Differential Revision: https://phabricator.services.mozilla.com/D141219
2022-04-01 09:50:02 +00:00
James Teh
d5d775e886 Bug 1735970 part 15: Support TableAccessibleBase and TableCellAccessibleBase for ATK. r=morgan
We can use the base classes for both local and cached remote Accessibles.
However, non-cached RemoteAccessibles need to be handled separately still because we can't implement the table interfaces for those.

Differential Revision: https://phabricator.services.mozilla.com/D141218
2022-04-01 09:50:01 +00:00
James Teh
e394578c67 Bug 1735970 part 14: Support TableAccessibleBase and TableCellAccessibleBase on Windows. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D141217
2022-04-01 09:50:01 +00:00
James Teh
c3bb22d493 Bug 1735970 part 13: Support TableAccessibleBase and TableCellAccessibleBase in XPCOM. r=morgan
This doesn't work for non-cached RemoteAccessibles, but this wasn't previously implemented anyway.
With this patch (and all earlier patches in the stack) applied, all the tests in accessible/tests/mochitest pass with the cache enabled, thus testing CachedTableAccessible.

Differential Revision: https://phabricator.services.mozilla.com/D141216
2022-04-01 09:50:00 +00:00
James Teh
15449df8fd Bug 1735970 part 12: Implement selection setter methods in CachedTableAccessible for LocalAccessibles. r=morgan
This just redirects to the local TableAccessible methods.
This allows us to test selection in our mochitests.
As far as I know, real clients don't actually use these methods , so they haven't been implemented for cached RemoteAccessibles yet.

Differential Revision: https://phabricator.services.mozilla.com/D141215
2022-04-01 09:50:00 +00:00
James Teh
5a51a59c7d Bug 1735970 part 11: Use CachedTableAccessible for LocalAccessible tables if the cache is enabled. r=morgan
This allows us to test CachedTableAccessible against our mochitest suite.
We'll eventually want to switch LocalAccessible to use this anyway, as it provides advantages beyond support for cached RemoteAccessibles.
This also ensures the experience is consistent between local and remote.

Differential Revision: https://phabricator.services.mozilla.com/D141214
2022-04-01 09:50:00 +00:00
James Teh
497cf621d5 Bug 1735970 part 10: Cache whether a table is probably a layout table. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D141213
2022-04-01 09:49:59 +00:00
James Teh
1a56a1b78a Bug 1735970 part 9: Support explicitly associated headers for both local and remote cells. r=morgan
Headers are associated using the headers DOM attribute, which is a list of DOM node ids.
For the cache, we send and store these as Accessible ids.

Differential Revision: https://phabricator.services.mozilla.com/D141212
2022-04-01 09:49:59 +00:00
James Teh
ed3aeb2201 Bug 1735970 part 8: Enable AccAttributes to store an array of uint64_t. r=morgan
We need this to cache explicitly associated headers.
This should also be useful later for relations.

Differential Revision: https://phabricator.services.mozilla.com/D141211
2022-04-01 09:49:58 +00:00
James Teh
cdc489e318 Bug 1735970 part 7: Make AccIterable::Next return an Accessible. r=morgan
We need to be able to iterate through explicitly associated headers for both local and remote Accessibles.
AccIterable will serve nicely as a base class, but it needs to support the Accessible base class to do that.

Differential Revision: https://phabricator.services.mozilla.com/D141210
2022-04-01 09:49:58 +00:00
James Teh
1f562c2009 Bug 1735970 part 6: Retrieve row/column extent for both local and remote cells. r=morgan
CachedTableAccessible already knew how to support extents (AKA spans), but it didn't know how to retrieve them yet.

Differential Revision: https://phabricator.services.mozilla.com/D141209
2022-04-01 09:49:58 +00:00
James Teh
78f3eb8987 Bug 1735970 part 5: Use CachedTableAccessible for cached RemoteAccessible. r=morgan
This gets/creates the CachedTableAccessible when AsTableBase/AsTableCellBase is called.
It also invalidates the table cache when mutations occur.

Differential Revision: https://phabricator.services.mozilla.com/D141208
2022-04-01 09:49:57 +00:00
James Teh
3f9f54bfb2 Bug 1735970 part 4: Introduce CachedTableAccessible and CachedTableCellAccessible. r=morgan
This is a completely new table implementation which can work with the cache.
We lazily create a cache data structure only when table information is requested by a client, looping through the entire table and calculating all the information we need (counts, coordinates, implicit headers, etc.).
Whenever the cache is invalidated due to a mutation of the table structure, we throw away the entire cache, rebuilding it next time the client requests information.

Differential Revision: https://phabricator.services.mozilla.com/D141206
2022-04-01 09:49:57 +00:00