Bug 1415821 - Correct the behavior for BADCUE state. r=alwu
MozReview-Commit-ID: G59NBC9rcGa
--- a/dom/media/webvtt/vtt.jsm
+++ b/dom/media/webvtt/vtt.jsm
@@ -1395,18 +1395,19 @@ const { XPCOMUtils } = require("resource
}
if (self.cue.text) {
self.cue.text += "\n";
}
self.cue.text += line;
break;
case "BADCUE": // BADCUE
// 54-62 - Collect and discard the remaining cue.
- if (!line) {
- self.state = "ID";
+ self.state = "ID";
+ if (line) { // keep this line to ID state.
+ continue;
}
break;
}
// The line was already parsed, empty it to ensure we can get the
// new line in next iteration.
line = null;
}
} catch (e) {