HTML5 Balancer
This adds an implementation of the HTML5 Tree Builder algorithm to PHP,
along with test cases from the tree builder derived from the
html5lib-tests package on github. The test cases were preprocessed
into JSON for the `domino` HTML5 parser, and we're using the JSON
form of the tests.
The implementation follows both the language of the HTML5 specification
and the implementation in `domino` very closely, easing updates if the
specification changes.
This code is used in follow-on commits to support an HTML5-based
"tidy" for mediawiki and the `{{#balance}}` parser function, which
ensures that a template expands to properly-balanced HTML, with all
tags closed and nothing left on the HTML active formatting elements
list.
See: https://github.com/fgnass/domino
Change-Id: I6f4d20a43510dd819776bb333b639315b19d150d