Fix expandRange( 'root' ) to not include the internal list

Change-Id: I61752657f49a4e1709a63f012d5b1f6bc99dfc05
ve.ui.AnnotationInspector: Allow content insertion without annotating

Needed by Ie4a633ed in mediawiki/extensions/VisualEditor.

I think this makes a bit more sense. Previously, you could only insert
content if you were going to annotate it – now, you can always insert
it *unless* you are going to de-annotate it. (Without this condition,
clicking the 'remove' button of an inspector for a collapsed range
would insert content, which is silly.)

This is technically a backwards-incompatible change, but it doesn't
break anything in core or MW as far as I can see.

Change-Id: Icc2e368ac2f7951f53981d834029ef8b8f075d61
Greatly simplify ve.ce.Surface#getSelectionRect

We were calling getBoundingClientRect(), and if any of the
coordinates we got back was zero, we'd measure the cursor position
manually by inserting a <span>, then locating it.

There were two problems with this. First, it broke IMEs because
they don't like DOM manipulation. Second, we weren't actually using
the result of getBoundingClientRect() AT ALL, ANYWHERE: we were only
checking it for zeroes, then throwing it away. To get the actual
return value we used get(Start|End)DocumentPos(), and it turns out
those work just fine even in cases where getBoundingClientRect()i
gets confused.

So, instead, just use get(Start|End)DocumentPos() directly, and get
rid of the call to getBoundingClientRect() and all the DOM manipulation
recovery code. The only case I observed where get(Start|End)DocumentPos()
don't work was in Firefox when the address bar is focused on load; then
they sometimes throw exceptions. But in that case we can get away with
returning null, which we already do if the range list is empty.

Change-Id: I9cf97244a1c80754d2844cb77ce101d3afa6bf5b
Create a whitespace preserving TextInputWidget and use in CommentInspector

Creates a widget which preserves whitespace, but doesn't display it.

Change-Id: I019b37dc195d4c2a016c0439997d51711f89c573
Merge "Create a whitespace preserving TextInputWidget and use in CommentInspector"
Merge "Greatly simplify ve.ce.Surface#getSelectionRect"
Update OOjs UI to v0.1.0-pre (3d8475c0b3)

New changes:
feba6af Remove unused CSS classes
58af913 Remove direction style attribute
7463080 Restyle agora theme for mobile after window refactor
5708bdf Make scrolling in PanelLayout smoother on iOS
96b89c2 demos: Add right-aligned menu in toolbar demo

Change-Id: If38bbe6a7bc6c1452d2c56397344a3b75f5e46d5
Merge "Fix expandRange( 'root' ) to not include the internal list"
Localisation updates from https://translatewiki.net.

Change-Id: I889048ae82294bd1fc44459cd8414423cb09cff7
ve.ui.AnnotationInspector: Stop truncating fragments to 255 elements

This was implemented for the link inspector in 2012, in Ibddf942c, as
a temporary hack, and has survived at least three total rewrites of
everything.

Even for the link inspector, this makes no sense:
* We don't even know if we're truncating characters or other nodes.
* We don't even know if we're making an internal or external link.
* We don't even know if the fragment will be a valid title.
* And we don't even know if a valid title needs to be shorter than 255 bytes anyway.

Change-Id: I0c005cb77045b1926aa98616b9a02da7aa6fb061
Merge "ve.ui.AnnotationInspector: Allow content insertion without annotating"
Merge "ve.ui.AnnotationInspector: Stop truncating fragments to 255 elements"
Update OOjs UI to v0.1.0-pre (dd294dc785)

New changes:
f9e65d6 Revert "Make scrolling in PanelLayout smoother on iOS"

Change-Id: I095717ce24aaa28835bb7869c43edb898f5291b9
Set a default language for ve.dm.Document if we can't guess it otherwise

We already do this for directionality (fallback to ltr), but not language; falling back
to en patches over a wider hole that allows this to come up.

Bug: 68808
Change-Id: I270ff9830ed791c0b42bbadfa89bf6f733d110ba
Disable tools other than links and references on mobile

Temporary measure so that we don't show mobile context when we
shouldn't.

Change-Id: I19c4ed2aa361bec385ae7888ee62fc2cc916b9b8
Merge "Disable tools other than links and references on mobile"
Localisation updates from https://translatewiki.net.

Change-Id: I6edbcc601ef4ba8b0cbf6ed39735f60ff09beb22
Followup 23a949844: fix typo in class name for WhitespacePreservingInputWidget

Bug: 68960
Change-Id: I1145cacd24d594012ccfe637698e0bae26dee3c7
Merge "Followup 23a949844: fix typo in class name for WhitespacePreservingInputWidget"
Have LanguageInputWidget return lang+dir, not an annotation

Move annotation-specific code into the language inspector so
that the input widget can be a generic lang/dir selector, not
just one that returns language annotations.

Use the new generic widget in the demo menu (with some CSS hacks).

Change-Id: I9e92bd2d6e732092a9bc44aff000030be933482f