Backed out changeset 2913e3ccf060 (bug 1283803)
authorIris Hsiao <ihsiao@mozilla.com>
Tue, 19 Jul 2016 16:34:21 +0800
changeset 330543 f82ca603aede87e4264842dae3e5fb8163b1328f
parent 330542 242b9e254d65fcfe29d0a794cf69a4749ee5a0e1
child 330544 be05774c859441eace4d4e3a8176a5e637fedaf9
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1283803
milestone50.0a1
backs out2913e3ccf060235fb94ef0e811780c02d0a5393e
Backed out changeset 2913e3ccf060 (bug 1283803)
dom/media/webvtt/vtt.jsm
--- a/dom/media/webvtt/vtt.jsm
+++ b/dom/media/webvtt/vtt.jsm
@@ -1360,24 +1360,21 @@ this.EXPORTED_SYMBOLS = ["WebVTT"];
           // reference it.
           self.regionList.push({
             id: settings.get("id"),
             region: region
           });
         }
       }
 
-      // Parsing the WebVTT signature, it contains parsing algo step1 to step9.
-      // See spec, https://w3c.github.io/webvtt/#file-parsing
-      function parseSignatureMayThrow(input) {
+      // WebVTT parser algorithm step1 - step9.
+      function parseSignature(input) {
         let signature = collectNextLine();
         if (!/^WEBVTT([ \t].*)?$/.test(signature)) {
           throw new ParsingError(ParsingError.Errors.BadSignature);
-        } else {
-          self.state = "HEADER";
         }
       }
 
       // Parsing the region and style information.
       // See spec, https://w3c.github.io/webvtt/#collect-a-webvtt-block
       //
       // There are sereval things would appear in header,
       //   1. Region or Style setting
@@ -1420,17 +1417,18 @@ this.EXPORTED_SYMBOLS = ["WebVTT"];
           line = null
         }
         return line;
       }
 
       // 5.1 WebVTT file parsing.
       try {
         if (self.state === "INITIAL") {
-          parseSignatureMayThrow();
+          parseSignature();
+          self.state = "HEADER";
         }
 
         var line;
         if (self.state === "HEADER") {
           line = parseHeader();
         }
 
         while (self.buffer) {