Open Bug 1951813 Opened 11 months ago Updated 11 months ago

Move most of HyperTextAccessible::ScrollSubstringToPoint to TextLeafRange

Categories

(Core :: Disability Access APIs, task)

task

Tracking

()

People

(Reporter: Jamie, Unassigned)

References

(Depends on 1 open bug, Blocks 2 open bugs)

Details

ScrollSubstringToPoint is currently implemented entirely in HyperTextAccessible. Most of this should be moved into TextLeafRange, with HyperTextAccessibleBase::ScrollSubstringToPoint being a wrapper around that. This will also allow us to remove TextRange::AssignDOMRange, HyperTextAccessible::OffsetToDOMPoint and HyperTextAccessible::RenderedToContentOffset, all of which can be done by TextLeafRange now.

One challenge is that we don't currently have tests for ScrollSubstringToPoint and getting those landed is problematic because the function itself isn't accurate. See bug 1610461. Refactoring this without tests in place seems risky.

(In reply to James Teh [:Jamie] from comment #0)

One challenge is that we don't currently have tests for ScrollSubstringToPoint and getting those landed is problematic because the function itself isn't accurate. See bug 1610461.

I don't know how easy it'd be, but maybe one option could be:

  1. add some tests that accept a range of results to account for the current inaccuracy
  2. fix the current inaccuracy, probably following findings from https://bugzilla.mozilla.org/show_bug.cgi?id=1610461#c5 onwards, and possibly using floats as mentioned in https://bugzilla.mozilla.org/show_bug.cgi?id=1610461#c5, and tighten the test requirements according to the now-fixed inaccuracies
  3. happy refactoring

I'm not entirely sure the findings mentioned above will cover everything, but I believe it'll help a lot.

You need to log in before you can comment on or make changes to this bug.