Merge branch 'asyncout-773313' into landing

Conflicts:
	lib/gclitest/helpers.js

Signed-off-by: Joe Walker <jwalker@mozilla.com>
menuclick-788215: Add ' ' prefix on menu click.

There is a downside of this simple fix, that sometimes when there is a
space as a suffix of the prior argument, that we end up with two spaces.
While this is clearly a minor problem, it's nowhere near as serious as
getting the menu click wrong.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
menuclick-788215: Correct case in gethighlightingProxy

Capital 'H': s/gethighlightingProxy/getHighlightingProxy/g

Signed-off-by: Joe Walker <jwalker@mozilla.com>
menuclick-788215: textContent strips HTML from name

Using innerHTML worked fine on UAs without Proxy support because the
name highlighting doesn't work on those platforms. The correct solution
either way is to use textContent.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
menuclick-788215: Fix menu activation for <RETURN>

The same 2 problems with menu click (i.e. using innerHTML and not adding
a space prefix) need solving for keyboard activation too.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
menuclick-788215: Pass arg to itemClicked not conversion

Push the conversion down the stack closer to the requisition, which is
where we want the conversion to be done.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
menuclick-788215: Convert setAssignment to use options

We had setAssignment and _setAssignment, but the distinction (internal
vs. external) wasn't helpful, so we're merging them.
We need to add another customization - to duplicate arg padding, and
we don't want to do that as another parameter, so we are moving to an
options syntax, and removing the negative on argUpdate while we are at
it.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
menuclick-788215: Take spaces into account

Add the 'matchPadding' option to setAssignment to copy the prefix and
suffix from the original argument if the new argument doesn't contain
any prefix/suffix.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
noxhtml-768399: Use innerHTML before XHTML alternatives

This change is taken from a patch by Saran <ksk.3393@gmail.com> to
gcli.jsm in mozilla-central. See this attachment for more details:
https://bug768399.bugzilla.mozilla.org/attachment.cgi?id=667062

Use of HTML (i.e. not XHTML) was failing when embedded in HTML documents
where it would otherwise be valid. This reverses the logic to try
innerHTML before createContextualFragment()
badcomplete-795324: Default choice to 0

If we are told to update ourselves when there isn't a new choice then
we reset the choice to 0. This avoids problems where we display the
wrong tab completion.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
spacecomplete-797016: Auto wrap completed args with spaces

Previously if you pressed TAB to complete an arg which contained a space
you'd get the completion but without the quotes. There was code in
Argument.beget() to handle this case but due to a missing negative it
was never called. Also we need to add to NamedArgument some code to
handle the added quotes.

We also needed a special case for commands because we don't want to add
quotes around sub-commands.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
spacecomplete-797016: Add unit tests

Unit tests for previous commit.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
padscroll-791085: Remove right hand padding from menu

When there wasn't much vertical space, scrollbars appeared in the wrong
place. This is a temporary fix. We could probably do better by placing
the scrollbars on a more deeply nested element, but it does go some
way to mitigating the instant need.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
minify-668503: Use character rather than char

Some minifiers think that char is a keyword, so we use character
instead.

From patch provided by Grant Gayed <grant_gayed at ca dot ibm dot com>

Signed-off-by: Joe Walker <jwalker@mozilla.com>
minify-668503: Don't use trailing comma

It confuses some minifiers.

From patch provided by Grant Gayed <grant_gayed at ca dot ibm dot com>

Signed-off-by: Joe Walker <jwalker@mozilla.com>
minify-668503: Further code tidy up

Looked over the code tidying various things up. Includes documentation
and removing dead code.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
Merge branch 'noxhtml-768399'
Merge branch 'master' into minify-668503
Merge branch 'menuclick-788215'
Merge branch 'master' into minify-668503