Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Range.fromPoint is not supported in all browsers #11723

Open
DartBot opened this issue Jul 8, 2013 · 9 comments
Open

Range.fromPoint is not supported in all browsers #11723

DartBot opened this issue Jul 8, 2013 · 9 comments
Assignees
Labels
area-library area-web Issues related to Dart Web. library-html type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-libraries Issues impacting dart:html, etc., libraries

Comments

@DartBot
Copy link

DartBot commented Jul 8, 2013

This issue was originally filed by da...@altern.org


What steps will reproduce the problem?

  1. Try to use Range.fromPoint with Firefox
  2. Get an error
  3. For completion, try it with IE, Safari and Opera.

What is the expected output? What do you see instead?
I expect to get a new Range object. Instead I get the error
"TypeError: document.caretRangeFromPoint is not a function"

What version of the product are you using? On what operating system?
Dart SDK 0.5.20.4_r2475 , Firefox 22, Ubuntu 12.04

Please provide any additional information below.
This bug is related to Issue #9227.
With recent versions of Firefox, caretPositionFromPoint could be used instead of caretRangeFromPoint. With older versions, MouseEvent.rangeParent and MouseEvent.rangeOffset could be used with an event. With IE it can be done with textRange.moveToPoint. Implementing this method on all Dart supported browsers is not easy, but it would be good to at least improve support to more browsers and provide a way to check if the feature is supported by the browser.

See https://developer.mozilla.org/en-US/docs/Web/API/document.caretPositionFromPoint
and http://stackoverflow.com/a/3208216/438970

@DartBot
Copy link
Author

DartBot commented Jul 8, 2013

This comment was originally written by da...@altern.org


Note that caretRangeFromPoint is mentionned in an old draft of CSSOM:
http://www.w3.org/TR/2009/WD-cssom-view-20090804/#dom-documentview-caretrangefrompoint

But it has been replaced by caretPositionFromPoint in the latest version:
http://dev.w3.org/csswg/cssom-view/#dom-document-caretpositionfrompoint

@iposva-google
Copy link
Contributor

Added Area-HTML, Triaged labels.

@efortuna
Copy link
Contributor

Added this to the Later milestone.

@kevmoo
Copy link
Member

kevmoo commented Apr 7, 2014

Removed Area-HTML label.
Added Area-Library, Library-Html labels.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@dynaxis
Copy link

dynaxis commented Oct 12, 2015

Any update to this issue? It is very confusing since the API is not marked as experimental or not working on firefox. What's the general policy in this case? Chrome is not updating its API to the latest draft but firefox has implemented the latest. Is Dart HTML API supposed to mirror Chrome's status or the latest draft?

@kevmoo kevmoo added this to the 1.14 milestone Oct 12, 2015
@mit-mit
Copy link
Member

mit-mit commented Dec 28, 2015

@alan-knight any news on this?

@alan-knight
Copy link
Contributor

De facto, dart:html's API is generated from Chrome's IDL. Unfortunately the Chrome IDL is non-standard here, and the IDL file has a comment at the beginning of that section saying "non-standard APIs", but they aren't actually flagged in the IDL as experimental or unstable. And those annotations aren't even visible to users anyway. So in the short term added a comment in https://codereview.chromium.org/1578103003

Longer term it would be good to have a portable solution, but that's non-trivial.

@alan-knight alan-knight removed this from the 1.14 milestone Jan 12, 2016
@kevmoo kevmoo added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed priority-unassigned labels Feb 29, 2016
@vsmenon vsmenon added the area-web Issues related to Dart Web. label Jul 20, 2019
@sigmundch sigmundch added the web-libraries Issues impacting dart:html, etc., libraries label Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-library area-web Issues related to Dart Web. library-html type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-libraries Issues impacting dart:html, etc., libraries
Projects
None yet
Development

No branches or pull requests

10 participants