This was causing an assertion when firing caret events where the element containing the caret is aria-hidden, since the offset we produced was effectively bogus for the target Accessible. Doing this is bad authoring, but we need to at least ensure the offset is valid. Arguably, we shouldn't fire caret events at all in this case, but this is a trickier, riskier fix and I don't think it makes sense to spend time on that to compensate for bad authoring. Differential Revision: https://phabricator.services.mozilla.com/D240579