Skip to content

[cssom-view] Specify document.caretRangeFromPoint? #6459

@saschanaz

Description

@saschanaz
Member

Per MDN it has been supported in Chrome and Safari for many years. While there is an alternative, I guess it should probably be in spec for web compatibility, although I haven't investigated its impact.

Activity

saschanaz

saschanaz commented on Jul 17, 2021

@saschanaz
MemberAuthor

@foolip I see your comment in that mailing list. Per https://www.chromestatus.com/metrics/feature/timeline/popularity/387 the use count is 0.2% which is big enough and I doubt caretPositionFromPoint have lower use count given that it also has been there for years. What do you think, should we specify both?

saschanaz

saschanaz commented on Jul 17, 2021

@saschanaz
MemberAuthor

Oh, just found that caretPositionFromPoint is currently Firefox only, I guess it also needs a use counter then.

saschanaz

saschanaz commented on Jul 17, 2021

@saschanaz
MemberAuthor

The WebKit implementation simply wraps caretPositionFromPoint, which has never been exposed...

foolip

foolip commented on Jul 20, 2021

@foolip
Member

It seems like the current situation is that Chromium and WebKit have caretRangeFromPoint while Gecko has caretPositionFromPoint.

Spec'ing caretRangeFromPoint and caretPositionFromPoint one in terms of the other in a way that would be trivial for all engines to support sounds like the best path forward to me.

There is a risk that these methods are used for UA detection, but other than that I don't see other risks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @foolip@fantasai@saschanaz

      Issue actions

        [cssom-view] Specify `document.caretRangeFromPoint`? · Issue #6459 · w3c/csswg-drafts