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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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