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
Comments
This comment was originally written by da...@altern.org Note that caretRangeFromPoint is mentionned in an old draft of CSSOM: But it has been replaced by caretPositionFromPoint in the latest version: |
Added this to the Later milestone. |
Removed Area-HTML label. |
Removed this from the Later milestone. |
Removed Oldschool-Milestone-Later label. |
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? |
@alan-knight any news on this? |
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. |
This issue was originally filed by da...@altern.org
What steps will reproduce the problem?
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
The text was updated successfully, but these errors were encountered: