The button tweak is needed because now if you have:
<button>
<label value="foo">
</button>
There is a text node for the value (generated content), and the <button>
shouldn't steal it.
I was getting crashes without it because XULButtonAccessible isn't
hypertext (so I wonder if the IsText() code-path can even be reached?).
Same issue with XULComboboxAccessible, fixed the same way by preventing
text there (preserving behavior).
Setting crop="center" now reframes, so test_label needs to change.
Differential Revision: https://phabricator.services.mozilla.com/D162011
This relation isn't part of the ATK and IA2 specs.
In ATK and the older way of retrieving relations in IA2, we have to calculate all relations.
Since LINKS_TO can be slow and it isn't supported by ATK and IA2 anyway, let's just not expose it at all for them.
Differential Revision: https://phabricator.services.mozilla.com/D161775
The code which calculated the focused state in RemoteAccessibleBase was incorrect.
It used the focused BrowserParent rather than the focused BrowsingContext to determine if the document was focused, which meant it treated a top level document as focused even when an embedded in-process iframe had focus.
FocusManager::FocusedAccessible (and now FocusManager::IsFocused) do the right thing, so we can use IsFocused instead.
LocalAccessible already used IsFocused to calculate the focused state.
Since both local and remote both now do the same thing, we can move this into Accessible::ApplyImplicitState.
Differential Revision: https://phabricator.services.mozilla.com/D161876
Previously, IsFocused had a separate implementation instead of just using FocusedAccessible because of cases years ago where it would unintentionally cause us to create a DocAccessible for an initial about:blank document.
As far as I can tell, we no longer prevent creation of DocAccessibles for initial documents because they aren't necessarily temporary documents.
Therefore, we can just compare against FocusedAccessible now.
Since FocusedAccessible is already unified, this makes unifying IsFocused very simple.
This paves the way for unifying correct calculation of the focused state.
Differential Revision: https://phabricator.services.mozilla.com/D161875
See the code comment for further details.
In subsequent patches, IsFocused is refactored to call FocusedAccessible, which asserts that mActiveItem is not defunct.
Without this active item fix, that change would cause accessible/tests/mochitest/actions/test_keys.xhtml to assert.
Differential Revision: https://phabricator.services.mozilla.com/D161887
It already has a mochitest and is probably old enough that we don't need
it. Loading XUL in content with e10s enabled is not something our cache
is prepared for yet.
Differential Revision: https://phabricator.services.mozilla.com/D162057
Otherwise, we crash when inspecting RemoteAccessible objects in Dev Tools if the cache is disabled or hasn't been received yet.
Differential Revision: https://phabricator.services.mozilla.com/D161872
On Android, we access RemoteAccessibles from the UI thread.
It's not safe to access LocalAccessibles on the UI thread.
The a11y code avoids touching LocalAccessibles on the UI thread directly.
However, Accessible::GetLevel was previously walking ancestry, which might hit a LocalAccessible and result in a crash.
To avoid this, don't ascend past a DocAccessible.
Level calculation shouldn't be crossing document boundaries anyway.
Note that we don't have to do this when we simply retrieve the parent (but nothing further) because we only do that for certain roles and the parent of these roles could never be an OuterDoc.
Differential Revision: https://phabricator.services.mozilla.com/D161873
This relation isn't part of the ATK and IA2 specs.
In ATK and the older way of retrieving relations in IA2, we have to calculate all relations.
Since LINKS_TO can be slow and it isn't supported by ATK and IA2 anyway, let's just not expose it at all for them.
Differential Revision: https://phabricator.services.mozilla.com/D161775
This relation isn't part of the ATK and IA2 specs.
In ATK and the older way of retrieving relations in IA2, we have to calculate all relations.
Since LINKS_TO can be slow and it isn't supported by ATK and IA2 anyway, let's just not expose it at all for them.
Differential Revision: https://phabricator.services.mozilla.com/D161775
The primary intent of the first patch here was to avoid memory wasted by caching default opacity values.
Unfortunately, this was defeated by the fact that we previously sent DeleteEntry for initial cache updates of opacity.
This resulted in DeleteEntry being stored in the parent process cache, since DeleteEntry is only handled specially for cache updates, not initial pushes.
We now only send DeleteEntry for cache updates, which is consistent with what we do for other cache attributes.
While fixing this, I discovered that we made the same mistake for table cell headers, so I fixed that as well.
Differential Revision: https://phabricator.services.mozilla.com/D161760
Previously, it was possible to have no value, but only for Accessibles without frames.
That effectively means display: contents, and since the content is visible (even though the element itself doesn't have a box), exposing it as non-opaque isn't important and arguably doesn't make sense.
This way, we avoid awastefully caching 1.0 for the vast majority of Accessibles.
Differential Revision: https://phabricator.services.mozilla.com/D161005
This state is derived based on Accessible::Opacity, which is implemented for both local and remote Accessibles.
Thus, we can use common code to calculate this state.
As part of this, OPAQUE1 was added to kRemoteCalculatedStates so that it isn't included in the initial cache push, which also means we don't have to remove it later.
This patch also tweaks the test to flush layout so that the opacity change takes effect immediately in that process.
This is necessary to avoid a (graceful) timeout in untilCacheOk for non-caching tests, since there is no cache update to make untilCacheOk return before the timeout.
Differential Revision: https://phabricator.services.mozilla.com/D161004
This unifies and moves the existing logic from LocalAccessible::State to Accessible::ApplyImplicitState so it can be used for both local and remote Accessibles.
Differential Revision: https://phabricator.services.mozilla.com/D160884
This gives us a place to put state calculation code common to both local and remote Accessibles.
It will be used to unify the implicit selected state in the next patch, among other things.
Differential Revision: https://phabricator.services.mozilla.com/D160883
The next patch in this stack adds a method to retrieve aria-selected.
The easiest way to do this is using NormalizeARIAToken.
This overload takes an Element and checks both the Element and ElementInternals.
Differential Revision: https://phabricator.services.mozilla.com/D161241
This moves the unified focus logic from DocAccessible::FocusedChild to FocusManager.
This is needed in order to support a unified IsFocusWithin method.
Differential Revision: https://phabricator.services.mozilla.com/D160879
* Make non-menulist popups just absolute positioned top-layer items.
* Simplify menulist popups to just be static-positioned items under
nsMenuFrame.
We need to keep kPopupList only for nsMenuFrame. In the future it can be
removed, see TODO in xul.css
Differential Revision: https://phabricator.services.mozilla.com/D161404
This revision changes the logic for creation and updating of accessibles
corresponding to elements that produce image accessibles, such that alt=""
(without click listeners or any other aria attributes that force an accessible)
will effectively remove that element's accessible from the accessibility tree.
Next, this revision removes the concept of eNoNameOnPurpose from accessible name
handling, since it's now unnecessary now that alt="" means "don't create an
accessible" in most cases. This revision also adds tests to verify the
functionality and updates existing tests.
Differential Revision: https://phabricator.services.mozilla.com/D160706
* Make non-menulist popups just absolute positioned top-layer items.
* Simplify menulist popups to just be static-positioned items under
nsMenuFrame.
We need to keep kPopupList only for nsMenuFrame. In the future it can be
removed, see TODO in xul.css
Differential Revision: https://phabricator.services.mozilla.com/D161404
* Make non-menulist popups just absolute positioned top-layer items.
* Simplify menulist popups to just be static-positioned items under
nsMenuFrame.
We need to keep kPopupList only for nsMenuFrame. In the future it can be
removed, see TODO in xul.css
Differential Revision: https://phabricator.services.mozilla.com/D161404