DescriptionDecouple 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
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=161073
Patch Set 1 #
Messages
Total messages: 4 (0 generated)
|