RE: [CSSOM] does CaretPosition need a "before/after" hint?

± From: www-style-request@w3.org [mailto:www-style-request@w3.org] On Behalf Of Anne van Kesteren
± Sent: Thursday, June 23, 2011 11:06 AM
± 
± So suggestions for names are .attachment and .affinity neither of which
± sounds very boolean. We could do something like .isBeforeChar that returns
± a boolean or maybe .placement which either returns the string "before" or
± "after". Preferences?
± 

Caret direction is certainly a feature of caret, it is required for full control of a caret. Here is one old example of caret API: http://msdn.microsoft.com/en-us/library/aa704266(v=VS.85).aspx , GetCaretDirection() is there.

caretPosition in CSSOM is just a position. The position is defined in same terms as Range (which BTW has similar issues with ambiguous positions, but chooses simplicity).

What is the use case when it is important in *CSSOM* to have caret direction?

In case we actually find the reason to have caret direction in CSSOM, I can suggest

 caretPosition.direction = "forward" | "backward" | "undefined";

(direction is logical, "forward" is direction of traversal of DOM tree towards from start to end)

Alex

Received on Thursday, 21 July 2011 00:41:52 UTC