Граф коммитов

9886 Коммитов

Автор SHA1 Сообщение Дата
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