- From: Charles Pritchard <chuck@jumis.com>
- Date: Wed, 11 Aug 2010 15:14:21 -0700
> On Tue, 10 Aug 2010, Charles Pritchard wrote: >>> >>> I recommend not using <canvas> for text editing. >> >> I've worked on a substantial amount of code dealing with text editing. >> At present, the descent of the current font has been the only >> deficiency. > > Well, there's also the way it doesn't interact with the OS text selection, > copy-and-paste, drag-and-drop, accessibility APIs, the browsers' undo > logic, the OS spell-checker and grammar-checker, the OS text tools like > "Search in Spotlight", and the i18n features like bidi handling. And > that's just for starters. :-) Drag-and-drop works just fine, it's covered by event.dataTransfer. Accessibility has been addressed through drawFocusRing amongst other techniques of including relevant HTML within the canvas tag. Undo logic is covered by the history state objects. Text selection visuals work using measureText and textBaseline bottom. OS tools are fairly out of spec, though I do understand the value of extending a dataTransfer API to assist with UA context menu hooks, such as spellcheck/autocomplete/grammar suggestions. That said, there's nothing in the way of implementing those features within an HTML app. Even offline, both can be accomplished via WebSQL. Perhaps there should be a discussion about dataTransfer and the context menu. > >> I feel that using Canvas to implement HTML5/CSS provides a quality proof >> of the completeness of the 2D API. > > The 2D API isn't complete by a long shot, there's no difficulty in proving > that. It's not trying to be complete. Perhaps completeness is a poor choice. I'm concerned about obstructions. At present, there are very few obstacles. CSS and Canvas have allowed me to create implementations of HTML Forms, CSS line boxes and SVG. Baseline positioning is an obstacle. I realize that SVG has an even-odd fill mode. This is something that can be converted, and is rarely used. > > -- > Ian Hickson U+1047E )\._.,--....,'``. fL > http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,. > Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.' Through CSS computed styles, or a canvas interface, I will get accessible baseline offsets. :-)
Received on Wednesday, 11 August 2010 15:14:21 UTC