gecko-dev/accessible
James Teh cc18ee7d76 Bug 1764500: Fire correct state change events when designMode is changed on a document. r=eeejay
Previously, we used the obs_documentCreated observer message fired by editor.
However, this is fired when an editor is created anywhere in the document, even if it's for a descendant.
This meant that we were firing an editable state change on the document when a descendant became contentEditable.
In turn, this resulted in the document always having the editable state in the cache if there was a contentEditable descendant.

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

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

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

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

Differential Revision: https://phabricator.services.mozilla.com/D143969
2022-04-22 00:02:29 +00:00
..
android Bug 1713050 - P3: Add more granularities to AXSelectedTextChanged events. r=morgan 2022-03-16 05:56:26 +00:00
aom
atk Bug 1743966: Move ScrollTo into Accessible and support it for Windows RemoteAccessibles. r=morgan 2022-04-18 21:55:39 +00:00
base Backed out changeset b424302d8ba0 (bug 1763191) for causing Bp-hybrid bustages on nsAccUtils. CLOSED TREE 2022-04-18 20:47:55 +03:00
basetypes Bug 1743966: Move ScrollTo into Accessible and support it for Windows RemoteAccessibles. r=morgan 2022-04-18 21:55:39 +00:00
docs Bug 1757257: Don't assert for a null frame in TextAttrsMgr::GetAttributes. r=morgan 2022-03-01 21:16:43 +00:00
generic Bug 1764500: Fire correct state change events when designMode is changed on a document. r=eeejay 2022-04-22 00:02:29 +00:00
html Bug 1735970 part 10: Cache whether a table is probably a layout table. r=morgan 2022-04-01 09:49:59 +00:00
interfaces Bug 1713050 - P2: Add granularity to a11y caret move events. r=morgan 2022-03-16 05:56:25 +00:00
ipc Bug 1743966: Move ScrollTo into Accessible and support it for Windows RemoteAccessibles. r=morgan 2022-04-18 21:55:39 +00:00
mac Bug 1765000: Ignore missing view when running in headless mode r=eeejay 2022-04-20 22:16:07 +00:00
other Bug 1713050 - P3: Add more granularities to AXSelectedTextChanged events. r=morgan 2022-03-16 05:56:26 +00:00
tests Bug 1764500: Fire correct state change events when designMode is changed on a document. r=eeejay 2022-04-22 00:02:29 +00:00
windows Bug 1743966: Move ScrollTo into Accessible and support it for Windows RemoteAccessibles. r=morgan 2022-04-18 21:55:39 +00:00
xpcom Bug 1743966: Move ScrollTo into Accessible and support it for Windows RemoteAccessibles. r=morgan 2022-04-18 21:55:39 +00:00
xul Bug 1735970 part 3: Add TableAccessibleBase and TableCellAccessibleBase. r=morgan 2022-04-01 09:49:57 +00:00
moz.build Bug 1755383 - P3: Migrate HTML selection tests from mochitests to browser tests. r=morgan 2022-02-16 18:42:54 +00:00