editor: Improved use of contenteditable for a caret support
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 24 Jul 2014 14:00:48 +0000 (16:00 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 14 Aug 2014 14:01:45 +0000 (16:01 +0200)
This change stops declaring the whole canvas as being contenteditable=true,
marks as such only current canvas text element instead.

This approach has many advantages:

1. We no longer need to handle unspecified caret behavior, where caret
could be put anywhere in the canvas DOM tree (outside of canvas text
elements in particular) which needed tricky corrections on the fly.

2. Canvas widgets and custom canvas elements no longer need to
use contenteditable=false nesting inside contenteditable=true,
effects of which are not fully specified and which was leading
to many unexpected behaviors, especially in Firefox.

3. It makes it possible the make a selection across any fragment of
a document (contenteditable=true elements nested in contentedtiable=false
are blocking selection crossing its borders from the inside).

The downside is the need to handle keyboard navigation on the borders
of canvas text elements manually.


No differences found