TextLeafPoint/Range: Implement support for format boundaries
Categories
(Core :: Disability Access APIs, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox96 | --- | fixed |
People
(Reporter: Jamie, Assigned: Jamie)
References
(Blocks 1 open bug)
Details
Attachments
(9 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
Clients need to be able to get a range of text with the same formatting. TextLeafPoint/Range needs to support this. Perhaps we could add a BOUNDARY_FORMAT or similar which is supported by TextLeafPoint::FindBoundary.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
Most formatting spans an entire DOM element, so we can cache it by just caching the formatting attributes on each text leaf. To find the format boundary, we can search the tree looking for changes in the attributes. However, spelling errors (and eventually grammar errors) are more complicated because they can span just part of a text leaf. The same will be true for the upcoming CSS Custom Highlight API.
For spelling errors, I'm thinking it probably makes sense to cache the spelling error selection ranges on the document. We're probably going to have to do similarly for normal text selection. When searching for format boundaries, we'd then tweak the returned range if it overlapped any spelling error range.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
This will be used later to check whether text attributes are different between two Accessibles.
I added this as a method instead of operator== because callers always hold a pointer to AccAttributes, and *a1 == *a2 is weird and will probably lead to mistakes.
This required adding operator== for our value structs.
Updated•3 years ago
|
Assignee | ||
Comment 3•3 years ago
|
||
This supports both fetching text attributes and finding the start of attribute runs, but only for LocalAccessible.
Support for RemoteAccessible will be added in a subsequent patch.
Assignee | ||
Comment 4•3 years ago
|
||
This uses TextLeafPoint.
This patch includes support for ATK, IA2 and XPCOM.
As with TextAtOffset, HyperTextAccessible calls the base implementation if the cache is enabled, but otherwise uses the old implementation for now.
Assignee | ||
Comment 5•3 years ago
|
||
This will be used to include text attributes as part of the cache for an Accessible.
Assignee | ||
Comment 6•3 years ago
|
||
Assignee | ||
Comment 7•3 years ago
|
||
This is necessary for two reasons:
- Leaf text attributes and default text attributes are cached separately, since the caller can choose whether to include defaults or not. This means merging them together.
- Methods for retrieving attributes currently return a non-const AccAttributes. We might be able to change this in future for some of them, but I didn't want to deal with that in this work.
Assignee | ||
Comment 8•3 years ago
|
||
Assignee | ||
Comment 9•3 years ago
|
||
This patch includes ATK and XPCOM support.
Assignee | ||
Comment 10•3 years ago
|
||
Comment 11•3 years ago
|
||
Pushed by jteh@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/809cb98971bc part 1: Add AccAttributes::Equal to compare attributes in two instances. r=eeejay https://hg.mozilla.org/integration/autoland/rev/3d075d392eeb part 2: Implement support for text attributes in TextLeafPoint. r=eeejay https://hg.mozilla.org/integration/autoland/rev/e273963101b6 part 3: Add HyperTextAccessibleBase::TextAttributes. r=eeejay https://hg.mozilla.org/integration/autoland/rev/10a11e1eaf81 part 4: Support AccAttributes as a value inside an AccAttributes. r=eeejay https://hg.mozilla.org/integration/autoland/rev/627e8bd8323d part 5: Push text attributes to the cache. r=eeejay https://hg.mozilla.org/integration/autoland/rev/ba4efa10da03 part 6: Add AccAttributes::CopyTo to copy an AccAttributes. r=eeejay https://hg.mozilla.org/integration/autoland/rev/5ea77a2caedd part 7: Support cached remote text attributes in TextLeafPoint. r=eeejay https://hg.mozilla.org/integration/autoland/rev/b13e575cde62 part 8: Move DefaultTextAttributes to HyperTextAccessibleBase and implement it for RemoteAccessible. r=eeejay https://hg.mozilla.org/integration/autoland/rev/50a53cf974d6 part 9: Add tests for cached text attributes. r=eeejay
Comment 12•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/809cb98971bc
https://hg.mozilla.org/mozilla-central/rev/3d075d392eeb
https://hg.mozilla.org/mozilla-central/rev/e273963101b6
https://hg.mozilla.org/mozilla-central/rev/10a11e1eaf81
https://hg.mozilla.org/mozilla-central/rev/627e8bd8323d
https://hg.mozilla.org/mozilla-central/rev/ba4efa10da03
https://hg.mozilla.org/mozilla-central/rev/5ea77a2caedd
https://hg.mozilla.org/mozilla-central/rev/b13e575cde62
https://hg.mozilla.org/mozilla-central/rev/50a53cf974d6
Description
•