ES6 shim cleanup

Use Map and Set instead of plain objects.

Using HEAD of hamony-collections while waiting for a release since,
https://github.com/Benvie/harmony-collections/pull/12

Also, could be useful but worked around for the moment,
https://github.com/Benvie/harmony-collections/pull/13

Bug: 53241
Change-Id: Id76b48f7f6f5fa53274512f73a45d5260fef795a
Remember the output of failing (blacklisted) tests

* The raw outputs of failing tests are saved in the blacklist and if a
  test fails, and is expected to, will be used for comparison to track
  improvements and regressions.

* Comment in whitelist suggests that it should be used when our selser
  output is correct but failing due to limitations in the test setup.

* Reduce some code duplications in parserTests.js

* Also, some cleanup from when selser.changes.json was removed.

Bug: 50316
Bug: 51718
Change-Id: I46eab7ca7c4c58e43997abedcaa944a1e7c17064
Added utility method to process content in pipeline.

* This eliminates repetitive code from a few places and might be
  useful for future patches as well.

Change-Id: I383ed253a2fa20c1b7429689d17cde176751e29a
Added --changetree and --dump dom:post-changes options to parserTests

* I often want to run a selser test with a specific changetree applied
  to it. Finally, I scratched that itch. Not sure why it took me so
  long.

* Also added an additional dom dump option to dump the DOM post-changes
  for debugging purposes.

Change-Id: I4ab7a5ad9480a4aacdb3ad35a722f9a31dfc78f1
Merge "Remember the output of failing (blacklisted) tests"
Merge "Added utility method to process content in pipeline."
Bug 51680: Give preference to namespaces over interwiki prefixes

Change-Id: Ia3303e43cd64498ddf503f6255decc90f478a1bc
Add 'MemoryAlpha' namespace for parser tests.

Bug: 51680
Change-Id: I06a173976a69fb659fdb9fef285e36e2a10f7d08
Merge "ES6 shim cleanup"
Merge "Add 'MemoryAlpha' namespace for parser tests."
Sync parserTests with core.

This matches upstream commit bc97a03f06bfb4bfd33cd2ec2a127c2f607e34e2.

Added "Namespace takes precedence over interwiki link (bug 51680)"  to
blacklist for html2wt and html2html because without rel="mw:WikiLink" the
link is not recognized correctly.

Change-Id: Ic21439a6b65eff1d0f9ce9ab4a9f9bb66f9ed0eb
Introduce Parsing/DOM scopes for content fragments

* Added mechanism to parse a set of tokens in its own parsing
  scope all the way to DOM (which in turn restricts token
  transformations to just that scope). This is equivalent to
  enforcing well-balanced requirements in restricted contexts
  (Ex: link content, image captions for starters). This also
  provides an option of enforcing balanced templates in certain
  contexts.

  This patch applies it to link content and image captions.
  Deleted the hacky closeUnclosedBlockTags code for dealing
  with bad HTML in captions.

* Refactored common/duplicate code out of Cite handler and
  Template handler.

* Updated DSR handling for dom-fragments which eliminates the
  warnings about cs/s dsr mismatches seen on image reuse.

  it:Dalmine used to get a bunch of DSR inconsistency warnings
  when dom-fragments were reused (reported in bug 53071) and
  are now fixed with this patch.

* There is still one big hole in DOM fragment unpacking that
  has to be fixed. This pertains to improper tag nesting that
  will be broken up by the tree builder. The DOM fragment unpacker
  has to recognize these scenarios and fix up the DOM (either
  by fixing up the final DOM or by stripping mis-nested tags
  in the DOM fragment being unpacked).

  This patch has an incomplete hack for this that addresses
  the common-use case of nested a-tags generated by wikitext
  of this form: "[http://foo.bar a [[Wikilink] here]".

Bug: 54454
Bug: 49942
Bug: 44476
Bug: 47326

Change-Id: I33ee38bc43743125b705ac821b339586593dbef7
Don't compare to blacklisted output when supplied a changetree

Alea is seeded based on the changesIndex so this will always be
different.

Conflict between commits:
d45b1b251b764b0e947878a9f9e7a0f49349ccba
2c43608152abc0eeb6021240410fb9ce4cfbb10f

Change-Id: I100ab91c743494972aa7e9b99601e0aaff9c41db
Provide performance measurements via 'X-Parsoid-Performance' header

Sets a custom header, 'X-Parsoid-Performance', on HTTP responses. It is
composed of '; '-separated key-value pairs representing various internal
performance measurements.

This will be used by Ori's performance logging framework on the client if the
page was a cache miss.

Change-Id: I1d7fd94f236c1759de859922d2a0604631963aa8
Remove confusing 'selser-cache-hit' from XPP header

Follow-up to I1d7fd94f2, removing incorrect & badly named 'selser-cache-hit'
property.

Change-Id: I7faea3df52d67c7088c3b35e0bf4cf83b3f15423
Merge "Introduce Parsing/DOM scopes for content fragments"
Bunch of unrelated cleanup

* Got rid of unnecessary/buggy concat of EOFTk in ext.Cite.js
  to wikitext string (concat is only required when processing
  a token array from stage 2 onwards).

* Moved temporary node.data.parsoid.wrapper flag to a tmp object
  which is then stripped in the cleanup pass. Other temporary
  flags from other passes could also be moved here.

* Added a helper to test if a typeOf has a parsoid-generated
  value.

Change-Id: I2024c575b5293e5155fc8e2915a34b5fb8394671
Change CurlMultiClient for libcurl3 7.32

Starting with libcurl3 7.32, curl_multi_select often returns -1 immediately,
and continues to do so until curl_multi_exec is called to perform more work.

See these PHP bugs:
https://bugs.php.net/bug.php?id=63411
https://bugs.php.net/bug.php?id=65704

This patch simplifies the processing loop, and makes sure that curl_multi_exec
is called even when curl_multi_select returns -1. It has been tested with
libcurl3 7.26 and 7.32, both using PHP 5.5.4 on Debian.

Change-Id: I996d803d25d1093c68ab21f4b37e88efa24ad277
Don't process mw:dom-fragment-tokens in AttributeExpander

* The AttributeExpander was interfering with the content and
  processing it rather than leave them for the DOM Fragment
  handler.

* Was causing regressions in RT testing.
  Fixes fr:Constitution, de:Vincent_van_Gogh

* Added a couple new parser tests which should catch these kind
  of issues in the future. These are Parsoid-specific image
  tests (unbalanced tags in caption; tempalte transclusion in
  caption). Given different output for images for PHP parser and
  Parsoid, I made this Parsoid only for now. The html2wt tests
  fail because of data-parsoid getting stripped out.

Change-Id: Ia417e3f5f797b89e4913df663b594c2758f6498c
Merge "Change CurlMultiClient for libcurl3 7.32"