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

10925 Коммитов

Автор SHA1 Сообщение Дата
Frédéric Wang 01d8813ff7 Bug 1765615 - Improve browser_treeupdate_csscontentvisibility.js. r=Jamie
Extend a bit the test for dynamic changes to content-visibility, adding
the following checks:

* If there are text descendants in the content-visibility subtree,
  make sure they are created when switching to auto ; and removed
  when switching back to hidden.
* If there is a content-visibility: hidden or a visibility: hidden
  descendant, make sure pruning still applies when switching to
  auto.
* If there is a shadow host in the  content-visibility subtree,
  make sure that shadow subtree is properly updated when
  content-visibility changes.

Differential Revision: https://phabricator.services.mozilla.com/D196964
2024-01-10 09:26:17 +00:00
Daniel Holbert eec12e877e Bug 1860705: Use pushPrefEnv instead of setBoolPref in mochitest test_statechange.html. r=eeejay
setBoolPref has a persistent effect for the rest of the test run (potentially
affecting the behavior of other prefs), so we don't want to use
that. This test is currently failing when run in test-verify mode as a result
of this.  With pushPrefEnv, the test will properly undo its pref-modification
when it completes.

Note: I'm moving the pref-toggle statement inside of a function so that I can
use the ergonomic `await` syntax. This is still essentially right at the start
of the test, since `doTests` is the main function here.

Differential Revision: https://phabricator.services.mozilla.com/D197830
2024-01-09 20:22:57 +00:00
Frédéric Wang c1463070d9 Bug 1871361 - Fix typo "recieved" in accessibility code. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D197062
2024-01-05 07:32:39 +00:00
Masayuki Nakano cd53d5600e Bug 1816581 - part 6: Move the static methods used for moving caret or considering caret geometry into new utility class r=emilio
The methods are in `nsCaret`, `nsFrameSelection` and `dom::Selection`.  That
makes harder to read, and they are called each other, so, they are reused for
different purpose.  Therefore, it must be better to move them into a new class.
Then, the name differences may become more unclear.  If you think so, feel free
to request renaming some methods of them.

Differential Revision: https://phabricator.services.mozilla.com/D197288
2023-12-27 04:42:12 +00:00
Masayuki Nakano fe9fef936b Bug 1816581 - part 1: Make `CaretAssociationHint` an enum class r=emilio
For forward-decl-able.

Differential Revision: https://phabricator.services.mozilla.com/D197283
2023-12-27 04:42:09 +00:00
James Teh a09e359b77 Bug 1871385: Set pref to enable popover in related a11y test. r=ayeddi
Differential Revision: https://phabricator.services.mozilla.com/D197126
2023-12-22 21:19:59 +00:00
Emilio Cobos Álvarez 06608371e0 Bug 1871023 - Trivially fix some orange.
MANUAL PUSH: Trivial orange fix CLOSED TREE
2023-12-21 11:16:20 +01:00
James Teh 06eb0ca294 Bug 1834718: Don't process a duplicate DocAccessible::ContentRemoved call for a DOM node we've already processed. r=morgan
ContentRemoved recursively walks both AllChildrenIterator and direct DOM children.
In addition, we might get duplicate notifications from DOM and layout, plus PruneOrInsertSubtree might do a recursive walk and it too calls ContentRemoved.
To avoid this duplicate processing, keep a set of removed DOM nodes on the DocAccessible which we clear after mutation events are processed.

Differential Revision: https://phabricator.services.mozilla.com/D196707
2023-12-20 21:59:41 +00:00
Emilio Cobos Álvarez 07c2523b91 Bug 1870512 - Remove accessibility hack that should not longer be needed. r=Jamie
There's no windows with popup=true anymore as of the previous patch.

Depends on D196665

Differential Revision: https://phabricator.services.mozilla.com/D196666
2023-12-20 21:51:06 +00:00
Ziran Sun 584d474cc3 Bug 1867811 - Expose EXPANDED state for element with popovertarget. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D196541
2023-12-19 17:30:56 +00:00
Norisz Fay 90733dd7b4 Backed out changeset 846e436ca1c2 (bug 1870512) for causing automation.py related Windows failures CLOSED TREE 2023-12-18 21:53:13 +02:00
Emilio Cobos Álvarez 1fb0635d77 Bug 1870512 - Remove accessibility hack that should not longer be needed. r=Jamie
There's no windows with popup=true anymore as of the previous patch.

Depends on D196665

Differential Revision: https://phabricator.services.mozilla.com/D196666
2023-12-18 17:56:42 +00:00
Jens Stutte 5ad7616e60 Bug 1839051 - Make AccIdxComparator resilient against calls with r=Jamie=b.
std::sort used by nsTArray::Sort expects the comparator to be tolerant
for being called to compare the very same element with itself.

Differential Revision: https://phabricator.services.mozilla.com/D195482
2023-12-11 06:53:28 +00:00
James Teh 583b9dc159 Bug 1836823: If we create an Accessible for SVG <foreignObject> due to an ARIA role, etc., use a HyperTextAccessible. r=morgan
We don't normally create an Accessible for <foreignObject>.
However, if there's an ARIA role or similar, we forceably create one.
Previously, if we ever did this for an SVG element, we would use an AccessibleWrap, which doesn't support HyperText.
This is normally correct because most SVG elements can't contain text.
However, a <foreignObject> can most definitely contain text, so we must use HyperTextAccessible.
This fixes assertions and text attributes.

Differential Revision: https://phabricator.services.mozilla.com/D195387
2023-12-11 00:39:25 +00:00
Randell Jesup 55cad8d48f Bug 1847298: IPC constructor cleanup r=nika,padenot,dom-storage-reviewers,necko-reviewers,cookie-reviewers,asuth,Jamie
Differential Revision: https://phabricator.services.mozilla.com/D185472
2023-12-08 15:56:39 +00:00
Eitan Isaacson 45e41353ee Bug 1868092 - Don't call DoPivot on a null leaf in caret move. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D195599
2023-12-06 22:06:07 +00:00
Joel Maher c993099c60 Bug 1865385 - remove win7/win-aarch64 annotations from reftest manifests. r=gbrown
Differential Revision: https://phabricator.services.mozilla.com/D193995
2023-12-05 21:49:04 +00:00
Daniel Holbert 53fd58f26a Bug 1867886: Ensure that NotificationController can't re-register with the refresh driver after it's been unregistered in Shutdown. r=eeejay
This is just a "belt-and-suspenders" invariant tightening.  Shouldn't impact
behavior at all, assuming that we don't call methods on NotificationController
objects that have been nerfed with Shutdown().

Differential Revision: https://phabricator.services.mozilla.com/D195321
2023-12-04 20:42:05 +00:00
Daniel Holbert 2982f9468b Bug 1867358 part 4: Add some release asserts (and upgrade an existing assert), to validate that NotificationController isn't still registered as a refresh observer when it's destroyed. r=eeejay
If these assertions somehow fail, then we are probably doomed to crash anyway.
The new release assertions just make it so we'll crash in a controlled way,
with a more actionable backtrace, closer to the problem-spot.

This patch also removes one mDocument null-check that's becoming redundant
since it follows a release-assert that would make us abort if the pointer is
null.

Differential Revision: https://phabricator.services.mozilla.com/D195042
2023-12-01 17:18:24 +00:00
Daniel Holbert 9ef65f2fc2 Bug 1867358 part 3: Adjust NotificationController to avoid modifying mObservingState after Shutdown has been called. r=eeejay
We can sometimes reach the code that this patch is touching, just we've been
shutdown (as can be seen by the fact that we have a null mDocument pointer); in
that case, it's problematic for us to be assigning 'mObservingState' here. The
mObservingState assignment is meant to be *undoing* the temporary assignments
earlier in the function, but in this post-Shutdown situation, it's actually
causing us to forget that we already unregistered as a refresh observer, in a
nested stack level's call to Shutdown().

I think this one place is the only mObservingState assignment that's got this
problem. The other mObservingState assignments should all be OK (they don't
need a "have we shut down" check), because they're all either:
a) modifying mObservingState to record an actual change that we just made to
our RefreshDriver registration,
...or:
b) immediately adjacent to code that dereferences mDocument, implying that
mDocument is known-to-be-non-null at that point, which means we know we haven't
been Shutdown.

This patch unblocks us from adding a release assert in the
NotificationController destructor in the next patch in this series. (Without
this patch, that assertion can be made to fail, via this inadvertent
mObservingState assignment.)

Depends on D195041

Differential Revision: https://phabricator.services.mozilla.com/D195200
2023-12-01 17:18:23 +00:00
Daniel Holbert 2fb4a5340d Bug 1867358 part 2: Assert that EventQueue's mDocument member is initialized to something non-null. r=eeejay
This patch is non-functional; it's just adding a debug-only assert, for
documentation and lightweight validation purposes.

As far as I can tell, the asserted condition must hold, since it looks like
this constructor is only invoked via this instantiation of the subclass, which
passes `this` as the aDocument arg (and `this` must trivially be non-null):
https://searchfox.org/mozilla-central/rev/12ea2c521cdd071a6d25b0894f31f8f23b18b76a/accessible/generic/DocAccessible.cpp#422

This assertion makes it easier to reason about the usages of this member-var.
There are lots of checks for whether mDocument is nullptr, and it's useful to
know that it'll always be non-null to begin with (though it becomes null
eventually, as part of teardown, when NotificationController::Shutdown is
called).

Differential Revision: https://phabricator.services.mozilla.com/D195041
2023-12-01 17:18:23 +00:00
Daniel Holbert 6bc34b0d8d Bug 1867358 part 1: Fix up unbraced single-line if-statements in NotificationController and its superclass. r=eeejay
This patch has no functional change; it's just some trivial fixups to align
with with Mozilla C++ coding style.

Differential Revision: https://phabricator.services.mozilla.com/D195040
2023-12-01 17:18:22 +00:00
James Teh 6f5b841acc Bug 1864015: Correctly handle removal of the conceptual parent. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D194322
2023-11-30 23:53:08 +00:00
Natalia Csoregi 6cc014163b Backed out 3 changesets (bug 1867358) as per request. CLOSED TREE
Backed out changeset 0ce8fcf63e62 (bug 1867358)
Backed out changeset 6d9bf8dfbb4d (bug 1867358)
Backed out changeset e995a2b2ff4d (bug 1867358)
2023-11-30 07:09:25 +02:00
Daniel Holbert 06b443c110 Bug 1867358 part 3: Add some release asserts (and upgrade an existing assert), to validate that NotificationController isn't still registered as a refresh observer when it's destroyed. r=eeejay
If these assertions somehow fail, then we are probably doomed to crash anyway.
The new release assertions just make it so we'll crash in a controlled way,
with a more actionable backtrace, closer to the problem-spot.

This patch also removes one mDocument null-check that's becoming redundant
since it follows a release-assert that would make us abort if the pointer is
null.

Depends on D195041

Differential Revision: https://phabricator.services.mozilla.com/D195042
2023-11-29 23:32:23 +00:00
Daniel Holbert 3d7fe55b5b Bug 1867358 part 2: Assert that EventQueue's mDocument member is initialized to something non-null. r=eeejay
This patch is non-functional; it's just adding a debug-only assert, for
documentation and lightweight validation purposes.

As far as I can tell, the asserted condition must hold, since it looks like
this constructor is only invoked via this instantiation of the subclass, which
passes `this` as the aDocument arg (and `this` must trivially be non-null):
https://searchfox.org/mozilla-central/rev/12ea2c521cdd071a6d25b0894f31f8f23b18b76a/accessible/generic/DocAccessible.cpp#422

This assertion makes it easier to reason about the usages of this member-var.
There are lots of checks for whether mDocument is nullptr, and it's useful to
know that it'll always be non-null to begin with (though it becomes null
eventually, as part of teardown, when NotificationController::Shutdown is
called).

Depends on D195040

Differential Revision: https://phabricator.services.mozilla.com/D195041
2023-11-29 23:32:23 +00:00
Daniel Holbert 19f58281bb Bug 1867358 part 1: Fix up unbraced single-line if-statements in NotificationController and its superclass. r=eeejay
This patch has no functional change; it's just some trivial fixups to align
with with Mozilla C++ coding style.

Differential Revision: https://phabricator.services.mozilla.com/D195040
2023-11-29 23:32:22 +00:00
James Teh f36ae8432b Bug 1862802 part 5: Remove virtual cursor change event. r=eeejay
Depends on D192645

Differential Revision: https://phabricator.services.mozilla.com/D192646
2023-11-29 03:53:20 +00:00
James Teh 603681f423 Bug 1862802 part 4: Remove SessionAccessibility call to AccessibleWrap::PivotTo. r=eeejay
This now just calls DoPivot and SendAccessibilityFocusEvent directly.

Depends on D192644

Differential Revision: https://phabricator.services.mozilla.com/D192645
2023-11-29 03:53:20 +00:00
James Teh 4edd64405a Bug 1862802 part 3: Directly handle scrolling start events on Android instead of converting them to virtual cursor change events. r=eeejay
Depends on D192643

Differential Revision: https://phabricator.services.mozilla.com/D192644
2023-11-29 03:53:19 +00:00
James Teh c1a190ef64 Bug 1862802 part 2: Support find in page on Android using only caret events instead of converting them to virtual cursor change events. r=eeejay
Depends on D192642

Differential Revision: https://phabricator.services.mozilla.com/D192643
2023-11-29 03:53:19 +00:00
James Teh 447aa32c0e Bug 1862802 part 1: Provide an argument to PlatformCaretMoveEvent specifying whether the event was caused by user input. r=eeejay
This is needed in order to support find in page on Android using remote caret events instead of virtual cursor change events.

Depends on D192641

Differential Revision: https://phabricator.services.mozilla.com/D192642
2023-11-29 03:53:19 +00:00
Butkovits Atila 1cb12b49dd Backed out 5 changesets (bug 1862802) for causing multiple failures. CLOSED TREE
Backed out changeset 786805a2cdcc (bug 1862802)
Backed out changeset effe12f2120a (bug 1862802)
Backed out changeset 7488e7ba80c5 (bug 1862802)
Backed out changeset 3d0747ce0174 (bug 1862802)
Backed out changeset d1558d374cef (bug 1862802)
2023-11-29 03:10:17 +02:00
James Teh 44caba5c0c Bug 1862802 part 5: Remove virtual cursor change event. r=eeejay
Depends on D192645

Differential Revision: https://phabricator.services.mozilla.com/D192646
2023-11-28 22:03:21 +00:00
James Teh 0bafc2f978 Bug 1862802 part 4: Remove SessionAccessibility call to AccessibleWrap::PivotTo. r=eeejay
This now just calls DoPivot and SendAccessibilityFocusEvent directly.

Depends on D192644

Differential Revision: https://phabricator.services.mozilla.com/D192645
2023-11-28 22:03:20 +00:00
James Teh 3f0c5fad25 Bug 1862802 part 3: Directly handle scrolling start events on Android instead of converting them to virtual cursor change events. r=eeejay
Depends on D192643

Differential Revision: https://phabricator.services.mozilla.com/D192644
2023-11-28 22:03:20 +00:00
James Teh ea3ee1204a Bug 1862802 part 2: Support find in page on Android using only caret events instead of converting them to virtual cursor change events. r=eeejay
Depends on D192642

Differential Revision: https://phabricator.services.mozilla.com/D192643
2023-11-28 22:03:19 +00:00
James Teh cfdccbd78f Bug 1862802 part 1: Provide an argument to PlatformCaretMoveEvent specifying whether the event was caused by user input. r=eeejay
This is needed in order to support find in page on Android using remote caret events instead of virtual cursor change events.

Depends on D192641

Differential Revision: https://phabricator.services.mozilla.com/D192642
2023-11-28 22:03:19 +00:00
James Teh 0b2de0e6be Bug 1822004: On Android, use RemoteAccessible (CtW) hit testing instead of a DOM event. r=eeejay
This unifies hit testing across all platforms.
It also removes one of the few remaining uses of virtual cursor change events.

Differential Revision: https://phabricator.services.mozilla.com/D192641
2023-11-28 07:37:30 +00:00
James Teh 3396179cba Bug 1862437: Return the correct data for ATK get_row_column_span. r=eeejay
Previously, this incorrectly returned the row in the column field, the column in the row field, and the column span for both the row and column spans.

Differential Revision: https://phabricator.services.mozilla.com/D192912
2023-11-21 23:34:15 +00:00
James Teh a8d36840cb Bug 1862534: Groundwork for ATK accessibility API tests. r=eeejay,jmaher
This adds setup code and utility functions for ATK to the Python environment.
I also needed to prevent front-end accessibility checks (AccessibilityUtils) from force disabling accessibility for a11y engine tests.
Although the tests re-enabled it anyway, this seems to break AT-SPI's interaction with our ApplicationAccessible.
Disabling it really doesn't make sense in this case anyway.
This patch includes a simple role test to show all of this working.

Differential Revision: https://phabricator.services.mozilla.com/D192911
2023-11-21 02:11:49 +00:00
James Teh 297b3d04a4 Bug 1864511: When hit testing a RemoteAccessible image, image map or inline element without children, just use the rect instead of walking children. r=morgan
An image or image map can't contain text, so it doesn't make sense to walk the lines of any children.
Previously, for normal images (not image maps), we would find no children and thus return false because there were no children containing the point, thus breaking hit testing for images.
For image maps, hit testing would fail for any points that weren't covered by areas.
Now, we don't walk children in these cases, instead just using the element's rect.
We apply this same rule for other inline elements without children, since there are no children to walk in that case and we should use the rect there rather than always returning false.
I don't know if this last case is something that ever happens in practice, but I figured it was best to handle it just in case.

Differential Revision: https://phabricator.services.mozilla.com/D193509
2023-11-17 06:37:27 +00:00
Morgan Rae Reschenberg b4c11c02b6 Bug 1851441: Speculative fix for image map/html area element crash r=Jamie
I think this crash may occur when the image map is being removed or when the area element is being moved.
In any case, I'm reasonably confident that the reason for this crash was a null boundingFrame passed to TransformRect, which should only happen when the image map doesn't exist / has no frame.

Also, we really shouldn't be transforming anyway, so I’ve removed the transform call.

Differential Revision: https://phabricator.services.mozilla.com/D193460
2023-11-15 22:37:29 +00:00
James Teh 4edbfba7d4 Bug 1863482 part 2: Generate RelationType.h from nsIAccessibleRelation.idl. r=eeejay
This eliminates duplication.

Differential Revision: https://phabricator.services.mozilla.com/D193002
2023-11-14 02:31:54 +00:00
James Teh 384d7e17fe Bug 1863482 part 1: Change includes of RelationType.h to mozilla/a11y/RelationType.h. r=eeejay
RelationType.h will soon be generated, but it will be generated within the obj dir, so local includes won't work.
Our C++ style guide says we should prefer exported includes wherever possible anyway.

This was done with this shell command inside the accessible/ directory:

```
sed -i 's,#include "RelationType.h",#include "mozilla/a11y/RelationType.h",' `git grep -l '#include "RelationType.h"'`
```

Differential Revision: https://phabricator.services.mozilla.com/D193001
2023-11-14 02:31:54 +00:00
Morgan Rae Reschenberg 5e8494173a Bug 1858556: Add telemetry for Always Underline Links r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D190861
2023-11-09 18:31:07 +00:00
James Teh acdf382ad2 Bug 1863480: Expose all relations via xpcAccessible::GetRelations. r=morgan,devtools-reviewers,nchevobbe
Previously, only an outdated hard-coded subset was being exposed.
This meant that missing relations such as details and error message were not exposed in the DevTools Accessibility Inspector.
We now expose all relations in the RelationType enum so we don't need to keep this up to date.

Differential Revision: https://phabricator.services.mozilla.com/D193008
2023-11-09 05:19:01 +00:00
James Teh 74e2c544fe Bug 1863466: Support details and error message relations for RemoteAccessible. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D192916
2023-11-08 00:00:40 +00:00
Eitan Isaacson 95dcf00cc5 Bug 1862999 - Introduce support for AXARIAPosInSet and AXARIASetSize. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D192887
2023-11-07 22:24:23 +00:00
Eitan Isaacson b26b8d8eef Bug 1849230 - End ShutdownChildrenInSubtree if accessibility was shut down. r=Jamie
Unbinding an accessible from a document can cause accessibility to shut
down if the accessible is the last remaining one with an xpcom wrapper.

In that case we need to return early from ShutdownChildrenInSubtree.

Differential Revision: https://phabricator.services.mozilla.com/D192382
2023-11-06 23:57:41 +00:00