Bug 1307710 - part2: webvtt cue voice span and language span need annotation. r=rillian draft
authorbechen <bechen@mozilla.com>
Wed, 01 Mar 2017 15:16:51 +0800
changeset 490737 041252e2153fedb856e1c37cf6c1c1e75bbb09a7
parent 490736 92fcce340a8ed6250dc292f6b8851baf64f9ebcd
child 490738 3aa4d674431713c769c5ea36b0dab4835a568b7b
child 490770 9c6a813cc85fcea98c6514ccb404db4f2ea662cf
child 490773 0421a5fae622b2942db229e38ff74f7b2aa5e941
child 490776 51b2ab00fe910c453829586ca3f96e804d7e0f02
child 492717 b3389f2ea24e0b4a366ef3c78be15f3d96edadc5
push id47210
push userbechen@mozilla.com
push dateWed, 01 Mar 2017 08:00:49 +0000
reviewersrillian
bugs1307710
milestone54.0a1
Bug 1307710 - part2: webvtt cue voice span and language span need annotation. r=rillian MozReview-Commit-ID: FqUMAt436ZP
dom/media/webvtt/vtt.jsm
--- a/dom/media/webvtt/vtt.jsm
+++ b/dom/media/webvtt/vtt.jsm
@@ -342,18 +342,18 @@ Cu.import('resource://gre/modules/Servic
     function createElement(type, annotation) {
       var tagName = TAG_NAME[type];
       if (!tagName) {
         return null;
       }
       var element = window.document.createElement(tagName);
       element.localName = tagName;
       var name = TAG_ANNOTATION[type];
-      if (name && annotation) {
-        element[name] = annotation.trim();
+      if (name) {
+        element[name] = annotation ? annotation.trim() : "";
       }
       return element;
     }
 
     var root;
     if (bReturnFrag) {
       root = window.document.createDocumentFragment();
     } else {