Re: [editing] What browser internals can be exposed to help us move the caret in (and against) the block direction? (#56)

I completely agree that one of the biggest "missing pieces" for editor devs is the complete lack of visibility into how a text node is laid out. To know where a line-wrap occurs we have to do some ridiculous hacky and error-prone gymnastics.

The browser should expose APIs that allow us to query a text node in various ways:
```
TextNode.getLineWraps() //array of character positions where line wraps

TextNode.getFromPosition( x, start );  // returns the character number closest to position x, starting at character number start.
```

These would have to be adapted for bidi text and vertical text, but you get the idea. With these we can iterate over our Elements and Text Nodes and find the desired range where we want to place the caret after a `move-caret-up` intent.

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/editing/issues/56#issuecomment-106901297

Received on Friday, 29 May 2015 18:47:03 UTC