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

10684 Коммитов

Автор SHA1 Сообщение Дата
James Teh 05cd652e5e Bug 1824935 part 2: Have LandmarkRole return an nsStaticAtom. r=eeejay
We will soon call LandmarkRole from a new function which returns an nsStaticAtom.
LandmarkRole always returns static atoms anyway, so formalize this.

Differential Revision: https://phabricator.services.mozilla.com/D175582
2023-04-25 07:06:34 +00:00
James Teh d143f977de Bug 1824935 part 1: Add ARIA roles to RoleMap. r=eeejay
This will soon be used to return standardized ARIA role names from a new function.

Differential Revision: https://phabricator.services.mozilla.com/D175581
2023-04-25 07:06:34 +00:00
Stanca Serban 041c4044bd Backed out 8 changesets (bug 1828816, bug 1822112, bug 1572512, bug 1824935) for causing multiple failures. CLOSED TREE
Backed out changeset 8886f7011919 (bug 1822112)
Backed out changeset df566bce405d (bug 1828816)
Backed out changeset 5857e8ef63e1 (bug 1828816)
Backed out changeset 50324d39e9c1 (bug 1822112)
Backed out changeset 7f6bee1959fb (bug 1572512)
Backed out changeset 4effd0bdc4db (bug 1824935)
Backed out changeset a8faf17fcce8 (bug 1824935)
Backed out changeset 0370b0032eb6 (bug 1824935)
2023-04-25 07:45:58 +03:00
James Teh 3fb1357e3e Bug 1824935 part 3: Add Accessible::ComputedARIARole. r=eeejay
This also exposes this via XPCOM.
This will be used by WebDriver and Dev Tools.

Differential Revision: https://phabricator.services.mozilla.com/D175583
2023-04-24 23:35:51 +00:00
James Teh 2c081627d7 Bug 1824935 part 2: Have LandmarkRole return an nsStaticAtom. r=eeejay
We will soon call LandmarkRole from a new function which returns an nsStaticAtom.
LandmarkRole always returns static atoms anyway, so formalize this.

Differential Revision: https://phabricator.services.mozilla.com/D175582
2023-04-24 23:35:50 +00:00
James Teh 8a993e334d Bug 1824935 part 1: Add ARIA roles to RoleMap. r=eeejay
This will soon be used to return standardized ARIA role names from a new function.

Differential Revision: https://phabricator.services.mozilla.com/D175581
2023-04-24 23:35:50 +00:00
Emilio Cobos Álvarez 3ce1c08d5b Bug 1828413 - Fix a11y tests so that they don't hover over the rounded corner.
MANUAL PUSH: Trivial fix CLOSED TREE
2023-04-20 15:28:50 +02:00
Stanca Serban c25ebc211a Backed out 4 changesets (bug 1825611) for causing mochitests failures in accessible/tests. CLOSED TREE
Backed out changeset 169c3f65e1ce (bug 1825611)
Backed out changeset c2d6231e9361 (bug 1825611)
Backed out changeset 9152cb7808c2 (bug 1825611)
Backed out changeset e74c388d1a4e (bug 1825611)
2023-04-20 03:03:25 +03:00
James Teh 4ea1fca123 Bug 1751943: Fix doc tree mutation during AddChildDoc. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D173916
2023-04-19 23:16:15 +00:00
Morgan Rae Reschenberg 623f4ac2d3 Bug 1825611: Add test for overflow:hidden hittesting and acc creation r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D175196
2023-04-19 22:55:39 +00:00
Morgan Rae Reschenberg 3963d05927 Bug 1825611: Ensure nodes with overflow:hidden styling always create an accessible r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D175195
2023-04-19 22:55:39 +00:00
Morgan Rae Reschenberg f6166a5774 Bug 1825611: Trim bounds when hittesting overflow:hidden containers r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D175194
2023-04-19 22:55:39 +00:00
Morgan Rae Reschenberg 513cf054fc Bug 1825611: Cache overflow r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D175193
2023-04-19 22:55:38 +00:00
Eitan Isaacson 8c6b657874 Bug 1826870 - Fix ATK extents to used cached bounds. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D175187
2023-04-19 16:17:31 +00:00
Nathan LaPre ddf6d2c246 Bug 1825516: Replace one workaround with a nicer one r=Jamie
GCC bug 109480 describes an issue we're encountering with calling protected
member functions from within protected member functions. The previous workaround,
removed in this revision, is a bit annoying, and must be repeated when we need
to capture the return value of protected functions. Making specializations of
RemoteAccessibleBase friends of other RemoteAccessibleBase specializations, while
maybe a bit heavy-handed, is a cleaner solution here, particularly since we only
specialize with RemoteAccessible itself. This is a workaround suggested by GCC
devs in the referenced bug.

Differential Revision: https://phabricator.services.mozilla.com/D175531
2023-04-19 01:32:56 +00:00
Iulian Moraru 0b022d176d Backed out 4 changesets (bug 1825611) for causing multiple mochitest failures. CLOSED TREE
Backed out changeset a30a125f2aea (bug 1825611)
Backed out changeset ee5e3b614f91 (bug 1825611)
Backed out changeset c79ad1ee1e32 (bug 1825611)
Backed out changeset db2d550a788b (bug 1825611)
2023-04-19 02:24:25 +03:00
Morgan Rae Reschenberg 80cb6ab5df Bug 1825611: Add test for overflow:hidden hittesting and acc creation r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D175196
2023-04-18 21:06:11 +00:00
Morgan Rae Reschenberg e7373d87a0 Bug 1825611: Ensure nodes with overflow:hidden styling always create an accessible r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D175195
2023-04-18 21:06:11 +00:00
Morgan Rae Reschenberg 74f85c2b15 Bug 1825611: Trim bounds when hittesting overflow:hidden containers r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D175194
2023-04-18 21:06:11 +00:00
Morgan Rae Reschenberg 719ed5d225 Bug 1825611: Cache overflow r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D175193
2023-04-18 21:06:11 +00:00
Eitan Isaacson feaab44730 Bug 1826851 - Unify IsSearchbox in Accessible and use cache when available. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D174970
2023-04-18 18:14:27 +00:00
Emilio Cobos Álvarez 8b5b7ad998 Bug 1827856 - Remove nativeAnonymousChildList observers. r=smaug,credential-management-reviewers,devtools-reviewers,sgalich,nchevobbe
You let me know if this seems appealing to you :)

Differential Revision: https://phabricator.services.mozilla.com/D175382
2023-04-18 14:58:34 +00:00
serge-sans-paille 89cc07cf04 Bug 1828381 - Make accessible/windows/sdn buildable outside of a unified build environment r=andi
Differential Revision: https://phabricator.services.mozilla.com/D175594
2023-04-18 13:43:19 +00:00
serge-sans-paille dc8420c9d8 Bug 1828380 - Make accessible/windows/msaa buildable outside of a unified build environment r=andi
Differential Revision: https://phabricator.services.mozilla.com/D175593
2023-04-18 13:43:19 +00:00
serge-sans-paille 9fe0b3de0d Bug 1828379 - Make accessible/windows/ia2 buildable outside of a unified build environment r=andi
Differential Revision: https://phabricator.services.mozilla.com/D175592
2023-04-18 13:43:19 +00:00
serge-sans-paille abdbe44b83 Bug 1828378 - Make accessible/mac buildable outside of a unified build environment r=andi
Differential Revision: https://phabricator.services.mozilla.com/D175591
2023-04-18 13:43:19 +00:00
Eitan Isaacson 489d1d11a0 Bug 1826857 - Move AnchorAt to Accessible and remove sync IPC. r=Jamie
Because the implementation only needs the accessible type and tree, we
don't need to make an IPC call here.

Differential Revision: https://phabricator.services.mozilla.com/D175288
2023-04-17 17:54:35 +00:00
Eitan Isaacson 4a2d824c2a Bug 1826855 - Remove AnchorCount sync IPC message and implement in Accessible. r=Jamie
AnchorCount only needs the accessible type and child count. We already
cache that with or without CtW.

Differential Revision: https://phabricator.services.mozilla.com/D175273
2023-04-17 17:54:34 +00:00
Eitan Isaacson 55dcdc4250 Bug 1826854 - Put IsLinkValid() is base Accessible. r=Jamie
If caching is enabled it will use the cached state, if it isn't it will
do a sync State IPDL call. Also removed the specialized sync IsLinkValid
call because it essentially just did a State() check in the child.

Differential Revision: https://phabricator.services.mozilla.com/D175270
2023-04-17 17:54:34 +00:00
Eitan Isaacson 55ac968c09 Bug 1826858 - Eliminate LinkAt sync IPDL call. r=nlapre
No need for this.

Differential Revision: https://phabricator.services.mozilla.com/D175291
2023-04-14 18:38:18 +00:00
Eitan Isaacson d70f1224fa Bug 1826264 - P2: Add range TextLeafRange::ScrollIntoView. r=Jamie
Use it when caching is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D174977
2023-04-13 20:40:19 +00:00
Eitan Isaacson 60909e6894 Bug 1826264 - P1: Implement TextLeafPoint::ToDOMPoint. r=Jamie
Generalized code we already had for getting DOM points for DOM
selection.

Differential Revision: https://phabricator.services.mozilla.com/D174976
2023-04-13 20:40:19 +00:00
Otto Länd 37c1e8285c Bug 1825891: apply code formatting via Lando
# ignore-this-changeset
2023-04-13 18:04:17 +00:00
Eitan Isaacson c275c3a7d9 Bug 1825891 - P2: Remove Android's non-CTW implementation. r=Jamie,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D174516
2023-04-13 17:58:57 +00:00
Emilio Cobos Álvarez a5fdc9874c Bug 1826688 - Shrink down StyleInfo. r=morgan
Most of the methods have only one caller that guarantees it has a
primary frame (good!).

But others didn't quite guarantee that.

Differential Revision: https://phabricator.services.mozilla.com/D175042
2023-04-12 08:43:15 +00:00
Cosmin Sabou 89ecf0ab85 Backed out changeset d6af78936bdb (bug 1826851) for causing assertion failures on dom/base/nsAttrValueInlines.h. CLOSED TREE 2023-04-12 02:15:21 +03:00
Eitan Isaacson 04e98136b0 Bug 1826851 - Unify IsSearchbox in Accessible and use cache when available. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D174970
2023-04-11 21:58:46 +00:00
Eitan Isaacson 86eeb959fa Bug 1826852 - Use caching version of CharAt when available. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D174971
2023-04-11 21:58:09 +00:00
Nathan LaPre 65baef59a3 Bug 1825516: Work around suspected gcc bug, r=morgan,eeejay
This revision works around a suspected bug in gcc which was causing
build failures. The compiler would complain that ApplyScrollOffset was
protected, and therefore inaccessible, if we capture the return value
of that function within BoundsWithOffset. I don't think this actually
violates any C++ rules, and other compilers agree. To work around the
problem, this revision wraps the call to ApplyScrollOffset in an
immediately-invoked lambda, which satisfies gcc for some reason.

Differential Revision: https://phabricator.services.mozilla.com/D174697
2023-04-05 21:35:49 +00:00
Emilio Cobos Álvarez 641fa20731 Bug 1825825 - Simplify NAC setup. r=smaug
Make all UA widgets also NAC.

Keep the UA widget flag but break at anonymous subtree boundaries, so
that only nodes inside the UA widget directly (and not NAC from those)
get the flag.

This is important because two callers depend on this difference:

 * The style system, since we still want to match content rules from
   stylesheets in the UA widget. We also match user rules, which is a
   bit sketchy, but that was the previous behavior, will file a
   follow-up for that.

 * The reflector code, since we want the scope for UA widgets to not
   include the NAC nodes inside that UA widget. nsINode::IsInUAWidget
   got it wrong.

After this patch, ChromeOnlyAccess is equivalent to
IsInNativeAnonymousSubtree, so we should probably unify the naming.
That's left for a follow-up patch because I don't have a strong
preference.

Differential Revision: https://phabricator.services.mozilla.com/D174310
2023-04-05 09:19:15 +00:00
Robert Longson 03d9d7fa3d Bug 1825718 - map SVG elements to a role if they have an aria-label attribute r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D174465
2023-04-04 07:07:22 +00:00
James Teh 1f31893d00 Bug 1825523: Check IsHyperText before expecting AsHyperTextBase to work in Pivot::PrevText. r=eeejay
The code previously checked !childAtOffset->IsText(), but this isn't sufficient to be certain that childAtOffset->AsHyperTextBase() will work.
For example, childAtOffset could be an image which can't be descended into.

Differential Revision: https://phabricator.services.mozilla.com/D174213
2023-04-04 05:37:36 +00:00
James Teh e0f1b9cd7d Bug 1820389: Gracefully handle unknown ARIA roles. r=eeejay,decoder
Differential Revision: https://phabricator.services.mozilla.com/D173651
2023-04-03 04:32:34 +00:00
serge-sans-paille 13e51277df Bug 1825324 - Make widget/* buildable outside of a unified build environment r=andi,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D173969
2023-04-01 08:31:12 +00:00
Cristian Tuns 8e06a7a853 Backed out 12 changesets (bug 1825325, bug 1825336, bug 1825333, bug 1825332, bug 1825324, bug 1824557, bug 1825328, bug 1825335, bug 1825330, bug 1825329, bug 1825327, bug 1825331) for causing build bustages in nsClipboard.cpp CLOSED TREE
Backed out changeset 9de3ed24d3a0 (bug 1825336)
Backed out changeset aef787728f19 (bug 1825335)
Backed out changeset a04c341244c1 (bug 1825333)
Backed out changeset e3ad15f762ba (bug 1825332)
Backed out changeset eed23da92a27 (bug 1825331)
Backed out changeset 8213bb54376e (bug 1825330)
Backed out changeset 747ec5ac4994 (bug 1825329)
Backed out changeset e91ff431f92d (bug 1825328)
Backed out changeset 59c18d13768b (bug 1825327)
Backed out changeset 538096d99e49 (bug 1825325)
Backed out changeset c76eb9d9b095 (bug 1825324)
Backed out changeset 8b81410eb686 (bug 1824557)
2023-03-31 12:58:53 -04:00
Butkovits Atila be5156b4fe Backed out changeset b653a1b8816b (bug 1820389) for causing build bustages at DocAccessibleParent.cpp 2023-03-31 18:23:42 +03:00
James Teh bd912a9924 Bug 1820389: Gracefully handle unknown ARIA roles. r=eeejay,decoder
Differential Revision: https://phabricator.services.mozilla.com/D173651
2023-03-31 13:53:34 +00:00
serge-sans-paille 0702cdc836 Bug 1825324 - Make widget/* buildable outside of a unified build environment r=andi,geckoview-reviewers,m_kato
Depends on D173637

Differential Revision: https://phabricator.services.mozilla.com/D173969
2023-03-31 13:29:44 +00:00
James Teh a2f622b63d Bug 1824828: Handle tree mutation during RecvHideEvent. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D173918
2023-03-30 17:10:19 +00:00
ogiorgis f59f695642 Bug 1621950 - fix some myst ref warnings r=firefox-source-docs-reviewers,devtools-reviewers,sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D173843
2023-03-30 08:01:22 +00:00
Nathan LaPre 50ae57a7d9 Bug 1819741: Constrain acc bounds to that of scroll areas for hit testing, r=morgan
This revision adds logic to BoundsWithOffset to ensure that bounds, when
calculated for hit testing, are constrained to the scroll areas that contain
them. This ensures that we don't return an Accessible that's covered by another
element when hit testing due to overflow: scroll situations.

This revision also contains a fix for transforms and scroll: we now apply
scroll before any transform, since transforms operate on scrolled content.

This revision contains tests for both of the above changes.

Differential Revision: https://phabricator.services.mozilla.com/D173392
2023-03-30 00:11:14 +00:00
Eitan Isaacson 545741bece Bug 1825054 - Don't get stuck in endless loop when getting bounds. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D173864
2023-03-29 22:31:00 +00:00
Emilio Cobos Álvarez 2d0e69f4a1 Bug 1824957 - Remove a bunch of now completely dead XUL layout code. r=layout-reviewers,desktop-theme-reviewers,devtools-reviewers,dao,TYLin
And some related tests.

A bunch of -moz-box* properties are web exposed, so I'll file a
follow-up for hiding them.

Differential Revision: https://phabricator.services.mozilla.com/D173819
2023-03-29 21:23:55 +00:00
James Teh b826e71bc9 Bug 1821448: Improve handling of reentry in MsaaAccessible::VisitDocAccessibleParentDescendantsAtTopLevelInContentProcess. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D173652
2023-03-29 19:42:15 +00:00
Morgan Rae Reschenberg df1f70a647 Bug 1809761: Introduce text bounds test for interleaving block- and inline-frame accessibles r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D171918
2023-03-28 19:23:05 +00:00
Eitan Isaacson 385aaab8e0 Bug 1823979 - Remove strict assertion in text selection. r=morgan
I was trying to anticipate all the conditions that would bring us
to a non-text leaf text point in a text selection. But it is hard to
account for other "correct" cases so this assertion should probably just
go away.

Differential Revision: https://phabricator.services.mozilla.com/D173760
2023-03-28 16:24:15 +00:00
Emilio Cobos Álvarez 58acdee9a2 Bug 1824667 - Remove nsTextBoxFrame. r=jwatt
Use a MiddleCroppingBlockFrame subclass that looks at the value attribute
instead. We don't need accesskey etc for these so we can just reuse it as is.

Differential Revision: https://phabricator.services.mozilla.com/D173669
2023-03-27 23:46:51 +00:00
James Teh f993e9be8a Bug 1824064: When cleaning up a11y mutation events, clear the next pointer as well as the previous pointer to reduce pressure on the cycle collector. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D173503
2023-03-27 18:16:32 +00:00
Andi-Bogdan Postelnicu 4efa1bd0ba Bug 1276351 - Move away from mozilla::tuple to std::tuple. r=necko-reviewers,sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173256
2023-03-27 07:20:25 +00:00
Sandor Molnar 9db345d4c1 Backed out 2 changesets (bug 1276351) for causing build bustage in image/ClippedImage.cp CLOSED TREE
Backed out changeset e84598eb82c1 (bug 1276351)
Backed out changeset e940b0554484 (bug 1276351)
2023-03-25 14:16:43 +02:00
Andi-Bogdan Postelnicu 447f1e3358 Bug 1276351 - Move away from mozilla::tuple to std::tuple. r=necko-reviewers,sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173256
2023-03-25 06:58:52 +00:00
Iulian Moraru 6d40eee997 Backed out 2 changesets (bug 1276351) for causing multiple failures.
Backed out changeset eeaf4f1e06af (bug 1276351)
Backed out changeset d44cb5704342 (bug 1276351)
2023-03-25 00:08:24 +02:00
Morgan Rae Reschenberg 7d7067fe49 Bug 1804699: Assign date fields an AXGroup role, spoof actual role via AXTitle r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D172177
2023-03-24 19:06:35 +00:00
Andi-Bogdan Postelnicu a1b827b503 Bug 1276351 - Move away from mozilla::tuple to std::tuple. r=necko-reviewers,sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173256
2023-03-24 18:55:39 +00:00
James Teh f390c076e8 Bug 1823294: Make PushNameOrDescriptionChange fire a name change event on the target itself if appropriate. r=eeejay
Previously, PushNameOrDescriptionChange wouldn't consider the target itself as a candidate for a name change event.
If the text of a text leaf changes without replacing the leaf, the only event we will get is text inserted on its parent.
If that parent calculated its name from its subtree, this meant that we wouldn't fire a name change in this case.
We address this by allowing this function to fire on the target itself in this case.

Differential Revision: https://phabricator.services.mozilla.com/D172953
2023-03-24 00:37:34 +00:00
James Teh 7f417a6fa1 Bug 1776049: Ignore visibility when checking focusability to determine whether to create an Accessible. r=morgan
This is an extension of the fix in bug 1775684.
In that fix, I tweaked NativeInteractiveState to ignore visibility when calling nsIFrame::IsFocusable, since otherwise, an invisible document would report that nothing was focused.
That works well if an Accessible would be created for other reasons; e.g. because it has a meaningful role.
However, if an element has no semantic value except for its focusability (e.g. <span tabindex="-1">), we were failing to create an Accessible for it altogether.
Now, we also ignore visibility when checking focusability in nsAccessibilityService::MustBeAccessible.
This means that we do create an Accessible in this case.
We don't need a caching check here because we should always create an Accessible in this case, even if the document is initially invisible.

Differential Revision: https://phabricator.services.mozilla.com/D173245
2023-03-23 04:07:04 +00:00
James Teh ba7744a7e8 Bug 1822340 part 2: When hit testing using the cache, only match a TextLeafAccessible if one of its lines includes the requested point. r=morgan
Previously, we always used the Accessible's rect.
However, if the text wraps across lines, its rect might cover a wider area than the actual text.
That meant we were matching a wrapped text leaf when we shouldn't in some cases.
Now, we restrict text leaf matches to the rects occupied by text.

Differential Revision: https://phabricator.services.mozilla.com/D173097
2023-03-23 00:38:13 +00:00
James Teh 3151b74de4 Bug 1822340 part 1: Fix cached text bounds for wrapped text which starts part way through a line or where the primary text frame is empty. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D173096
2023-03-23 00:38:13 +00:00
James Teh 428e00698c Bug 1823594: TextLeafPoint::CharBounds: Only fail the assertion if the offset is larger than the length. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D173248
2023-03-23 00:36:49 +00:00
Andi-Bogdan Postelnicu 10f49d4180 Bug 1660405 - Move away from mozilla::IsNaN in favor of std::isnan. r=nbp,media-playback-reviewers,sergesanspaille,padenot
Differential Revision: https://phabricator.services.mozilla.com/D173035
2023-03-22 11:35:33 +00:00
Stanca Serban e31a178029 Backed out 7 changesets (bug 1660405) for causing bustages on Linux x64 opt. CLOSED TREE
Backed out changeset ad1a5f59214f (bug 1660405)
Backed out changeset a39e95f0aafe (bug 1660405)
Backed out changeset 48629ee0d70d (bug 1660405)
Backed out changeset 8419b99aab60 (bug 1660405)
Backed out changeset 535cc12c8bed (bug 1660405)
Backed out changeset e27052da4927 (bug 1660405)
Backed out changeset 11b0f9cf8091 (bug 1660405)
2023-03-22 13:05:53 +02:00
Andi-Bogdan Postelnicu a5d28acdd6 Bug 1660405 - Move away from mozilla::IsNaN in favor of std::isnan. r=nbp,media-playback-reviewers,sergesanspaille,padenot
Differential Revision: https://phabricator.services.mozilla.com/D173035
2023-03-22 09:27:56 +00:00
James Teh 633f202e6d Bug 1821954: Make HyperTextAccessible::Char/TextBounds use HyperTextAccessibleBase when the cache is enabled. r=morgan
This is consistent with other HyperTextAccessible methods such as TextAtOffset.
It allows us to test the new implementation with LocalAccessible.
This is especially useful because we have better test coverage in our HyperText tests than we do in our TextLeafPoint tests.

In fact, running the tests with this change uncovered some bugs which I had to fix here.

First, TextLeafPoint::ComputeBoundsFromFrame was preferring to stick to the end of the first frame when on a boundary, rather than using the next frame.
For example, if we had the text "a\nb" where "b" is split into a continuation, offset 2 "b" was previously using the primary frame instead of the continuation.
This isn't a problem in HyperTextAccessible::GetBoundsInFrame because it walks to the next continuation if needed, since it is dealing with a range of offsets.
This is fixed by preferring the beginning of the next frame instead.

Second, passing the text length as the offset (i.e. one past the last character) should return a 0 rect.
TextLeafPoint::CharBounds needed to be tweaked accordingly.

Third, if TextLeafPoint returns a 0 rect (e.g. because a RemoteAccessible doesn't have a cache yet), HyperTextAccessibleBase needs to respect that and return it untouched.

Differential Revision: https://phabricator.services.mozilla.com/D172533
2023-03-21 01:23:40 +00:00
Eitan Isaacson d9e084d17d Bug 1822170 - Handle any kind of NSRanges provided to AXAttributedStringForRange. r=Jamie
This patch remedies 4 things:
1. Fix conversion from NSRange to GeckoTextMarkerRange. We were adding the start offset twice. Oops.
2. Clamp given range to actual text size. Since we are messing with the offset fields directly we need to do our own checks here.
3. Don't allow an infinite loop in CachedTextMarkerRange::AttributedText
4. Fix legacy Crop method to be able to take a text leaf.

Differential Revision: https://phabricator.services.mozilla.com/D172594
2023-03-20 22:01:27 +00:00
Nika Layzell c4bc184bac Bug 1814686 - Part 1b: Add nullable annotations to refcounted types in ipdl, r=ipc-reviewers,mccr8
Manual changes to make all refcounted types be marked as `nullable` after the
changes in part 1a. This was done without any investigation into whether the
actual types want to be nullable, in order to avoid code changes.

Differential Revision: https://phabricator.services.mozilla.com/D168889
2023-03-20 15:40:37 +00:00
Nika Layzell f47e7d485e Bug 1607634 - Part 4b: Changes for not-nullable actor types being wrapped in NotNull, r=ipc-reviewers,necko-reviewers,mccr8
These are the code changes required by the IPDL changes in part 4a.

Differential Revision: https://phabricator.services.mozilla.com/D168887
2023-03-20 15:40:36 +00:00
Nika Layzell f965102dee Bug 1814683 - Part 2: Add a constructor for IPDL structs which moves each parameter, r=ipc-reviewers,mccr8
This will be useful after part 3 where it will be used as part of implementing
Read based on Maybe for IPDL structs. Without this change, we'd need to copy to
construct an IPDL struct containing a non-default-constructable type.

Differential Revision: https://phabricator.services.mozilla.com/D169268
2023-03-20 15:40:32 +00:00
Nika Layzell 78fa962afb Bug 1814683 - Part 1: Combine parent/child fields in IPDL structs/unions, r=ipc-reviewers,necko-reviewers,mccr8
This combines the multiple fields or variants which were previously used to
track sided types like protocol types into a single field wrapped with a
SideVariant.

This will be used in the next part to avoid the need for default constructors
for actor types allowing the proper types to be used.

Differential Revision: https://phabricator.services.mozilla.com/D168879
2023-03-20 15:40:31 +00:00
Masayuki Nakano 5b59e4aeae Bug 1384606 - part 4: Make `nsIFrame::GetFrameFromDirection` allow to return content in different native anonymous subtree if the caller wants r=emilio
The a11y module wants to traverse frames in native anonymous subtrees.
Therefore, this patch adds new option for allowing it, makes
`nsIFrame::GetFrameFromDirection` check it before comparing native anonymous
subtree root nodes, and makes `HyperTextAccessible::FindOffset` use the
option.

Differential Revision: https://phabricator.services.mozilla.com/D172759
2023-03-18 04:18:53 +00:00
Masayuki Nakano 01d2fe15e1 Bug 1384606 - part 3: Make `nsPeekOffsetStruct` and its handlers treat `bool` options with an `EnumSet` r=emilio
The constructor of `nsPeekOffsetStruct` and `nsIFrame::GetFrameFromDirection`
take too many `bool` arguments.  Therefore, adding new `bool` arguments does
not make sense.  Now, we have a useful `mozilla:EnumSet` class to treat them
with an `enum class`. Therefore, let's change `nsPeekOffsetStruct` with it.

Differential Revision: https://phabricator.services.mozilla.com/D172758
2023-03-18 04:18:53 +00:00
Robert Longson 209497bfd2 Bug 1822884 - Remove eSHAPE from IsNodeOfType and replace with IsSVGGeometryElement r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D172820
2023-03-17 16:26:34 +00:00
Iulian Moraru 6f60d5fa4d Backed out 4 changesets (bug 1384606) for causing mochitest browser a11y failures on browser_text_basics.js. CLOSED TREE
Backed out changeset 6f7176c0d6a3 (bug 1384606)
Backed out changeset 19c51e735059 (bug 1384606)
Backed out changeset eb8a5705b2d3 (bug 1384606)
Backed out changeset 39b202962261 (bug 1384606)
2023-03-17 10:40:53 +02:00
Masayuki Nakano 25e942f2a0 Bug 1384606 - part 4: Make `nsIFrame::GetFrameFromDirection` allow to return content in different native anonymous subtree if the caller wants r=emilio
The a11y module wants to traverse frames in native anonymous subtrees.
Therefore, this patch adds new option for allowing it, makes
`nsIFrame::GetFrameFromDirection` check it before comparing native anonymous
subtree root nodes, and makes `HyperTextAccessible::FindOffset` use the
option.

Differential Revision: https://phabricator.services.mozilla.com/D172759
2023-03-17 06:26:03 +00:00
Masayuki Nakano 9cf5036656 Bug 1384606 - part 3: Make `nsPeekOffsetStruct` and its handlers treat `bool` options with an `EnumSet` r=emilio
The constructor of `nsPeekOffsetStruct` and `nsIFrame::GetFrameFromDirection`
take too many `bool` arguments.  Therefore, adding new `bool` arguments does
not make sense.  Now, we have a useful `mozilla:EnumSet` class to treat them
with an `enum class`. Therefore, let's change `nsPeekOffsetStruct` with it.

Differential Revision: https://phabricator.services.mozilla.com/D172758
2023-03-17 06:26:03 +00:00
Noemi Erli 585fe519f1 Backed out 4 changesets (bug 1384606) for causing build bustage in nsFrameSelection.h CLOSED TREE
Backed out changeset 917f487fdf0f (bug 1384606)
Backed out changeset 0782f42b2a99 (bug 1384606)
Backed out changeset 22099c5efaf6 (bug 1384606)
Backed out changeset f3a38b1eac88 (bug 1384606)
2023-03-17 06:54:59 +02:00
Masayuki Nakano c2b9c4058b Bug 1384606 - part 4: Make `nsIFrame::GetFrameFromDirection` allow to return content in different native anonymous subtree if the caller wants r=emilio
The a11y module wants to traverse frames in native anonymous subtrees.
Therefore, this patch adds new option for allowing it, makes
`nsIFrame::GetFrameFromDirection` check it before comparing native anonymous
subtree root nodes, and makes `HyperTextAccessible::FindOffset` use the
option.

Depends on D172758

Differential Revision: https://phabricator.services.mozilla.com/D172759
2023-03-17 04:22:05 +00:00
Masayuki Nakano 1387f2e7bc Bug 1384606 - part 3: Make `nsPeekOffsetStruct` and its handlers treat `bool` options with an `EnumSet` r=emilio
The constructor of `nsPeekOffsetStruct` and `nsIFrame::GetFrameFromDirection`
take too many `bool` arguments.  Therefore, adding new `bool` arguments does
not make sense.  Now, we have a useful `mozilla:EnumSet` class to treat them
with an `enum class`. Therefore, let's change `nsPeekOffsetStruct` with it.

Differential Revision: https://phabricator.services.mozilla.com/D172758
2023-03-17 04:22:05 +00:00
Eitan Isaacson 87e86c8f87 Bug 1819160 - Hold a reference to registering session in DocAccessibleParent. r=Jamie
This should fully eliminate the case where remote accessibles fail to
unregister because of the outer PresShell's lifecycle.

Differential Revision: https://phabricator.services.mozilla.com/D172473
2023-03-16 19:16:30 +00:00
Cristian Tuns b3e8485c79 Backed out changeset 30b7d9c22176 (bug 1822170) for causing mochitest failures on CachedTextMarker.mm CLOSED TREE 2023-03-16 14:21:39 -04:00
Eitan Isaacson c25e3e319a Bug 1822170 - Handle any kind of NSRanges provided to AXAttributedStringForRange. r=Jamie
This patch remedies 4 things:
1. Fix conversion from NSRange to GeckoTextMarkerRange. We were adding the start offset twice. Oops.
2. Clamp given range to actual text size. Since we are messing with the offset fields directly we need to do our own checks here.
3. Don't allow an infinite loop in CachedTextMarkerRange::AttributedText
4. Fix legacy Crop method to be able to take a text leaf.

Differential Revision: https://phabricator.services.mozilla.com/D172594
2023-03-16 15:54:20 +00:00
Eitan Isaacson 9375bdb120 Bug 1822544 - Return 0 for length of invalid range. r=Jamie
We are not promised a valid range from an external-facing API.
We already check if the range is valid for other operations.

Differential Revision: https://phabricator.services.mozilla.com/D172710
2023-03-16 15:53:39 +00:00
Otto Länd 0251e95403 Bug 1817592, 1822205: apply code formatting via Lando
# ignore-this-changeset
2023-03-15 22:38:25 +00:00
Eitan Isaacson 07ecb9af4d Bug 1822205 - collectionItemInfo.rowIndex should be 0 based in Android. r=Jamie,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D172504
2023-03-15 22:09:32 +00:00
Eitan Isaacson f98e3aa593 Bug 1817592 - Do not match and ignore subtrees on list items in android nav. r=Jamie,geckoview-reviewers,m_kato
We did this to give more semantic information when swiping through
read-only list items. This doesn't work when there are actionable
children in the list item. Chrome never navigates by list items, so we
shouldn't bother to either.

Differential Revision: https://phabricator.services.mozilla.com/D172503
2023-03-15 22:09:31 +00:00
Marian-Vasile Laza 5df0512bdd Backed out changeset 1b67ef7bd374 (bug 1822170) for assertion failures on Accessible.cpp. CLOSED TREE 2023-03-15 20:46:00 +02:00
Eitan Isaacson 9408df1789 Bug 1822170 - Handle any kind of NSRanges provided to AXAttributedStringForRange. r=Jamie
This patch remedies 3 things:
1. Fix conversion from NSRange to GeckoTextMarkerRange. We were adding the start offset twice. Oops.
2. Clamp given range to actual text size. Since we are messing with the offset fields directly we need to do our own checks here.
3. Don't allow an infinite loop in CachedTextMarkerRange::AttributedText

Differential Revision: https://phabricator.services.mozilla.com/D172594
2023-03-15 16:56:58 +00:00
Iulian Moraru 3684b2dc4a Backed out changeset e3ea9faf7c95 (bug 1822170) for causing multiple browser-a11y failures. CLOSED TREE 2023-03-15 06:29:09 +02:00
Eitan Isaacson 648164ceda Bug 1822170 - Handle any kind of NSRanges provided to AXAttributedStringForRange. r=Jamie
This patch remedies 3 things:
1. Fix conversion from NSRange to GeckoTextMarkerRange. We were adding the start offset twice. Oops.
2. Clamp given range to actual text size. Since we are messing with the offset fields directly we need to do our own checks here.
3. Don't allow an infinite loop in CachedTextMarkerRange::AttributedText

Differential Revision: https://phabricator.services.mozilla.com/D172594
2023-03-15 02:38:59 +00:00
James Teh 21d4739a57 Bug 1783178: Wait for the caret event in browser_caching_text_bounds.js instead of the focus event. r=eeejay
The caret event might fire after focus, in which case the cached caret would be incorrect.

Differential Revision: https://phabricator.services.mozilla.com/D172538
2023-03-15 01:00:37 +00:00
James Teh 041e0afce5 Bug 1751945: Fix OuterDoc removal during AddChildDoc. r=nlapre,yjuglaret
Differential Revision: https://phabricator.services.mozilla.com/D170310
2023-03-15 00:52:37 +00:00
Iulian Moraru 801dae8f2c Backed out 14 changesets (bug 1607634, bug 1814683, bug 1815177, bug 1814686) for causing build bustages on MaybeStorageBase. CLOSED TREE
Backed out changeset ae1c0551cea5 (bug 1815177)
Backed out changeset a11cafaa1884 (bug 1814686)
Backed out changeset 621507521762 (bug 1814686)
Backed out changeset ad692c73e381 (bug 1814686)
Backed out changeset 3be031e503dc (bug 1607634)
Backed out changeset aebbaa145d2d (bug 1607634)
Backed out changeset 9aa1f346fe14 (bug 1607634)
Backed out changeset e3eb77ad55ca (bug 1607634)
Backed out changeset e60591e5d5cf (bug 1607634)
Backed out changeset 6e43042d204a (bug 1814683)
Backed out changeset 1706e88652d6 (bug 1814683)
Backed out changeset 6878a1590e91 (bug 1814683)
Backed out changeset b1c980c834d8 (bug 1814683)
Backed out changeset 94480b82d102 (bug 1814683)
2023-03-15 01:58:36 +02:00
Eitan Isaacson ed3ca80643 Bug 1820894 - Add search text field to RotorRule and its subclasses. r=morgan
With caching we can directly filter accessible names with the search text in the parent process since the names are cached.

This patch also moves OutlineRule outside of RotorRules because the implementation
diverges (and it isn't rotor related!)

Differential Revision: https://phabricator.services.mozilla.com/D171917
2023-03-14 19:46:33 +00:00
Nika Layzell a07f4ca7c9 Bug 1814686 - Part 1b: Add nullable annotations to refcounted types in ipdl, r=ipc-reviewers,mccr8
Manual changes to make all refcounted types be marked as `nullable` after the
changes in part 1a. This was done without any investigation into whether the
actual types want to be nullable, in order to avoid code changes.

Differential Revision: https://phabricator.services.mozilla.com/D168889
2023-03-14 19:31:41 +00:00
Nika Layzell 462fc4e4ee Bug 1607634 - Part 4b: Changes for not-nullable actor types being wrapped in NotNull, r=ipc-reviewers,necko-reviewers,mccr8
These are the code changes required by the IPDL changes in part 4a.

Differential Revision: https://phabricator.services.mozilla.com/D168887
2023-03-14 19:31:40 +00:00
Nika Layzell 99fb1dbf3f Bug 1814683 - Part 2: Add a constructor for IPDL structs which moves each parameter, r=ipc-reviewers,mccr8
This will be useful after part 3 where it will be used as part of implementing
Read based on Maybe for IPDL structs. Without this change, we'd need to copy to
construct an IPDL struct containing a non-default-constructable type.

Differential Revision: https://phabricator.services.mozilla.com/D169268
2023-03-14 19:31:37 +00:00
Nika Layzell 97577629c0 Bug 1814683 - Part 1: Combine parent/child fields in IPDL structs/unions, r=ipc-reviewers,necko-reviewers,mccr8
This combines the multiple fields or variants which were previously used to
track sided types like protocol types into a single field wrapped with a
SideVariant.

This will be used in the next part to avoid the need for default constructors
for actor types allowing the proper types to be used.

Differential Revision: https://phabricator.services.mozilla.com/D168879
2023-03-14 19:31:36 +00:00
James Teh 4fa337dc47 Bug 1822225: Always produce async JS stacks in a11y browser tests. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D172527
2023-03-14 06:41:45 +00:00
James Teh 427da13d9e Bug 1819799: In a11y browser tests, treat a timeout in untilCacheCondition as a failure. r=eeejay
Otherwise, tests can take a very long time to run due to a bug without us realising that this is due to cache condition timeouts.
This patch also notifies observers of a cache update when state change events are received, as those do update the cache but aren't handled by RecvCache.
Some Mac tests depend on cache notifications for these instead of state change events, so these were hitting cache condition timeouts.

Differential Revision: https://phabricator.services.mozilla.com/D171417
2023-03-10 03:49:04 +00:00
James Teh 5ec432103b Bug 1821223: TextLeafPoint: Don't treat an entire table as a paragraph. r=eeejay
Table rows and cells are now treated as paragraph boundaries.
Whether a cell should be a paragraph boundary is debatable, but currently, a cell is treated as a line boundary, so this is consistent; a line shouldn't expand beyond a paragraph.

Differential Revision: https://phabricator.services.mozilla.com/D172079
2023-03-10 03:48:34 +00:00
James Teh 89dc63126c Bug 1808195: Try to make accessible/tests/browser/states/browser_test_link.js more reliable. r=eeejay
1. Open the link in a new tab instead of a new window. I originally did this to make debugging easier with a screenshot, but it seems to actually make the test more reliable. I don't know why.
2. Suffix the URL so we can be sure it will not have been visited before the test.

Differential Revision: https://phabricator.services.mozilla.com/D171948
2023-03-10 03:46:17 +00:00
Eitan Isaacson 3f036ec6b7 Bug 1818450 - StringAttributesFromAccAttributes: Return empty dictionary if input is null. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D172173
2023-03-10 03:40:21 +00:00
Morgan Rae Reschenberg 60f92a62cb Bug 1820029: Inline HyperTextAccessible::TextBounds to TextLeafPoint::CharBounds r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D171503
2023-03-09 19:59:00 +00:00
Sean Feng a039c090eb Bug 1818413 - Add some null pointer checks in HTMLImageMapAccessible::UpdateChildAreas r=Jamie
Given Bug 1815913 made the initialization of ImageMap earlier,
calling HTMLImageMapAccessible::UpdateChildAreas along with that
can lead to some null pointer crashes when reading mContent.

This patch adds some null pointer checks to fix this.

Differential Revision: https://phabricator.services.mozilla.com/D171889
2023-03-08 15:40:52 +00:00
Cristina Horotan 72f5765338 Backed out changeset db31cf17952c (bug 1819799) for causing ba failures at browser_caching_table.js 2023-03-07 09:25:35 +02:00
James Teh 12b8683d00 Bug 1819799: In a11y browser tests, treat a timeout in untilCacheCondition as a failure. r=eeejay
Otherwise, tests can take a very long time to run due to a bug without us realising that this is due to cache condition timeouts.
This patch also notifies observers of a cache update when state change events are received, as those do update the cache but aren't handled by RecvCache.
Some Mac tests depend on cache notifications for these instead of state change events, so these were hitting cache condition timeouts.

Differential Revision: https://phabricator.services.mozilla.com/D171417
2023-03-07 05:09:15 +00:00
James Teh 57869687c5 Bug 1820069: Fix handling of magic offsets in HyperTextAccessible*::Char/TextBounds. r=morgan
1. HyperTextAccessibleBase::CharBounds didn't have code to support magic offsets (like TEXT_OFFSET_CARET) at all, resulting in a crash.
2. HyperTextAccessibleBase::TextBounds handled the end offset being a magic offset, but not the start offset.
3. HyperTextAccessible::CharBounds assumed it could just add 1 to the start offset to pass to TextBounds, which resulted in returning the rect from the caret to the end of the container, since length (-1) is caret (-2) + 1.

This patch addresses all three of these issues.

Differential Revision: https://phabricator.services.mozilla.com/D171545
2023-03-06 08:58:42 +00:00
Eitan Isaacson 7bb059f2e8 Bug 1820213 - Use initial attributes run of first segment after an input. r=morgan
There is a potential null dereference if currentRun is first assigned
using a point in an empty input because the attributes will be null.

Differential Revision: https://phabricator.services.mozilla.com/D171596
2023-03-04 06:57:39 +00:00
Jan-Niklas Jaeschke ebf3cd6240 Bug 1808565, part 1: Adapt `Selection` to support `StaticRange`s. r=webidl,saschanaz,masayuki,smaug
This change is necessary to support the [CSS Highlight API](https://drafts.csswg.org/css-highlight-api-1/),
which uses `Selection` internally.

To replace `nsRange` with `AbstractRange`, some sections needed to be
adapted since `nsRange`-specific features were used.
Therefore, some methods (such as `GetRangeAt()`) may only be called if
the `Selection` is *not* of type `SelectionType::eHighlight`,
as it (per spec) returns an `nsRange`.
These methods will now `MOZ_ASSERT` if called for a highlight selection.
Additional methods are implemented which return `AbstractRange`
instead and are safe to be called for every selection type.

This commit also improves support of highlight features:
- Invalidation of highlight ranges: adding/removing Ranges in-place instead of
  removing and re-adding the Selection object associated with the highlight.
- Ranges are only associated with the Selection that shares the same Document
- Fixed minor IDL issue

Differential Revision: https://phabricator.services.mozilla.com/D170582
2023-03-03 14:59:47 +00:00
James Teh 75b296d493 Bug 1819802 part 2: Pre-allocate some arrays in LocalAccessible::BundleFieldsForCache. r=morgan,nlapre
For the viewport cache and character rects, we have at least a reasonable estimate of the number of elements that will be required.
Pre-allocating these saves on potentially costly re-allocation as we append elements.

Differential Revision: https://phabricator.services.mozilla.com/D171420
2023-03-03 03:26:22 +00:00
James Teh 958055f388 Bug 1819802 part 1: When getting cached a11y character bounds, return a single rect rather than an array of rects. r=morgan
When hit testing, we retrieve the bounds for every character in a text leaf in a separate call.
Because we need to convert from an array of flat ints to rects, this previously meant we built the entire array for every character.
For a large text leaf, building this rect array is relatively expensive.
We only need a single rect at a time.
Therefore, RemoteAccessibleBase now returns the rect for a single requested character instead of building an array of rects.

Differential Revision: https://phabricator.services.mozilla.com/D171419
2023-03-03 03:26:21 +00:00
Morgan Rae Reschenberg 7a080d4df8 Bug 1778441: Call into HyperTextAccessible::CharBounds when computing char bounds for local-acc TextLeafPoint's r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D171285
2023-03-02 18:08:15 +00:00
James Teh 34209c1742 Bug 1819245: Null check FocusMgr() in DocAccessibleChild::RecvRestoreFocus. r=eeejay
This can (rarely) be null if the accessibility service shuts down before we've processed this queued IPDL message.

Differential Revision: https://phabricator.services.mozilla.com/D171178
2023-03-01 23:51:33 +00:00
Eitan Isaacson 66cf5a32ef Bug 1818450 - Support getting attributed text with empty inputs. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D170939
2023-03-01 19:00:08 +00:00
Nathan LaPre f7edb0b474 Bug 1494196: Create Accessible for elements with ARIA role, attributes and display: contents, r=Jamie
This revision modifies the logic in CreateAccessible such that we create
Accessibles for elements that have ARIA roles (other than presentation, none) or
other ARIA attributes, even if those elements have the display: contents style.
This revision also adds tests to verify the above.

Differential Revision: https://phabricator.services.mozilla.com/D170718
2023-03-01 05:53:30 +00:00
James Teh 5f7a89e17f Bug 1818726 part 2: Remove the aDispatchShowEvent argument to PDocAccessible::Cache. r=eeejay
This is no longer used.

Differential Revision: https://phabricator.services.mozilla.com/D171047
2023-02-28 09:19:33 +00:00
James Teh a1cc7c8fe9 Bug 1818726 part 1: Include the cache in PDocAccessible::ShowEvent. r=eeejay
Previously, the cache was sent in a separate IPDL call.
Even though we delayed the show event, there was a chance that a client would walk the subtree and find a lot of Accessibles with no data.
Because no event is fired for those changes inside the subtree, the client might not know it needs to update them.
This resulted in missing information in NVDA browse mode in some cases.
Now, the tree is always in sync with its cached data.

Differential Revision: https://phabricator.services.mozilla.com/D171046
2023-02-28 09:19:33 +00:00
Csoregi Natalia 7ae06781c0 Backed out 2 changesets (bug 1818726) for causing failures on browser_caching_relations.js. CLOSED TREE
Backed out changeset 19b59c1f4a3b (bug 1818726)
Backed out changeset 0854bd8c6db1 (bug 1818726)
2023-02-28 06:43:35 +02:00
James Teh 3d617b7f9e Bug 1818726 part 2: Remove the aDispatchShowEvent argument to PDocAccessible::Cache. r=eeejay
This is no longer used.

Differential Revision: https://phabricator.services.mozilla.com/D171047
2023-02-28 00:03:54 +00:00
James Teh 891c2db763 Bug 1818726 part 1: Include the cache in PDocAccessible::ShowEvent. r=eeejay
Previously, the cache was sent in a separate IPDL call.
Even though we delayed the show event, there was a chance that a client would walk the subtree and find a lot of Accessibles with no data.
Because no event is fired for those changes inside the subtree, the client might not know it needs to update them.
This resulted in missing information in NVDA browse mode in some cases.
Now, the tree is always in sync with its cached data.

Differential Revision: https://phabricator.services.mozilla.com/D171046
2023-02-28 00:03:54 +00:00
James Teh 5ba97b5396 Bug 1818720: Skip inert attribute a11y tests if inert is preffed off. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D171044
2023-02-27 21:15:25 +00:00
Ryan VanderMeulen 8924fd2459 Bug 1818997 - Re-enable some passing browser-a11y tests and cleanup test manifests. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D171040
2023-02-27 04:45:27 +00:00
James Teh 4b8d5d446d Bug 1784752 part 2: Disable A11YLOG for accessible/tests/browser/events. r=eeejay
This was only ever meant to be temporary, but I forgot to remove it.

Differential Revision: https://phabricator.services.mozilla.com/D170557
2023-02-25 01:12:05 +00:00
James Teh 3d09bf554e Bug 1784752 part 1: Reset the mutation events queue and Accessible state bits before firing any mutation events. r=eeejay
See the code comments for explanation.

Differential Revision: https://phabricator.services.mozilla.com/D170556
2023-02-25 00:50:36 +00:00
James Teh 621d06d8bd Bug 1781848: Split accessible/tests/browser/e10s/browser_obj_group.js into two files to avoid exceeding the timeout threshold. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D170562
2023-02-24 23:56:36 +00:00
James Teh 9a96659b76 Bug 1818176: Support querying to IAccessibleImage. r=nlapre
Bug 1763214 unified the Accessible image interface, including support in ia2AccessibleImage.
However, MsaaAccessible::Create wasn't updated accordingly and would only create an ia2AccessibleImage for a LocalAccessible.
The only thing we need to do here is to drop the Local requirement.
I also did some other drive-by cleanup in this function, converting LocalAccessible if checks to assertions for things that can only ever be Local.

Differential Revision: https://phabricator.services.mozilla.com/D170589
2023-02-23 23:42:23 +00:00
James Teh 2b84971d26 Bug 1767561 part 2: Add a11y tests for inert, dialog and fullscreen. r=emilio,morgan
Differential Revision: https://phabricator.services.mozilla.com/D170789
2023-02-23 21:01:41 +00:00
Emilio Cobos Álvarez ef73e7c47c Bug 1767561 - Deal with inert much like we deal with visibility: hidden. r=Jamie
Needs tests but this should do.

Differential Revision: https://phabricator.services.mozilla.com/D170752
2023-02-23 19:56:47 +00:00
Morgan Rae Reschenberg 9363d07cc1 Bug 1809695: Make DOM coords screen relative before comparing in testTextRange r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D170691
2023-02-23 18:54:14 +00:00
Morgan Rae Reschenberg 06c234d803 Bug 1800586: Refactor IsARIAControls to work with untilCacheIs r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D170541
2023-02-23 00:02:21 +00:00
Eitan Isaacson cd1cd3c259 Bug 1730095 - P6: Introduce CachedTextMarker on MacOS. r=morgan
These text marker and marker range classes use our text cache and don't rely on any sync calls.

There are some edge cases where the range for boundary type code diverges from the non-caching one. The tests have amended exceptions for that in cases where the caching code is more correct, or at least not more wrong :)

Differential Revision: https://phabricator.services.mozilla.com/D168451
2023-02-22 04:53:01 +00:00
Eitan Isaacson 875d8f8095 Bug 1730095 - P5: Add GeckoTextMarker proxy class. r=morgan
Abstracting the text marker will allow us to have a drop-in caching version in the next patch.
In this change I moved the (de)serializing code to the proxy class and changed it from being a constructor to a static method. I also added standalone get-range-for methods instead of the enum because the caching version will transition away from it. It was useful in the non-caching version because it allowed us to have one sync message with an enum and a switch statement in the recieving end.

Differential Revision: https://phabricator.services.mozilla.com/D168450
2023-02-22 04:53:01 +00:00
Eitan Isaacson b544041558 Bug 1730095 - P4: Rename GeckoTextMarker to LegacyTextMarker. r=morgan
Done here in a standalone patch to keep things simpler. Includes a typedef to bridge the
gap for the next patch where we will reintroduce `GeckoTextMarker` as an abstracting
wrapper class.

Differential Revision: https://phabricator.services.mozilla.com/D168449
2023-02-22 04:53:00 +00:00
Eitan Isaacson 53633c7159 Bug 1730095 - P3: Move common functions to MacUtils. r=morgan
This will be needed for another text marker implementation.

Differential Revision: https://phabricator.services.mozilla.com/D168448
2023-02-22 04:53:00 +00:00
Eitan Isaacson 39cc60ffe5 Bug 1730095 - P2: Unify checked state enum in header and include needed headers. r=morgan
When files shift around into other unified build files things go wrong.
This puts an identically named enum in a header do it doesn't get redefined.

Differential Revision: https://phabricator.services.mozilla.com/D168447
2023-02-22 04:53:00 +00:00
Eitan Isaacson 31c0b1e98c Bug 1730095 - P1: Refactor text Mac marker tests. r=morgan
This change gives a bit more flexibility for isolating issues and seeing which specific marker offset is giving trouble when a test fails.

Depends on D168445

Differential Revision: https://phabricator.services.mozilla.com/D168446
2023-02-22 04:52:59 +00:00
James Teh f826326f5f Bug 1816346 part 2: If we force an Accessible to be created due to transform/fixed/sticky despite it being presentational, make it a generic Accessible. r=nlapre
Otherwise, semantics are exposed (e.g. for a table), which completely defeats the author's intent that this be treated as presentational.

Differential Revision: https://phabricator.services.mozilla.com/D170165
2023-02-22 04:46:50 +00:00
James Teh 75092d8fb0 Bug 1816346 part 1: Fix the transform tree creation test in browser_test_simple_transform.js. r=nlapre
Previously, the test was retrieving an Accessible with a non-existent id and calling testAccessibleTree on it.
That meant we were calling testAccessibleTree with null, which is a no-op.
Now, we get the intended Accessible so that the test actually tests what it was supposed to test.
This is important to test a potential bug in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D170306
2023-02-22 04:46:50 +00:00
Eitan Isaacson 8bf95c7d17 Bug 1814220 - Allow ignoring list item markers in TextLeafPoint::FindBoundary. r=Jamie
Refactor in FindBoundary to allow easier skipping of leaves in the loop.

Differential Revision: https://phabricator.services.mozilla.com/D168445
2023-02-22 04:17:31 +00:00
Butkovits Atila d45ed2897d Backed out 2 changesets (bug 1816346) for causing failures at test_table.html. CLOSED TREE
Backed out changeset eeb78c17513c (bug 1816346)
Backed out changeset 22b32e106152 (bug 1816346)
2023-02-22 04:45:07 +02:00
James Teh 4f47e992e7 Bug 1816346 part 2: If we force an Accessible to be created due to transform/fixed/sticky despite it being presentational, make it a generic Accessible. r=nlapre
Otherwise, semantics are exposed (e.g. for a table), which completely defeats the author's intent that this be treated as presentational.

Differential Revision: https://phabricator.services.mozilla.com/D170165
2023-02-22 02:17:56 +00:00
James Teh 193890e062 Bug 1816346 part 1: Fix the transform tree creation test in browser_test_simple_transform.js. r=nlapre
Previously, the test was retrieving an Accessible with a non-existent id and calling testAccessibleTree on it.
That meant we were calling testAccessibleTree with null, which is a no-op.
Now, we get the intended Accessible so that the test actually tests what it was supposed to test.
This is important to test a potential bug in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D170306
2023-02-22 02:17:55 +00:00
Emilio Cobos Álvarez a228002bd2 Bug 1815229 - Remove nsImageBoxFrame. r=tnikkel,layout-reviewers
nsImageFrame has support for displaying style URIs / an owned image
request, so use it.

The main behavior difference is that we don't fire `load` / `error`
events for those images anymore, but I don't see any event listener for
those around, so I think they can go.

Differential Revision: https://phabricator.services.mozilla.com/D168958
2023-02-21 17:36:11 +00:00
Eitan Isaacson 4cdf1e6cc0 Bug 1816536 - Fix document edge issues in FindBounary. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D169726
2023-02-21 16:37:24 +00:00
Eitan Isaacson a8c6dc0db1 Bug 1816573 - Use flags in TextLeafPoint::FindBoundary instead of boolean arguments. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D169740
2023-02-21 16:37:23 +00:00
Florian Quèze 7567717c5e Bug 1817506 - Make accessible/tests/mochitest/tree/test_media.html wait for Fluent to update asynchronously the accessible value of the scrubber, r=Gijs.
Differential Revision: https://phabricator.services.mozilla.com/D170396
2023-02-20 22:16:19 +00:00
Razvan Cojocaru a334f46de8 Bug 755621 - Add downcasting for nsXULTreeItemAccessibleBase. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D170051
2023-02-20 06:37:16 +00:00
James Teh e425f02438 Bug 1816601: HyperTextAccessibleBase::OffsetAtPoint: Return 0 if the point is within the container but before the rect at offset 0. r=nlapre
This perpetuates a bug in (local) HyperTextAccessible that some users have unfortunately come to rely on.

Differential Revision: https://phabricator.services.mozilla.com/D169802
2023-02-16 11:57:14 +00:00
Robert Longson 88d6e6fbaa Bug 1817075 - Use nsIFrame::HasAnyStateBits() whenever possible instead of GetStateBits() r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D170006
2023-02-16 08:10:28 +00:00
Cosmin Sabou 5878f95ed4 Backed out changeset 95d948d14dfe (bug 1816601) for causing mochiest failures on browser_test_text.js. CLOSED TREE 2023-02-16 02:38:01 +02:00
James Teh e951e20e20 Bug 1816601: HyperTextAccessibleBase::OffsetAtPoint: Return 0 if the point is within the container but before the rect at offset 0. r=nlapre
This perpetuates a bug in (local) HyperTextAccessible that some users have unfortunately come to rely on.

Differential Revision: https://phabricator.services.mozilla.com/D169802
2023-02-15 23:24:28 +00:00
Iulian Moraru 11536128a2 Bug 1782783 - disable browser_test_focus_urlbar.js on linux for frequent failures. patch re-made to solve landing conflicts r=aryx
Differential Revision: https://phabricator.services.mozilla.com/D169883
2023-02-15 10:32:05 +00:00
Joel Maher a62ef05cdb Bug 1816191 - Skip tests in order to keep win7 running @ azure. r=gbrown,necko-reviewers,settings-reviewers,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,nalexander,sgalich,alwu
Differential Revision: https://phabricator.services.mozilla.com/D169523
2023-02-14 23:44:12 +00:00
Robert Longson 986ccaa6d3 Bug 1815959 - Check the content type for SVG shapes and images, not the frame r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D169369
2023-02-14 05:59:41 +00:00
James Teh 706f120344 Bug 1816094: Simplify calculation of character bounds in LocalAccessible::BundleFieldsForCache. r=morgan
Previously, we retrieved an ancestor frame and various rects and used a transform to make continuation char rects relative to their primary frame.
Since all we need is an offset, we can just use nsIFrame::GetOffsetTo, which does all of this for us.

Differential Revision: https://phabricator.services.mozilla.com/D169446
2023-02-14 04:45:49 +00:00
James Teh e0626af463 Bug 1816022: LocalAccessible::ParentRelativeBounds: If the bounding frame's rect is empty but its union rect is not, offset by its union rect. r=morgan
See the code comment for explanation.

Differential Revision: https://phabricator.services.mozilla.com/D169443
2023-02-14 04:44:18 +00:00
Gijs Kruitbosch 387cf24ca0 Bug 1810141 - fix tests to deal with changes to loadURI, r=mossop,perftest-reviewers,geckoview-reviewers,extension-reviewers,sparky,owlish
Depends on D168396

Differential Revision: https://phabricator.services.mozilla.com/D168397
2023-02-13 23:50:41 +00:00
Eitan Isaacson d5e8f25121 Bug 1815774 - Introduce TextLeafPoint XPCOM bindings and tests. r=Jamie
This uses a bitfield for flags in FindBoundary, the idea is that it
will give some regression coverage if/when we move the native API
to do the same.

Differential Revision: https://phabricator.services.mozilla.com/D169246
2023-02-13 17:56:12 +00:00
Andi-Bogdan Postelnicu d7e8a09c21 Bug 1519636 - Reformat recent changes to the Google coding style. r=glandium
Updated with clang-format version 15.0.5 (taskcluster-MKK8dHUpQkGfPLA793lizg)
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D168658
2023-02-13 15:02:07 +00:00
Cristina Horotan 5f4356e527 Backed out 9 changesets (bug 1810141) for several test failures on a CLOSED TREE
Backed out changeset 8781a0d1254d (bug 1810141)
Backed out changeset 131037295784 (bug 1810141)
Backed out changeset 3852fbe290f4 (bug 1810141)
Backed out changeset 118f131a524a (bug 1810141)
Backed out changeset ab5d76846e10 (bug 1810141)
Backed out changeset dce3aa683445 (bug 1810141)
Backed out changeset 4dc41d90dbb3 (bug 1810141)
Backed out changeset 50b57ba1a061 (bug 1810141)
Backed out changeset 569de94781e4 (bug 1810141)
2023-02-13 16:05:30 +02:00
Gijs Kruitbosch ff1cc20bd7 Bug 1810141 - fix tests to deal with changes to loadURI, r=mossop,perftest-reviewers,geckoview-reviewers,extension-reviewers,sparky,owlish
Depends on D168396

Differential Revision: https://phabricator.services.mozilla.com/D168397
2023-02-13 12:55:26 +00:00
Emilio Cobos Álvarez d28f1e4d47 Bug 1815255 - Fix tests to deal with flexbox emulation. r=Jamie,Gijs
Mostly changing XUL attributes to CSS properties, though there are a few
tricky ones:

 * test_offsets.xhtml expects the scroller to be full-width, while
   modern flexbox would honor width: 200px (so just remove it).

 * window_intrinsic_size.xhtml was relying on the div imposing a XUL
   min-size (the test is for SetSizeConstraints, bug 1447056). Use
   min-height instead as that's what modern flexbox reads. Confirmed
   that bug doesn't regress in any case.

 * object-fit-contain-png-001.xhtml has a float: left which had no
   effect on -moz-box, but which assert with modern layout[1]. In the
   future I think we could remove that assert but anyways, for now just
   keeping behavior.

 * image-size.xhtml has a couple uninvestigated sizing differences. They
   didn't seem problematic.

 * 579323-1-ref.html changes because the other file has a canvas with
   width=100 height=100 which imposes an aspect ratio (which XUL never
   honored).

 * window_largemenu.xhtml shows a regression, but this never worked on
   some platforms (at least Linux+Wayland) and nobody has noticed it in
   the browser area, so I suspect we're fine.

[1]: https://searchfox.org/mozilla-central/rev/08362489086b10de96e7a199b267ea5504c01583/layout/generic/ReflowInput.cpp#2137

Differential Revision: https://phabricator.services.mozilla.com/D169084
2023-02-09 12:24:53 +00:00
James Teh 631c9ecf0a Bug 1775684 part 2: Don't create a DocAccessible if it doesn't exist yet when handling notifications for cache/tree updates. r=morgan
We only use these notifications from layout to push cache updates or insert Accessibles that were skipped during the initial build.
If the DocAccessible doesn't exist yet, creating it is pointless since we can't do this update until the tree is built.
The correct data will be included in the initial tree and cache push anyway.
Aside from pointless refresh ticks, this really shouldn't make any difference, since we don't build the initial tree until layout is ready anyway.
However, the only remotely relevant thing I can think of that's changed in the a11y code lately that might have caused a spike in these test failures is that bounds notifications might get fired earlier/more often from layout, potentially causing earlier creation of DocAccessibles.
Any change to timing might cause a shift in intermittent failures, and since this is wasteful anyway, we may as well fix it.

Differential Revision: https://phabricator.services.mozilla.com/D168911
2023-02-09 04:50:53 +00:00
James Teh 8cd27f807a Bug 1775684 part 1: Ignore frame visibility when caching focusable state for a11y. r=morgan,emilio
See the code comment in LocalAccessible::NativeInteractiveState for explanation.

Differential Revision: https://phabricator.services.mozilla.com/D168910
2023-02-09 04:50:53 +00:00
James Teh 98ad175f52 Bug 1814800: Force Accessible creation if an element has position: fixed/sticky. r=nlapre
We need to know about position: fixed in the parent process a11y cache, so we always need an Accessible for such elements.
We don't cache the fact that something is position: sticky, but we need the Accessible so that it can be notified about bounds updates when it moves within its container.
Previously, we calculated bounds incorrectly if a position: fixed/sticky element wasn't included in the a11y tree.

Differential Revision: https://phabricator.services.mozilla.com/D168916
2023-02-09 04:50:52 +00:00
Marian-Vasile Laza 7675a138b5 Backed out 2 changesets (bug 1815255) for causing reftest failures. CLOSED TREE
Backed out changeset b1173e8c7497 (bug 1815255)
Backed out changeset bd09cf2a4abb (bug 1815255)
2023-02-09 04:26:01 +02:00
Emilio Cobos Álvarez 656f11b2a0 Bug 1815255 - Fix tests to deal with flexbox emulation. r=Jamie,Gijs
Mostly changing XUL attributes to CSS properties, though there are a few
tricky ones:

 * test_offsets.xhtml expects the scroller to be full-width, while
   modern flexbox would honor width: 200px (so just remove it).

 * window_intrinsic_size.xhtml was relying on the div imposing a XUL
   min-size (the test is for SetSizeConstraints, bug 1447056). Use
   min-height instead as that's what modern flexbox reads. Confirmed
   that bug doesn't regress in any case.

 * object-fit-contain-png-001.xhtml has a float: left which had no
   effect on -moz-box, but which assert with modern layout[1]. In the
   future I think we could remove that assert but anyways, for now just
   keeping behavior.

 * image-size.xhtml has a couple uninvestigated sizing differences. They
   didn't seem problematic.

 * 579323-1-ref.html changes because the other file has a canvas with
   width=100 height=100 which imposes an aspect ratio (which XUL never
   honored).

 * window_largemenu.xhtml shows a regression, but this never worked on
   some platforms (at least Linux+Wayland) and nobody has noticed it in
   the browser area, so I suspect we're fine.

[1]: https://searchfox.org/mozilla-central/rev/08362489086b10de96e7a199b267ea5504c01583/layout/generic/ReflowInput.cpp#2137

Differential Revision: https://phabricator.services.mozilla.com/D169084
2023-02-09 00:55:13 +00:00
Nathan LaPre dbd808364d Bug 1806356: Create an accessible if the element's frame has a transform, r=Jamie
This revision changes the logic of MustCreateAccessible such that we always create
an accessible if the content's frame has been transformed and it has children.
This ensures that we have accessibles to which we apply transforms when
calculating accessible bounds. This revision also adds tests to verify that the
accessible is created, even when the element has role="none", both initially and
as a result of an on-the-fly style change.

Differential Revision: https://phabricator.services.mozilla.com/D167760
2023-02-08 19:43:35 +00:00
Cristina Horotan fbcc0f66b4 Backed out 2 changesets (bug 1815255) for causing chrome failures at test_focus.xhtml on a CLOSED TREE
Backed out changeset 983fe4e70647 (bug 1815255)
Backed out changeset f8c6426c60f9 (bug 1815255)
2023-02-08 19:50:19 +02:00
Emilio Cobos Álvarez 5db814c383 Bug 1815255 - Fix tests to deal with flexbox emulation. r=Jamie,Gijs
Mostly changing XUL attributes to CSS properties, though there are a few
tricky ones:

 * test_offsets.xhtml expects the scroller to be full-width, while
   modern flexbox would honor width: 200px (so just remove it).

 * window_intrinsic_size.xhtml was relying on the div imposing a XUL
   min-size (the test is for SetSizeConstraints, bug 1447056). Use
   min-height instead as that's what modern flexbox reads. Confirmed
   that bug doesn't regress in any case.

 * object-fit-contain-png-001.xhtml has a float: left which had no
   effect on -moz-box, but which assert with modern layout[1]. In the
   future I think we could remove that assert but anyways, for now just
   keeping behavior.

 * image-size.xhtml has a couple uninvestigated sizing differences. They
   didn't seem problematic.

 * 579323-1-ref.html changes because the other file has a canvas with
   width=100 height=100 which imposes an aspect ratio (which XUL never
   honored).

 * window_largemenu.xhtml shows a regression, but this never worked on
   some platforms (at least Linux+Wayland) and nobody has noticed it in
   the browser area, so I suspect we're fine.

[1]: https://searchfox.org/mozilla-central/rev/08362489086b10de96e7a199b267ea5504c01583/layout/generic/ReflowInput.cpp#2137

Differential Revision: https://phabricator.services.mozilla.com/D169084
2023-02-08 16:52:18 +00:00
Emilio Cobos Álvarez 6384797392 Bug 1812329 - Remove nsMenuBarFrame. r=smaug
This ended up being a lot more straight-forward than the menu changes.

TLDR:

 * nsMenuBarFrame -> XULMenuBarElement
 * nsMenuBarListener -> MenuBarListener

Rest should be rather straight-forward.

Depends on D168649

Differential Revision: https://phabricator.services.mozilla.com/D167809
2023-02-08 13:12:23 +00:00
James Teh 1dcf0a5946 Bug 1814785: Include the transform only for the frame itself in the a11y cache, rather than calculating it relative to an ancestor. r=morgan
Calculating it relative to an ancestor causes problems when the frame ancestry and the a11y ancestry diverge.
For example, this can happen for a transform which is also position: absolute.
In that case, the parent Accessible's frame is not an ancestor of the child Accessible's frame.
Since the transform is no longer relative to the ancestor, we no longer need to remove our parent-relative bounds before applying it.
However, we do need to ensure that we apply the transform *before* adding parent-relative bounds.

Differential Revision: https://phabricator.services.mozilla.com/D169059
2023-02-08 05:45:55 +00:00
Morgan Rae Reschenberg a5551e25d4 Bug 1815153: Add test to verify position:sticky bounds when scrolling, after dynamic style change r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D169129
2023-02-08 04:19:19 +00:00
Iulian Moraru d19790ed5f Backed out 2 changesets (bug 1812329) for causing multiple leaks. CLOSED TREE
Backed out changeset d663fc115ab9 (bug 1812329)
Backed out changeset 5464978a27a8 (bug 1812329)
2023-02-07 23:45:43 +02:00
Emilio Cobos Álvarez b9833bfcca Bug 1812329 - Remove nsMenuBarFrame. r=smaug
This ended up being a lot more straight-forward than the menu changes.

TLDR:

 * nsMenuBarFrame -> XULMenuBarElement
 * nsMenuBarListener -> MenuBarListener

Rest should be rather straight-forward.

Depends on D168649

Differential Revision: https://phabricator.services.mozilla.com/D167809
2023-02-07 18:09:37 +00:00
Emilio Cobos Álvarez 0a2b2c6949 Bug 1815430 - Remove another chunk of dead code that I forgot to commit. a=bustage
MANUAL PUSH: Bustage fix CLOSED TREE
2023-02-07 15:16:26 +01:00
Emilio Cobos Álvarez 19d036b807 Bug 1815430 - nsFocusManager::GetRedirectedFocus is dead code. r=smaug
No implementation of nsIDOMXULMenuListElement returns an input field
(this is menulist.js and autocomplete-input.js).

It seems autocomplete-input used to do this, but it got refactored to
extend HTMLInputElement instead, so this code can all go.

Differential Revision: https://phabricator.services.mozilla.com/D169066
2023-02-07 13:47:48 +00:00
James Teh 20aee7cff6 Bug 1814780: Fail gracefully for calls to a11y::LazyInstantiator from a background thread which would cause us to create the accessibility service. r=nlapre
The accessibility service and our COM objects can only be used on the main thread.
COM rules should mean that we never get direct calls on a background thread, but apparently, someone isn't following the rules.

Differential Revision: https://phabricator.services.mozilla.com/D168914
2023-02-06 20:12:09 +00:00
James Teh 25c5288ae2 Bug 1814538: Don't call RemoteAccessibleBase::IsFixedPos if mCachedFields is null. r=nlapre
RetrieveCachedBounds returns Nothing() if mCachedFields is null.
Since we already have a large block which is only executed if RetrieveCachedBounds returned something, just move the call to IsFixedPos inside that block.

Differential Revision: https://phabricator.services.mozilla.com/D168642
2023-02-02 23:25:54 +00:00
Neil Deakin 9c2e7458ba Bug 1776879, replace text/unicode for clipboard and drag and drop and use text/plain directly, r=edgar,mak,stransky,geckoview-reviewers,extension-reviewers,zombie,m_kato
Most usage is a straight replacement but gtk needs extra changes as it transfers plain text in UTF8 natively and needs to be converted into UTF16, and Windows uses single-byte characters for RTF and CF_HTML formats so we preserve this.

Differential Revision: https://phabricator.services.mozilla.com/D158587
2023-02-01 23:30:55 +00:00
James Teh 9dfda5ccb0 Bug 1813980: Check IsDoc before Parent in RemoteAccessibleBase::ApplyCrossDocOffset. r=morgan
We call this function on every ancestor when calculating bounds.
RemoteParent() currently requires a hash lookup, so it's more efficient to early return for !IsDoc() first.
This is a micro-optimisation, but it might have some impact given that we call this on every ancestor, especially when hit testing, where we call Bounds() a lot.

As a bit of drive-by cleanup, use RemoteParent() rather than calling Parent() and IsRemote/AsRemote().

Differential Revision: https://phabricator.services.mozilla.com/D168346
2023-02-01 05:02:01 +00:00
James Teh 1278600686 Bug 1813256 follow-up: Add test. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D168331
2023-02-01 04:58:30 +00:00
Morgan Rae Reschenberg e8d1a57763 Bug 1809836: Avoid adding scroll offsets when computing bounds for position:fixed accs r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D166730
2023-02-01 01:23:10 +00:00
James Teh 3d456f3e7b Bug 1813256: Don't descend into other documents when tracking moved LocalAccessibles. r=nlapre
The set of moved LocalAccessibles on a document should only include Accessibles within that document.
Previously, we were descending into iframe documents.
This resulted in notifying the parent process about incorrect ids being moved and potentially pushing the cache in an invalid state.

Differential Revision: https://phabricator.services.mozilla.com/D168310
2023-01-30 22:28:48 +00:00
Mark Banner 61c8871b31 Bug 1812977 - Remove now unnecessary import-globals-from statements in accessible. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D168069
2023-01-30 19:33:37 +00:00
Otto Länd 129697ae6a Bug 1811092: apply code formatting via Lando
# ignore-this-changeset
2023-01-27 20:20:51 +00:00
Eitan Isaacson 80156311b1 Bug 1811092 - P3: Add browser text selection tests and increase coverage. r=Jamie
Added more coverage for generated content too.

Depends on D167202

Differential Revision: https://phabricator.services.mozilla.com/D167203
2023-01-27 20:15:12 +00:00
Eitan Isaacson eb7fe304b8 Bug 1811092 - P2: Add async text selection removal message. r=Jamie
Depends on D167201

Differential Revision: https://phabricator.services.mozilla.com/D167202
2023-01-27 20:15:12 +00:00
Eitan Isaacson dbdb811bfa Bug 1811092 - P1: Add new async add/set text selection message. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D167201
2023-01-27 20:15:11 +00:00
Sandor Molnar 41b0aaaaac Backed out changeset b27d83c0aa57 (bug 1806356) for causint dt failures in devtools/client/netmonitor/test/browser_net_basic-search.js 2023-01-27 05:23:17 +02:00
James Teh 0c12a12bbd Bug 1811972: When an Accessible is moved in the tree, queue a bounds cache update. r=morgan
When an Accessible is moved, it's possible it is re-parented.
In that case, since our cached bounds are relative to the parent, the bounds are now incorrect.
To fix this, queue a bounds cache update whenever an Accessible is moved.
This will also trigger when an Accessible remains under the same parent.
However, because we cache bounds in LocalAccessible, we won't actually push a cache update unless the bounds really changed.

Differential Revision: https://phabricator.services.mozilla.com/D167866
2023-01-26 23:43:08 +00:00