Commit Graph
79 Commits
Author SHA1 Message Date
James Teh f2538fb271 Bug 2021491: HTMLLabelIterator::Next: Handle the case that the origin element is labelable and is the root element. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D301043
2026-05-19 00:37:01 +00:00
Eitan Isaacson 8dd5e5d025 Bug 2027291 - Make mParent a strong reference in AccIterable::IteratorState. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D292196
2026-04-10 19:23:23 +00:00
Alice Boxhall a4ba7f0009 Bug 1981349 - Add referenceTarget support for label/for, label wrapped and output/for. r=credential-management-reviewers,webidl,dimi,Jamie,smaug
This makes significant changes to RelatedAccIterator, nsLabelsNodeList and nsContentList:

- RelatedAccIterator is now able to walk up shadow roots where appropriate.
- HTMLLabelsIterator now eagerly constructs a TreeOrderedArray of related elements, walking up shadow roots while the shadow root's reference target is either mAcc's content or a host of one of its ancestor shadow roots.
- nsLabelsNodeList now has an array of roots as well as mRootNode in the superclass nsContentList. This list is reset under certain conditions, adding each shadow root found by walking up from the labeled element until one is found which doesn't have either the labeled element or the host of one of its ancestor shadow roots as a reference target. The last element in this list is set as mRootNode in the superclass, and is either the containing document, or the subtree root of either the labeled element or the host element whose containing shadow root doesn't have it as a reference target. Each root has a mutation observer added to ensure that the list is marked dirty when necessary, and also that roots are removed from `mRoots` when they are destroyed.
- In order to enable nsLabelsNodeList to be a mutation observer for each root, nsContentList now inherits from nsStubMultiMutationObserver instead of nsStubMutationObserver.

This change also moves the ReferenceTargetChangeObserver-related methods from DocumentOrShadowRoot on to Element, and the related data structures on to nsExtendedDOMSlots.

It also introduces a distinction between GetControlForBindings, which returns an element in the same scope as the label element it's called on, and GetLabeledElementInternal, which returns the element which actually has the label element as its label.

Differential Revision: https://phabricator.services.mozilla.com/D261368
2026-01-15 13:40:05 +00:00
Alice Boxhall 4ae82de2a6 Bug 1981345 - Implement referenceTarget support for multiple element attributes. r=dom-core,Jamie,smaug
- Split `GetAttrAssociatedElements()` into `Internals` and `ForBindings` versions; the latter returns the shadow host(s) rather than an element inside shadow DOM
- Use `GetAttrAssociatedElementsInternal()` in `a11y::AssociatedElementsIterator`, removing the need for `AssociatedElementsIterator` to directly parse IDs or distinguish between ID-based or explicitly-set attr-associated elements.
- This required an update to `DocAccessible`'s `AddDependentIDsFor()` method which previously used `AssociatedElementsIterator`'s `NextID()` method, which is removed in this patch. `AddDependentIDsFor()` now uses the parsed attribute directly instead.
- In order to run the WPT tests which test `aria-labelledby` integration with `referenceTarget`, a new mechanism for retrieving elements inside shadow roots is added. This adds a `element_by_selector_array` action, which takes an array of selectors to be used successively from a document root to retrieve a shadow host, and then within the shadow host to retrieve the next shadow host, until the final selector returns the desired element.

Differential Revision: https://phabricator.services.mozilla.com/D261366
2026-01-14 18:03:42 +00:00
Alice Boxhall 9c1a828c7f Bug 1984685 - Refactor: consistently return Maybe<nsTArray<RefPtr<Element>>> when getting attr-associated elements, and key AttrRelProviders on nsAtom rather than nsString. r=dom-core,morgan,Jamie,smaug
The existing `Element::GetAttrAssociatedElements()` and its internal lambda (which the subsequent change promotes into the `GetAttrAssociatedElementsInternal()` method, in order to use it as the internal "source of truth" method) already used arrays of `RefPtrs`, since the former interacts with scripting. In the subsequent change, since the `GetAttrAssociatedElementsInternal()` method which I adapted from the original lambda is used both by the bindings-exposed `GetAttrAssociatedElementsForBindings()` and in `AssociatedElementsIterator()`, I thought it was more straightforward to adapt `AssociatedElementsIterator` to use the array of `RefPtrs` rather than unpack the raw pointers each time, but I'm happy to modify it if this will be too slow or memory-intensive.

Differential Revision: https://phabricator.services.mozilla.com/D262170
2026-01-14 18:03:38 +00:00
Sandor Molnar 8faede9a1f Revert "Bug 1981349 - Add referenceTarget support for label/for, label wrapped and output/for. r=credential-management-reviewers,webidl,dimi,Jamie,smaug" for causing accessibility crashes (bug 2008970)
This reverts commit d46abe6d76.

Revert "Bug 1981346 - Add referenceTarget support for the form attribute. r=credential-management-reviewers,webidl,dimi,Jamie,smaug"

This reverts commit df11a4666d.

Revert "Bug 1981345 - Implement referenceTarget support for multiple element attributes. r=dom-core,Jamie,smaug"

This reverts commit 89cc779f5e.

Revert "Bug 1984685 - Refactor: consistently return Maybe<nsTArray<RefPtr<Element>>> when getting attr-associated elements, and key AttrRelProviders on nsAtom rather than nsString. r=dom-core,morgan,Jamie,smaug"

This reverts commit 33130e712d.

Revert "Bug 1981344 - Implement referenceTarget support for single-element attributes. r=dom-core,credential-management-reviewers,webidl,layout-reviewers,emilio,keithamus,smaug,mtigley"

This reverts commit d6440c4cae.

Revert "Bug 1983766 - Split single element attribute getters into bindings/internals versions. r=dom-core,credential-management-reviewers,webidl,layout-reviewers,smaug,keithamus,jwatt,mtigley"

This reverts commit 83b70e0645.

Revert "Bug 1989323 - Make `referenceTarget` IDL attributes on ShadowRoot, HTMLTemplateElement and ShadowRootInit nullable. r=dom-core,webidl,saschanaz,smaug"

This reverts commit 3a0b29121e.
2026-01-07 16:08:51 +00:00
Alice Boxhall d46abe6d76 Bug 1981349 - Add referenceTarget support for label/for, label wrapped and output/for. r=credential-management-reviewers,webidl,dimi,Jamie,smaug
This makes significant changes to RelatedAccIterator, nsLabelsNodeList and nsContentList:

- RelatedAccIterator now eagerly constructs a TreeOrderedArray of related elements, walking up shadow roots from mDependentContent while the shadow root's reference target is either mDependentContent or a host of one of its ancestor shadow roots.
- nsLabelsNodeList now has an array of roots as well as mRootNode in the superclass nsContentList. This list is reset under certain conditions, adding each shadow root found by walking up from the labeled element until one is found which doesn't have either the labeled element or the host of one of its ancestor shadow roots as a reference target. The last element in this list is set as mRootNode in the superclass, and is either the containing document, or the subtree root of either the labeled element or the host element whose containing shadow root doesn't have it as a reference target. Each root has a mutation observer added to ensure that the list is marked dirty when necessary, and also that roots are removed from `mRoots` when they are destroyed.
- In order to enable nsLabelsNodeList to be a mutation observer for each root, nsContentList now inherits from nsStubMultiMutationObserver instead of nsStubMutationObserver.

This change also moves the ReferenceTargetChangeObserver-related methods from DocumentOrShadowRoot on to Element, and the related data structures on to nsExtendedDOMSlots.

It also introduces a distinction between GetControlForBindings, which returns an element in the same scope as the label element it's called on, and GetLabeledElementInternal, which returns the element which actually has the label element as its label.

Differential Revision: https://phabricator.services.mozilla.com/D261368
2026-01-06 16:16:29 +00:00
Alice Boxhall 89cc779f5e Bug 1981345 - Implement referenceTarget support for multiple element attributes. r=dom-core,Jamie,smaug
- Split `GetAttrAssociatedElements()` into `Internals` and `ForBindings` versions; the latter returns the shadow host(s) rather than an element inside shadow DOM
- Use `GetAttrAssociatedElementsInternal()` in `a11y::AssociatedElementsIterator`, removing the need for `AssociatedElementsIterator` to directly parse IDs or distinguish between ID-based or explicitly-set attr-associated elements.
- This required an update to `DocAccessible`'s `AddDependentIDsFor()` method which previously used `AssociatedElementsIterator`'s `NextID()` method, which is removed in this patch. `AddDependentIDsFor()` now uses the parsed attribute directly instead.
- In order to run the WPT tests which test `aria-labelledby` integration with `referenceTarget`, a new mechanism for retrieving elements inside shadow roots is added. This adds a `element_by_selector_array` action, which takes an array of selectors to be used successively from a document root to retrieve a shadow host, and then within the shadow host to retrieve the next shadow host, until the final selector returns the desired element.

Differential Revision: https://phabricator.services.mozilla.com/D261366
2026-01-06 16:16:22 +00:00
Alice Boxhall 33130e712d Bug 1984685 - Refactor: consistently return Maybe<nsTArray<RefPtr<Element>>> when getting attr-associated elements, and key AttrRelProviders on nsAtom rather than nsString. r=dom-core,morgan,Jamie,smaug
The existing `Element::GetAttrAssociatedElements()` and its internal lambda (which the subsequent change promotes into the `GetAttrAssociatedElementsInternal()` method, in order to use it as the internal "source of truth" method) already used arrays of `RefPtrs`, since the former interacts with scripting. In the subsequent change, since the `GetAttrAssociatedElementsInternal()` method which I adapted from the original lambda is used both by the bindings-exposed `GetAttrAssociatedElementsForBindings()` and in `AssociatedElementsIterator()`, I thought it was more straightforward to adapt `AssociatedElementsIterator` to use the array of `RefPtrs` rather than unpack the raw pointers each time, but I'm happy to modify it if this will be too slow or memory-intensive.

Differential Revision: https://phabricator.services.mozilla.com/D262170
2026-01-06 16:16:19 +00:00
iulian moraru e162366a25 Revert "Bug 1981349, Bug 1981346, Bug 1981345, Bug 1984685, Bug 1981344, Bug 1983766, Bug 1989323 - Add referenceTarget support for label/for, label wrapped and output/for. r=credential-management-reviewers,webidl,dimi,Jamie,smaug" for causing android build bustages.
This reverts commit 1b5cf4cdf8.

Revert "Bug 1981346 - Add referenceTarget support for the form attribute. r=credential-management-reviewers,webidl,dimi,Jamie,smaug"

This reverts commit 2394d9205a.

Revert "Bug 1981345 - Implement referenceTarget support for multiple element attributes. r=dom-core,Jamie,smaug"

This reverts commit 571a17ff82.

Revert "Bug 1984685 - Refactor: consistently return Maybe<nsTArray<RefPtr<Element>>> when getting attr-associated elements, and key AttrRelProviders on nsAtom rather than nsString. r=dom-core,morgan,Jamie,smaug"

This reverts commit 3b389fdd62.

Revert "Bug 1981344 - Implement referenceTarget support for single-element attributes. r=dom-core,credential-management-reviewers,webidl,layout-reviewers,emilio,keithamus,smaug,mtigley"

This reverts commit 5cc2a12756.

Revert "Bug 1983766 - Split single element attribute getters into bindings/internals versions. r=dom-core,credential-management-reviewers,webidl,layout-reviewers,smaug,keithamus,jwatt,mtigley"

This reverts commit 68e2d26aa9.

Revert "Bug 1989323 - Make `referenceTarget` IDL attributes on ShadowRoot, HTMLTemplateElement and ShadowRootInit nullable. r=dom-core,webidl,saschanaz,smaug"

This reverts commit 1234b31599.
2025-12-24 15:16:52 +00:00
Alice Boxhall 1b5cf4cdf8 Bug 1981349 - Add referenceTarget support for label/for, label wrapped and output/for. r=credential-management-reviewers,webidl,dimi,Jamie,smaug
This makes significant changes to RelatedAccIterator, nsLabelsNodeList and nsContentList:

- RelatedAccIterator now eagerly constructs a TreeOrderedArray of related elements, walking up shadow roots from mDependentContent while the shadow root's reference target is either mDependentContent or a host of one of its ancestor shadow roots.
- nsLabelsNodeList now has an array of roots as well as mRootNode in the superclass nsContentList. This list is reset under certain conditions, adding each shadow root found by walking up from the labeled element until one is found which doesn't have either the labeled element or the host of one of its ancestor shadow roots as a reference target. The last element in this list is set as mRootNode in the superclass, and is either the containing document, or the subtree root of either the labeled element or the host element whose containing shadow root doesn't have it as a reference target. Each root has a mutation observer added to ensure that the list is marked dirty when necessary, and also that roots are removed from `mRoots` when they are destroyed.
- In order to enable nsLabelsNodeList to be a mutation observer for each root, nsContentList now inherits from nsStubMultiMutationObserver instead of nsStubMutationObserver.

This change also moves the ReferenceTargetChangeObserver-related methods from DocumentOrShadowRoot on to Element, and the related data structures on to nsExtendedDOMSlots.

It also introduces a distinction between GetControlForBindings, which returns an element in the same scope as the label element it's called on, and GetLabeledElementInternal, which returns the element which actually has the label element as its label.

Differential Revision: https://phabricator.services.mozilla.com/D261368
2025-12-24 13:41:57 +00:00
Alice Boxhall 571a17ff82 Bug 1981345 - Implement referenceTarget support for multiple element attributes. r=dom-core,Jamie,smaug
- Split `GetAttrAssociatedElements()` into `Internals` and `ForBindings` versions; the latter returns the shadow host(s) rather than an element inside shadow DOM
- Use `GetAttrAssociatedElementsInternal()` in `a11y::AssociatedElementsIterator`, removing the need for `AssociatedElementsIterator` to directly parse IDs or distinguish between ID-based or explicitly-set attr-associated elements.
- This required an update to `DocAccessible`'s `AddDependentIDsFor()` method which previously used `AssociatedElementsIterator`'s `NextID()` method, which is removed in this patch. `AddDependentIDsFor()` now uses the parsed attribute directly instead.
- In order to run the WPT tests which test `aria-labelledby` integration with `referenceTarget`, a new mechanism for retrieving elements inside shadow roots is added. This adds a `element_by_selector_array` action, which takes an array of selectors to be used successively from a document root to retrieve a shadow host, and then within the shadow host to retrieve the next shadow host, until the final selector returns the desired element.

Differential Revision: https://phabricator.services.mozilla.com/D261366
2025-12-24 13:41:51 +00:00
Alice Boxhall 3b389fdd62 Bug 1984685 - Refactor: consistently return Maybe<nsTArray<RefPtr<Element>>> when getting attr-associated elements, and key AttrRelProviders on nsAtom rather than nsString. r=dom-core,morgan,Jamie,smaug
The existing `Element::GetAttrAssociatedElements()` and its internal lambda (which the subsequent change promotes into the `GetAttrAssociatedElementsInternal()` method, in order to use it as the internal "source of truth" method) already used arrays of `RefPtrs`, since the former interacts with scripting. In the subsequent change, since the `GetAttrAssociatedElementsInternal()` method which I adapted from the original lambda is used both by the bindings-exposed `GetAttrAssociatedElementsForBindings()` and in `AssociatedElementsIterator()`, I thought it was more straightforward to adapt `AssociatedElementsIterator` to use the array of `RefPtrs` rather than unpack the raw pointers each time, but I'm happy to modify it if this will be too slow or memory-intensive.

Differential Revision: https://phabricator.services.mozilla.com/D262170
2025-12-24 13:41:48 +00:00
Eitan Isaacson 6448a82fff Bug 1998255 - P1: Intro and use ArrayAccIterator. r=morgan
This cleans things up a bit and allows us to use the iterator after ID
lookup.

Depends on D271313

Differential Revision: https://phabricator.services.mozilla.com/D272725
2025-11-21 19:10:12 +00:00
Cristina Horotan 5e77cab491 Revert "Bug 1998242, 1998255: apply code formatting via Lando" for causing wpt failures on /comp_tooltip.html DONTBUILD
This reverts commit 7b7f37ff69.

Revert "Bug 1998255 - P4: Calculate labeled names remotely. r=morgan"

This reverts commit 7265cce8b1.

Revert "Bug 1998255 - P3: Return eNameFromRelations when name was exclusively calculated from relations. r=morgan"

This reverts commit dbe3c2b954.

Revert "Bug 1998255 - P2: Have GetTextEquivFromIDRefs return true if it used hidden content or referenced itself. r=morgan"

This reverts commit f30cc8c2c8.

Revert "Bug 1998255 - P1: Intro and use ArrayAccIterator. r=morgan"

This reverts commit 312430263f.

Revert "Bug 1998242 - P5: Perform subtree name calculation in RemoteAccessible::Name. r=morgan"

This reverts commit 4deac16ef9.

Revert "Bug 1998242 - P4: Break up name calculation to allow remote subtree calc. r=morgan"

This reverts commit ab72073e90.

Revert "Bug 1998242 - P3: Introduce DirectName() to be used by Name(). r=morgan"

This reverts commit 6f8ce31065.

Revert "Bug 1998242 - P2: Don't rely on NativeName override to suppress subtree name calc. r=morgan"

This reverts commit 1fbfdefcef.

Revert "Bug 1998242 - P1: Factor out tooltip calculation. r=morgan"

This reverts commit 695b65952f.
2025-11-21 11:15:27 +00:00
Eitan Isaacson 312430263f Bug 1998255 - P1: Intro and use ArrayAccIterator. r=morgan
This cleans things up a bit and allows us to use the iterator after ID
lookup.

Depends on D271313

Differential Revision: https://phabricator.services.mozilla.com/D272725
2025-11-21 06:40:32 +00:00
iulian moraru f06208ee3f Revert "Bug 1998242, Bug 1998255 1998255: apply code formatting via Lando" for causing dt failures on browser_accessibility_print_to_json.js.
This reverts commit d42283eaec.

Revert "Bug 1998255 - P4: Calculate labeled names remotely. r=morgan"

This reverts commit 4684fdbfa0.

Revert "Bug 1998255 - P3: Return eNameFromRelations when name was exclusively calculated from relations. r=morgan"

This reverts commit 15919fad2f.

Revert "Bug 1998255 - P2: Have GetTextEquivFromIDRefs return true if it used hidden content or referenced itself. r=morgan"

This reverts commit 2b6d3df0da.

Revert "Bug 1998255 - P1: Intro and use ArrayAccIterator. r=morgan"

This reverts commit c6454665b0.

Revert "Bug 1998242 - P5: Perform subtree name calculation in RemoteAccessible::Name. r=morgan"

This reverts commit 0629edfc29.

Revert "Bug 1998242 - P4: Break up name calculation to allow remote subtree calc. r=morgan"

This reverts commit 24e6864b25.

Revert "Bug 1998242 - P3: Introduce DirectName() to be used by Name(). r=morgan"

This reverts commit 63a23a03e0.

Revert "Bug 1998242 - P2: Don't rely on NativeName override to suppress subtree name calc. r=morgan"

This reverts commit 95638bb76c.

Revert "Bug 1998242 - P1: Factor out tooltip calculation. r=morgan"

This reverts commit 25a9efa9b2.
2025-11-21 01:23:56 +00:00
Eitan Isaacson c6454665b0 Bug 1998255 - P1: Intro and use ArrayAccIterator. r=morgan
This cleans things up a bit and allows us to use the iterator after ID
lookup.

Depends on D271313

Differential Revision: https://phabricator.services.mozilla.com/D272725
2025-11-20 20:07:50 +00:00
Atila Butkovits 3f6df22bce Revert "Bug 1998242, Bug 1998255: apply code formatting via Lando" for causing failures at browser_selectables.js.
This reverts commit d0c68a8888.

Revert "Bug 1998255 - P4: Calculate labeled names remotely. r=morgan"

This reverts commit 3bfddbb990.

Revert "Bug 1998255 - P3: Return eNameFromRelations when name was exclusively calculated from relations. r=morgan"

This reverts commit a66669765f.

Revert "Bug 1998255 - P2: Have GetTextEquivFromIDRefs return true if it used hidden content or referenced itself. r=morgan"

This reverts commit 99158f058d.

Revert "Bug 1998255 - P1: Intro and use ArrayAccIterator. r=morgan"

This reverts commit 5d3dbed390.

Revert "Bug 1998242 - P5: Perform subtree name calculation in RemoteAccessible::Name. r=morgan"

This reverts commit 68053ff36f.

Revert "Bug 1998242 - P4: Break up name calculation to allow remote subtree calc. r=morgan"

This reverts commit 0d01bdd7e0.

Revert "Bug 1998242 - P3: Introduce DirectName() to be used by Name(). r=morgan"

This reverts commit 9ee273d6c6.

Revert "Bug 1998242 - P2: Don't rely on NativeName override to suppress subtree name calc. r=morgan"

This reverts commit 55dc166a46.

Revert "Bug 1998242 - P1: Factor out tooltip calculation. r=morgan"

This reverts commit 602b768450.
2025-11-20 06:39:20 +00:00
Eitan Isaacson 5d3dbed390 Bug 1998255 - P1: Intro and use ArrayAccIterator. r=morgan
This cleans things up a bit and allows us to use the iterator after ID
lookup.

Depends on D271313

Differential Revision: https://phabricator.services.mozilla.com/D272725
2025-11-20 03:55:46 +00:00
Alexandru Marc 284c082177 Revert (Bug 1998242, Bug 1998255) for causing build bustages @ nsTextEquivUtils.cpp
This reverts commit 7c76213cf0.

Revert "Bug 1998255 - P4: Calculate labeled names remotely. r=morgan"

This reverts commit ebe32a1bcc.

Revert "Bug 1998255 - P3: Return eNameFromRelations when name was exclusively calculated from relations. r=morgan"

This reverts commit f4a05b1359.

Revert "Bug 1998255 - P2: Have GetTextEquivFromIDRefs return true if it used hidden content or referenced itself. r=morgan"

This reverts commit bbd365ae27.

Revert "Bug 1998255 - P1: Intro and use ArrayAccIterator. r=morgan"

This reverts commit 4cf9fc73f1.

Revert "Bug 1998242 - P5: Perform subtree name calculation in RemoteAccessible::Name. r=morgan"

This reverts commit 5a3dff09a7.

Revert "Bug 1998242 - P4: Break up name calculation to allow remote subtree calc. r=morgan"

This reverts commit 69925bd2e6.

Revert "Bug 1998242 - P3: Introduce DirectName() to be used by Name(). r=morgan"

This reverts commit a0cf5d9cd6.

Revert "Bug 1998242 - P2: Don't rely on NativeName override to suppress subtree name calc. r=morgan"

This reverts commit a4155e38e4.

Revert "Bug 1998242 - P1: Factor out tooltip calculation. r=morgan"

This reverts commit 8c278d8b8f.
2025-11-20 00:22:53 +00:00
Eitan Isaacson 4cf9fc73f1 Bug 1998255 - P1: Intro and use ArrayAccIterator. r=morgan
This cleans things up a bit and allows us to use the iterator after ID
lookup.

Depends on D271313

Differential Revision: https://phabricator.services.mozilla.com/D272725
2025-11-19 23:47:46 +00:00
Eitan Isaacson a23db6bc64 Bug 1280188 - Don't relocate children in or out of editable content. r=nlapre
Depends on D234768

Differential Revision: https://phabricator.services.mozilla.com/D234769
2025-01-23 16:36:57 +00:00
Eitan Isaacson 97afec1c14 Bug 1769586 - P3: Rename IDRefsIterator AssociatedElementsIterator. r=Jamie
The iterator uses both explicitly set element attributes and content attributes
with IDs to iterate over all associated elements

Differential Revision: https://phabricator.services.mozilla.com/D215688
2024-11-29 03:26:35 +00:00
Eitan Isaacson 22d305c374 Bug 1769586 - P2: Implement a11y support of ARIA element reflection. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D209768
2024-11-29 03:26:35 +00:00
Alexandru Marc c71ae69095 Backed out 4 changesets (bug 1769586) for causing wpt failures @ property-reflection.html. CLOSED TREE
Backed out changeset dc6aa76ec6c5 (bug 1769586)
Backed out changeset d9ff02e6c435 (bug 1769586)
Backed out changeset 446faf4cccab (bug 1769586)
Backed out changeset 49f68df69db0 (bug 1769586)
2024-11-21 10:50:49 +02:00
Eitan Isaacson 130e5ed0cf Bug 1769586 - P3: Rename IDRefsIterator AssociatedElementsIterator. r=Jamie
The iterator uses both explicitly set element attributes and content attributes
with IDs to iterate over all associated elements

Differential Revision: https://phabricator.services.mozilla.com/D215688
2024-11-21 04:39:14 +00:00
Eitan Isaacson 4191ad46a5 Bug 1769586 - P2: Implement a11y support of ARIA element reflection. r=Jamie
Depends on D209767

Differential Revision: https://phabricator.services.mozilla.com/D209768
2024-11-21 04:39:13 +00:00
Alexandru Marc 634f6d5c47 Backed out 4 changesets (bug 1769586) for causing multiple failures.
Backed out changeset 1125ec697fdd (bug 1769586)
Backed out changeset ced88b84eef3 (bug 1769586)
Backed out changeset 486c9854c11d (bug 1769586)
Backed out changeset f543f54d90a0 (bug 1769586)
2024-11-19 19:10:30 +02:00
Eitan Isaacson 4b4d801550 Bug 1769586 - P3: Rename IDRefsIterator AssociatedElementsIterator. r=Jamie
The iterator uses both explicitly set element attributes and content attributes
with IDs to iterate over all associated elements

Differential Revision: https://phabricator.services.mozilla.com/D215688
2024-11-19 15:02:18 +00:00
Eitan Isaacson 98723b9747 Bug 1769586 - P2: Implement a11y support of ARIA element reflection. r=Jamie
Depends on D209767

Differential Revision: https://phabricator.services.mozilla.com/D209768
2024-11-19 15:02:18 +00:00
Ryan VanderMeulen 5b997974cd Backed out 3 changesets (bug 1769586) for causing Bug 1920082.
Backed out changeset d684010261d6 (bug 1769586)
Backed out changeset b3264bc533e2 (bug 1769586)
Backed out changeset 049fd286ce0f (bug 1769586)
2024-10-17 16:44:16 -04:00
Eitan Isaacson 082fbf190b Bug 1769586 - P3: Rename IDRefsIterator AssociatedElementsIterator. r=Jamie
The iterator uses both explicitly set element attributes and content attributes
with IDs to iterate over all associated elements

Differential Revision: https://phabricator.services.mozilla.com/D215688
2024-09-15 22:39:53 +00:00
Eitan Isaacson 8140cbd684 Bug 1769586 - P2: Implement a11y support of ARIA element reflection. r=Jamie
Depends on D209767

Differential Revision: https://phabricator.services.mozilla.com/D209768
2024-09-15 22:39:53 +00:00
James Teh e18041114c Bug 1879255 part 2: Add a dependent elements map to DocAccessible and use it for popoverTargetElement. r=morgan
As well as getting an invoker's popover target, we need to be able to do the reverse: get a popover's invokers.
We can already do this when the popovertarget content attribute is set to a string id using the dependent ids map.
However, the popover target can also be explicitly set to a DOM element using the .popoverTargetElement WebIDL attribute.
For this, we need a new map which maps from target elements instead of target ids.
RelatedAccIterator has also been updated to use this map.
DocAccessible::QueueCacheUpdateForDependentRelations had to be updated as well.
Rather than duplicating logic, RelatedAccIterator has been taught how to optionally return all relations and QueueCacheUpdateForDependentRelations now uses RelatedAccIterator.

Differential Revision: https://phabricator.services.mozilla.com/D201661
2024-02-21 00:05:21 +00:00
Chris Peterson dd63528d66 Bug 1845226 - Fix non-unified macOS build due to link error about missing IsDefunct() function definition. r=eeejay
Some member functions are defined in LocalAssessible-inl.h as inline functions, but where declared in LocalAccessible.h without inline specifiers. When compiling files, such as AccIterator.cpp, that include the LocalAccessible.h declarations but not the LocalAccessible-inl.h definitions, the compiler doesn't know that those member functions are not defined out-of-line. The linker expects to find those out-of-line definitions, but can't because they are defined inline.

Solution:

1. Include LocalAccessible-inl.h where needed.
2. Mark LocalAccessible.h's member function declarations as inline if they are defined inline in LocalAccessible-inl.h. This allows the compiler to warn when a file fails to include the LocalAccessible-inl.h definitions. Example warning:

obj-aarch64-apple-darwin22.5.0/dist/include/mozilla/a11y/LocalAccessible.h:174:30: error: inline function 'mozilla::a11y::LocalAccessible::ARIARole' is not defined [-Werror,-Wundefined-inline]
  inline mozilla::a11y::role ARIARole();
                             ^
accessible/generic/DocAccessible-inl.h:127:32: note: used here
    roles::Role role = aChild->ARIARole();

instead of linker errors (in non-unified builds) like:

ld64.lld: error: undefined symbol: mozilla::a11y::LocalAccessible::IsDefunct() const
>>> referenced by AccIterator.cpp:288 (/Users/chris/Code/mozilla/firefox/accessible/base/AccIterator.cpp:288)
>>>               ../../../accessible/base/AccIterator.o:(symbol mozilla::a11y::SingleAccIterator::Next()+0x48)

Differential Revision: https://phabricator.services.mozilla.com/D184603
2023-07-27 15:02:25 +00:00
Nathan LaPre 22e4c96a2b Bug 1840732 Part 1: Remove unnecessary includes from accessible/base, r=Jamie
This revision removes unnecessary include directives from cpp files in the
accessible/base directory. These suggestions came from the Include What You Use
tool.

Differential Revision: https://phabricator.services.mozilla.com/D182288
2023-07-07 03:22:07 +00:00
Emilio Cobos Álvarez 529c9ee321 Bug 1839922 - Remove usage of {Has,Get}Attr(kNameSpaceID_None, ..). r=edgar
We have more readable and faster versions (that just omit the namespace
arg).

Mostly done via sed, with a couple helpers to use the faster lookups
where possible.

Differential Revision: https://phabricator.services.mozilla.com/D181795
2023-06-23 10:01:32 +00:00
James Teh 16aa5c42a9 Bug 1833313: Remove all remaining a11y cache checks and non-caching code except for Mac specific bits. r=morgan,geckoview-reviewers,calu
Differential Revision: https://phabricator.services.mozilla.com/D178146
2023-05-28 23:42:12 +00:00
Sandor Molnar d1c4b13412 Backed out changeset dbb7e27f8464 (bug 1833313) for causing android gv-junit crashes. CLOSED TREE 2023-05-24 14:08:03 +03:00
James Teh de23c323b0 Bug 1833313: Remove all remaining a11y cache checks and non-caching code except for Mac specific bits. r=morgan,geckoview-reviewers,calu
Differential Revision: https://phabricator.services.mozilla.com/D178146
2023-05-24 10:10:46 +00:00
James Teh ddfdb64368 Bug 1821955 part 5: Change all CtW pref checks to use a11y::IsCacheActive. r=eeejay,taskgraph-reviewers,bhearsum
This was done using the following script:

```
matchingFiles=`git grep -l accessibility_cache_enabled`
sed -i 's/StaticPrefs::accessibility_cache_enabled_AtStartup/a11y::IsCacheActive/' $matchingFiles
for f in $matchingFiles; do
  usesA11yPref=
  grep -q StaticPrefs::accessibility_ $f && usesA11yPref=1
  hasA11yInclude=
  grep -q 'nsAccessibilityService.h' $f && hasA11yInclude=1
  if [ -z $usesA11yPref ] && [ -z $hasA11yInclude ]; then
    sed -i 's,mozilla/StaticPrefs_accessibility.h,nsAccessibilityService.h,' $f
  elif [ -z $usesA11yPref ] && [ $hasA11yInclude ]; then
    sed -i '/"mozilla.StaticPrefs_accessibility.h"/d' $f
  elif [ $usesA11yPref ] && [ -z $hasA11yInclude ]; then
    sed -i '/"mozilla.StaticPrefs_accessibility.h"/a#include "nsAccessibilityService.h"' $f
  fi
done
```

Differential Revision: https://phabricator.services.mozilla.com/D177722
2023-05-19 02:56:48 +00:00
Adam Vandolder 88882be017 Bug 1665151 - Part 2: Expose custom element default accessibility attributes. r=edgar,Jamie,credential-management-reviewers,sgalich
Differential Revision: https://phabricator.services.mozilla.com/D159237
2022-11-02 14:50:56 +00:00
Nathan LaPre 1d63f0cbd7 Bug 1787283: Provide NODE_CHILD_OF, NODE_PARENT_OF relations in remote acc, r=morgan,Jamie
We'd like to provide NODE_CHILD_OF and NODE_PARENT_OF relations in the parent
process, relying on cached information, to avoid sync IPDL messages. This
revision implements most of the use cases for this relation for remote
accessibles, notably setting aside handling of MathML's <mroot> parent/child
relation. ARIA trees, treegrids, lists, and so on are handled in the remote
accessible largely identically to how they were handled in LocalAccessible.
Rather than define a new rule for walking the tree to find children, this
revision unifies the ItemIterator so it works on generic Accessibles, and uses
it in RemoteAccessibleBase the same way it's used in LocalAccessible. The
special case carve-out for MSAA clients now exists as a simpler IsTopLevel
check in DocAccessibleParent.

Differential Revision: https://phabricator.services.mozilla.com/D159452
2022-10-18 16:40:32 +00:00
Morgan Rae Reschenberg 09503a27cb Bug 1782172: [Part 1] Support creating a Relation with a RemoteAccessible r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D153795
2022-08-15 20:43:54 +00:00
James Teh c4d0a3cc64 Bug 1781536 part 2: Introduce RemoteAccIterator. r=morgan
This is basically RemoteExplicitHeadersIterator with naming generalised.
Support has been added for transferring ownership of the array into the iterator, which will be needed when the cache is disabled.

Differential Revision: https://phabricator.services.mozilla.com/D152958
2022-08-03 23:58:51 +00:00
Eitan Isaacson ed1144de75 Bug 1737944 - P9: Make AccGroupInfo use Accessible. r=Jamie
Now that GroupPosition and GetGroupInfo are in Accessible, we can make
AccGroupInfo use the Accessible base class.

With one exception: Tables are still local only. That should be
addressed in bug 1735970.

Differential Revision: https://phabricator.services.mozilla.com/D134212
2022-01-04 21:01:38 +00:00
Mike Hommey b9b2736d16 Bug 1744877 - Remove --disable-xul. r=Gijs
Building with --disable-xul has been busted since _at least_ bug
1082579, for more than 7 years (I didn't try to track that down
further). It's time to recognize that the option serves no purpose.

Differential Revision: https://phabricator.services.mozilla.com/D133161
2021-12-08 21:37:11 +00:00
Andi-Bogdan Postelnicu 926f898b02 Bug 1725145 - fixes for linking in the hybrid build env. r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D122344
2021-08-22 10:21:56 +00:00
Eitan Isaacson c1ef28b8c2 Bug 1693597 - P1: Rename Accessible to LocalAccessible. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D105670
2021-02-19 23:14:32 +00:00