Workaround for a webkit/blink bug where the clientRects
of a range that is collapsed at the last position of a
text node are empty.
This used to throw lots of errors when computing the
firstRect and lastRect in a SelectionView, when the mouse
moved near the ends of certain textnodes
Added root-filtering of nodes in SelectionView.getFillerRect.
The filler rect is now calculated with extra
granularity, and getFillerRect now has different
code paths for various conditions. The computing
is quite fast because we do not walk over every
single node in the fillerRange, and only look
at the start and end siblings below the common
ancestor element in detail.
This fixes several annoying bugs:
* If you dragged a selection towards the right
just over a blinking cursor, it would extend
to the far right
* Drawing selections over annotation markers
caused them to have bad widths due to rects from
nodes that were not of the same root.
Smarter rerendering of selections in SessionView:
* Unsubscribe from requests to rerender when destroying
* Use an interval-based loop of 200ms to check if a redraw
has been requested, and rerender in that case.
Hide the local caret when a shadowCursor selection
is being drawn
* Make hand-drawn selections have proper direction.
* All cursor classes gain hasForwardSelection() methods.
* maintainCursorSelection now preserves selection direction.
Add documentation for the ShadowCursor class
Merge pull request #112 from adityab/virtual-selections

Virtual selections!
add a few helper functions into OdfUtils.js
Refactoring a few classes for supporting selection type

CaretManaer - hide caret if it is image selection; otherwise show and refresh cursor blinking
OdtCursor - introduce seletion type
OpAddAnnotation - reset seletion type to default after moved into annotion
area
OpMoveCursor - set the cursor's selection type
OpRemoveText - reset selecton type to default after deletion
Support image selection

*Added a ImageSelector class to draw and clear image selection

Known issue:
The selection box is moving up and down when using browser's zooming functionality. but it is working fine with the slider zoom
Only respond to the following keyboard events for image selection.
esc, tab, delete, backspace, undo/redo and copy/cut.

Note: MS Word behave differently from LO/AOO when image is selected.
When press letters,numbers&symbols, MS Word inserts the text just before the
image; where LO/AOO ignores all of them.
Also you can extend selectiion using keyboard shortcuts (e.g
shift+left) in MS Word, but you cannot do so in LO/AOO.

TODO:
Esc - deselect image
Tab - move to next frame in the document
Disable font and paragraph formating toolbar items on the editor when image is selected.

LO/AOO actually hides those options.
Cope with the window having no current selection when changing the shadow cursor
Clear the last image selection when drawing a new virtual selection
Merge pull request #118 from peitschie/imgselection

Support image selection  (rebased #108)
Ensure the cursor is in a walkable state after applying direct styling

Due to how text splitting works, the cursor is often left outside the
span, resulting in:
<p>|A|<span>B</span>|C|</p>

According to README_cursorpositions.txt, the cursor position near a span
is after the last character in the span. I.e.,:
<p>|A|<span>B|</span>C|</p>

The fix for this is to fix the cursor positions after the operation has
been executed
Add support for cursor-styling

Cursor styling allows the direct styling properties of the next inserted
text to be set. This means that the user can set text-related properties
(e.g., bold, underline, italic) without having an existing selection,
and the next entered character will have this formatting applied to it.

Known issues
- Undo/redo requires multiple steps. Should only be one. But, the current
undo manager design is not amenable to this type of change.
Refactored StyleHelper text queries (isBold etc.) to use a applied styles object

This improves the performance by reducing the number of times getAppliedStyles
is called (once per update, rather than once per property to check), and
paves the way for the direct cursor styling to be taken into account.
Refresh the style information cache to account for any direct cursor styling
More tightly couple direct styling support to text manipulator

At this point, this is not intended to be open for extension as it is too
easy to break OT logic by incorrectly manipulating the operation groups.
Instead, convert this to use a specific-built extension point under tight
control of WebODF.