Bug 1328966 - Accept \r as a valid line ending. r?alwu
See https://w3c.github.io/webvtt/#webvtt-line-terminator for
allowed values.
MozReview-Commit-ID: C62Lu4PNQRE
--- a/dom/media/webvtt/vtt.jsm
+++ b/dom/media/webvtt/vtt.jsm
@@ -1433,17 +1433,17 @@ this.EXPORTED_SYMBOLS = ["WebVTT"];
if (self.state === "HEADER") {
line = parseHeader();
}
while (self.buffer) {
if (!line) {
// Since the data receiving is async, we need to wait until the
// buffer gets the full line.
- if (!/\r\n|\n/.test(self.buffer)) {
+ if (!/\r\n|\n|\r/.test(self.buffer)) {
return this;
}
line = collectNextLine();
}
switch (self.state) {
case "ID":
// Ignore NOTE and line terminator