[w3c/editing] Should we propose "::caret" pseudo-element to CSS WG? (#158)

# ::caret pseudo-element

## Proposal:
::caret pseudo-element is used for rendering "caret-shape:bar", rendering engine uses "font-*" properties to determine height of caret, from font-size and font-family, and width from font-weight and slanted from font-style.

## Motivation
::caret pseudo-element allows us:
 - Solves #70, height of empty element  is specified by ::caret pseudo-element. When editable element gets focus, we can enlarge the element to hold a character having style specified by ::caret pseudo-element rather than height of element.
```
<style>
::caret { font-size: 20px }
</style>
Below cE should have height for "font-size: 20px" when its get focus.
<div style="height: 0px" contenteditable>
   <span style="font-size: 20px;">foo</span>
</div>
```
 - Font menu; rather than inserting an empty SPAN with inline style, we set properties of ::caret pseudo-element for matching caret shape to next inserted characters.
 - Render caret as last typing style; rather than leaving empty element, we can remove empty element, e.g. when user removes character `a` from `<b>a<;/b>`, we want to remove `<b></b>` but caret shape should be thick since next typed character should have bold style.

Note: Term "height" and "width" assumes horizontal writing-mode, on vertical-mode height and width are swapped.

[1] https://drafts.csswg.org/css-ui-4/#caret-shape

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/editing/issues/158

Received on Thursday, 8 December 2016 03:54:45 UTC