Fix the newline bunny-hop bug harder

In I4375f4c07, I fixed a bug where " <meta>\nfoo" would dirty-diff
to "\n <meta>foo" in wrapper paragraphs. It turns out this was
still broken in the case where the newline was followed by an
inline node rather than text: " <meta>\n<span>" was still being
dirty-diffed to "\n <meta><span>".

This was caused by a special case for when a content node is inserted
into a wrapper, in which case wrappedWhitespace is cleared. That's fine
and necessary, but in addition to that, we also need to output any
buffered meta items and their whitespace, and clear nextWhitespace
so we don't later record the previous value of wrappedWhitespace as
outer whitespace in the content node's .internal.whitespace array.

Bug: 69861
Change-Id: Ie80a98512b350311832a8674fac892b378738df0
Update oo#compare usages

compare now allows comparisons to null/undefined.

Also as compare treats arrays as objects, when seeing if an array
is full of undefined's we don't need to construct a sparse array.

Change-Id: I34c5b2699982044e13943bb9b9f47c7a0f522e3b
Remove lies about event objects being passed through

onFocusChange is debounced now, so it doesn't get a jQuery.Event
object passed to it any more. It was trying to pass this
nonexistent object to onDocumentFocus() and onDocumentBlur(),
which were already ignoring it anyway.

Change-Id: Ic29cea2b15626715eb6ddaf4f87b5279ffae36b3
Create ImageNode mixin to share logic between Block & Inline

Change-Id: I90b543e1a91ab950ff9e857c038bf670dde5634d
Fix JS error in ce.LanguageAnnotation when dir is set but lang isn't

Bug: 69955
Change-Id: Ib7330af9007e95fcee3085e21d1f883d0005dba3
Check IME simulations actually fail as expected

Previously, each IME test was skipped if failure was expected. Now, the test
harness checks that a failure actually happens, and that it happens at the
expected point in the input sequence. This way, if a change affects an IME
simulation as a side effect, it will be noticed, whether the side effect is
positive, negative or both.

Change-Id: I67656591a6b1af1f64163338bef5e94a3d3b6b78
Merge "Update oo#compare usages"
Followup bbff57b, 8c71904: use getter for availableTools, again

Bug: 69988
Change-Id: I00ad6c12216012bc5bcd1fdb3fb37701a8ce7d45
Merge "Followup bbff57b, 8c71904: use getter for availableTools, again"
Merge "Check IME simulations actually fail as expected"
dm.NodeFactory: Use .lookup() instead of .create().constructor

No reason to create a throwaway instance.

Change-Id: I4f4f9053d4cc0f23296b969141f473ea5daafe7c
Localisation updates from https://translatewiki.net.

Change-Id: I39f21c41ed5770f77d9e6bdef9c302a8d39c19a9
Try a bit harder not to create empty text nodes

They get cleaned up by normalization anyway, but given that
we check for emptiness in all other places where we create
text node, we should do that consistently throughout this
function.

Change-Id: Ie0fd83bc56fbc9407b87c7c229188c6bf5336719
Followup 355be3ed: fix getOffset() behavior inside block aliens

If you gave getOffset() a DOM offset inside a block alien, it
would correctly return the DM offset inside of that block alien.
This was broken in 355be3ed which caused getOffset() to count
text node characters inside of block aliens, which led to some
very strange results.

Fix this by making the lengthSum addition conditional on
canContainContent again, as it was before 355be3ed. Kept the
isWrapped addition conditional on !isContent, that part of
355be3ed was correct.

This was causing bugs in cases where the user was able to get
the cursor inside of a block transclusion, which IE allows.

Change-Id: I5cfb1df45ed9ff1497cb179b0f5c2f442cf1e106
Check for selection in ve.ce.Surface#onDocumentFocus

Instead of checking if focus was caused by a mouse event, check if there
is a selection already.

This seems to work correctly both on desktop and iOS Safari.

Bug: 66697
Change-Id: Ief6c44cb6c5e25ccdff01f632a5f65a8abc4f3ed
Merge "Check for selection in ve.ce.Surface#onDocumentFocus"
Merge "Fix the newline bunny-hop bug harder"
Localisation updates from https://translatewiki.net.

Change-Id: Idbcd6f0ae78c103ee908bd30164a0b7b26114a47
Remove unnecessary execCommand('undo') from onCut

As we use onCopy to write data to the clipboard and this is
done entirely in the pasteTarget, the view is not modified by
the cut event, so there's nothing to undo. This is left over
from before we rewrote onCopy.

Bug: 58724
Change-Id: I2269e0ec409dc9eaa0826c78468d9cac554e0433
Merge "Remove unnecessary execCommand('undo') from onCut"