Commit Graph
26 Commits
Author SHA1 Message Date
Sylvestre Ledru eafe8b152d Bug 2023419 - Remove Emacs/Vim modelines from accessible/ r=emilio
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287834
2026-03-18 10:29:47 +00:00
Serban Stanca 5a709d4a9a Revert "Bug 2023419 - Remove Emacs/Vim modelines from accessible/ r=emilio" for causing mochitests failures in browser_action.js.
This reverts commit 2fa4815c8d.
2026-03-17 15:34:26 +00:00
Sylvestre Ledru 2fa4815c8d Bug 2023419 - Remove Emacs/Vim modelines from accessible/ r=emilio
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287834
2026-03-17 09:21:51 +00:00
James Teh 5390862925 Bug 1972539: Fix handling of empty containers in TextRange::Crop. r=morgan
It is possible for a DOM selection to start or end within an empty container.
In this case, we have offset 0 in an empty HyperTextAccessible.
This caused two problems.

First, DocAccessibleParent::SelectionRanges previously treated a range as invalid (and thus skipped it) if the offset was >= the character count in the container.
While this usually makes sense, it is problematic for empty containers.
To fix this, always treat offset 0 as valid.

Second, GetChildAtOffset returns null when called on an empty container with offset 0, since there's no child for it to return.
Previously, TextRange::Crop wasn't handling this, resulting in a crash.
To fix this, just use the start/end container itself if GetChildAtOffset returns null.

Differential Revision: https://phabricator.services.mozilla.com/D254467
2025-06-24 00:11:36 +00:00
James Teh d87b159974 Bug 1825618: CroppedSelectionRanges: Binary search selection ranges instead of cropping every range. r=nlapre
Previously, we called Crop on every range.
Among other things, that has to calculate common parents, which gets very slow with lots of ranges.
Since the selection ranges are sorted by position in the document, we can binary search to find the overlapping ranges instead.

This required a fix to TextPoint::operator<, which previously returned an incorrect result when comparing a descendant point with an ancestor point.

Differential Revision: https://phabricator.services.mozilla.com/D233622
2025-02-06 04:48:22 +00:00
James Teh a385baf40d Bug 1837332: Remove unused HyperTextAccessible::EnclosingRange/VisibleRanges/RangeByChild/RangeAtPoint, TextRange::EmbeddedChildren/Text and xpcAccessibleTextRange::ScrollIntoView. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D180301
2023-06-14 00:43:11 +00:00
Eitan Isaacson 7c8e90480f Bug 1826264 - P2: Add range TextLeafRange::ScrollIntoView. r=Jamie
Use it when caching is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D174977
2023-04-13 20:40:19 +00:00
Eitan Isaacson 8e8b337a1c Bug 1811092 - P1: Add new async add/set text selection message. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D167201
2023-01-27 20:15:11 +00:00
James Teh bd8105fd87 Bug 1756528: Fix cropping of siblings in TextRange::Crop. r=eeejay
There was already a code path to handle siblings, but this only applied if the boundary child at the range's start/end (often a text leaf) was a sibling of aContainer.
It didn't apply if aContainer was a direct sibling of the range's start/end container.
To fix this, don't restrict the code which handles the case where aContainer does not contain the start/end boundary.
This should always fail to crop, regardless of the ancestry.

Differential Revision: https://phabricator.services.mozilla.com/D139351
2022-02-26 23:01:56 +00:00
James Teh c612403115 Bug 1741793 part 2: Update TextPoint/Range to use base Accessible. r=eeejay
Even though we'd ideally be using TextLeafRange for new things, TextRange is still needed by our selection events (which still use HyperText offsets) and IA2/ATK clients which depend on HyperText offsets.
Thus, we need TextRange to support RemoteAccessible.

Although the start and end containers are HyperTextAccessibles, I chose to store Accessible rather than HyperTextAccessibleBase because HyperTextAccessibleBase doesn't inherit from Accessible and having an Accessible is easier.

XPCOM needs to hold a reference to any state objects.
Because we can't hold a reference to an Accessible (due to RemoteAccessible), xpcAccessibleTextRange holds references to xpcAccessibleHyperText instead.

Differential Revision: https://phabricator.services.mozilla.com/D139341
2022-02-26 23:01:54 +00:00
James Teh 1e8578c451 Bug 1741793 part 1: Remove TextRange stuff that was never implemented. r=eeejay
This class needs to be updated to support base Accessible and it doesn't make sense to port methods that can never be used.
Also, any new functionality (e.g. needed for the UIA text pattern) should now be implemented using TextLeafPoint/Range, not TextRange.

Differential Revision: https://phabricator.services.mozilla.com/D139340
2022-02-26 23:01:54 +00:00
Masayuki Nakano daf79ccd1e Bug 1735446 - part 4: Make Selection::GetRangeAt() take uint32_t instead of int32_t r=smaug
It's an internal API corresponding to `Selection.getRangeAt` DOM API.
I think that it should use `uint32_t` rather than `size_t` because of the
consistency with the DOM API and `Selection::RangeCount()`.

This patch fixes all callers of `GetRangeAt()`, and rewrites it with ranged-
loops unless original ones do not refer `RangeCount()` every time and may run
script in the loop.

Differential Revision: https://phabricator.services.mozilla.com/D128848
2021-12-09 07:35:09 +00:00
Eitan Isaacson c1ef28b8c2 Bug 1693597 - P1: Rename Accessible to LocalAccessible. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D105670
2021-02-19 23:14:32 +00:00
Eitan Isaacson dd2f95aa73 Bug 1693607 - [Linux] Add braces around statements. r=morgan
This is a collaboration between clang-tidy and clang-format.

clang-tidy uses compiled code paths, so this patch is linux specific.

Differential Revision: https://phabricator.services.mozilla.com/D105669
2021-02-19 23:14:32 +00:00
Eitan Isaacson 7babc2c4be Bug 1692523 - P1: Prefix local heirarchy functions with 'Local'. r=Jamie
Parent -> LocalParent
GetChildAt -> LocalChildAt
FirstChild -> LocalFirstChild
LastChild -> LocalLastChild
NextSibling -> LocalNextSibling
PrevSibling -> LocalPrevSibling

Differential Revision: https://phabricator.services.mozilla.com/D105034
2021-02-16 20:05:10 +00:00
Eitan Isaacson ef7346cd0a Bug 1661765 - Part 1: Move selection and scroll functions to TextRange. r=Jamie
This gives us the flexibility of selecting and scrolling to any range, not just
offsets in a given container.

Differential Revision: https://phabricator.services.mozilla.com/D90591
2020-09-21 22:52:01 +00:00
Eitan Isaacson c267c661f2 Bug 1657759 - Fix TextPoints lesser-than operator. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D86276
2020-08-11 16:26:04 +00:00
Eitan Isaacson ac190cfcb7 Bug 1647483 - Add a TextRange getter to text selection change events. r=Jamie
This includes 3 changes:
1. Add a lazy ranges getter to AccTextSelChangeEvent.
2. Create an XPCOM interface for testing purposes.
3. Add IPDL bindings for passing ranges in e10s.

Differential Revision: https://phabricator.services.mozilla.com/D80556
2020-06-23 18:52:42 +00:00
Sylvestre Ledru e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Alexander Surkov 586f7a0b1b Bug 1261439 - replace nsAccUtils::IsEmbeddedObject on a bit flag check, r=marcoz 2016-04-08 08:35:11 -04:00
Birunthan Mohanathas bfee0fb40c Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-02-02 17:36:30 +02:00
Phil Ringnalda d871b9515f Back out 7 changesets (bug 1235261) for cpptest failures in TestTArray
CLOSED TREE

Backed out changeset d66c3f19a210 (bug 1235261)
Backed out changeset 467d945426bb (bug 1235261)
Backed out changeset 32b61df13142 (bug 1235261)
Backed out changeset c50bb8ed4196 (bug 1235261)
Backed out changeset 0ff0fa6fe81f (bug 1235261)
Backed out changeset df70e89669da (bug 1235261)
Backed out changeset 064969357fc9 (bug 1235261)
2016-01-31 10:10:57 -08:00
Birunthan Mohanathas 245cd6a02f Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-01-31 17:12:12 +02:00
Alexander Surkov 9365c86781 Bug 1233118 - implement IAccessible2_3::selectionRanges, r=yzen 2016-01-20 12:53:03 -05:00
Tetsuro Kato 791ef27f19 Bug 1045081 - TextRange.cpp failed to compile on VS2013: error C2872. r=surkov 2014-07-28 23:40:27 +09:00
Birunthan Mohanathas e551bc9312 Bug 1028563 - Part 1: Flatten accessible/src/ directory. rs=surkov 2014-06-22 10:15:19 -07:00