Decouple tokenizer/tree builder state from WebVTTParser

The WebVTTTokenizer owned by the WebVTTParser (m_tokenizer) is only
used by the WebVTTParser::createDocumentFragmentFromCueText method
on WebVTTParser.
The same is true for other state like the current token (m_token),
the current (subtree root) node (m_currentNode) and the stack of
language tags (m_languageStack).
Transplant this state together with it's mutator method -
constructTreeFromToken - onto a new helper class, WebVTTTreeBuilder,
and then use that in WebVTTParser::createDocumentFragmentFromCueText.

With the above in place, WebVTTParser::createDocumentFragmentFromCueText
can be made static, avoiding the contorted (and unnecessary) allocation
in TextTrackCue::createWebVTTNodeTree.

BUG=305317

Review URL: https://codereview.chromium.org/52713005

git-svn-id: svn://svn.chromium.org/blink/trunk@161073 bbb929c8-8fbe-4397-9dbb-9b2b20218538
3 files changed