[CTW] Delegate to HyperTextAccessibleBase in HyperTextAccessible::Char/TextBounds
Categories
(Core :: Disability Access APIs, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox113 | --- | fixed |
People
(Reporter: Jamie, Assigned: Jamie)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
In bug 1820029, TextLeafPoint gained its own support for CharBounds on LocalAccessibles. I noted this during review, but forgot about it when accepting the patch:
HyperTextAccessible::CharBounds/TextBounds should probably call the HyperTextAccessibleBase versions if the cache is enabled, just as we do for TextAtOffset, etc. This will allow our existing cross-platform text tests (where we have more coverage) to test that the new implementation is working. It also paves the way for us to rip out the HyperTextAccessible methods once the cache is shipped.
Assignee | ||
Comment 1•2 years ago
|
||
This is consistent with other HyperTextAccessible methods such as TextAtOffset.
It allows us to test the new implementation with LocalAccessible.
This is especially useful because we have better test coverage in our HyperText tests than we do in our TextLeafPoint tests.
In fact, running the tests with this change uncovered some bugs which I had to fix here.
First, TextLeafPoint::ComputeBoundsFromFrame was preferring to stick to the end of the first frame when on a boundary, rather than using the next frame.
For example, if we had the text "a\nb" where "b" is split into a continuation, offset 2 "b" was previously using the primary frame instead of the continuation.
This isn't a problem in HyperTextAccessible::GetBoundsInFrame because it walks to the next continuation if needed, since it is dealing with a range of offsets.
This is fixed by preferring the beginning of the next frame instead.
Second, passing the text length as the offset (i.e. one past the last character) should return a 0 rect.
TextLeafPoint::CharBounds needed to be tweaked accordingly.
Third, if TextLeafPoint returns a 0 rect (e.g. because a RemoteAccessible doesn't have a cache yet), HyperTextAccessibleBase needs to respect that and return it untouched.
Comment 3•2 years ago
|
||
bugherder |
Description
•