Index: third_party/WebKit/Source/core/html/HTMLTrackElement.cpp |
diff --git a/third_party/WebKit/Source/core/html/HTMLTrackElement.cpp b/third_party/WebKit/Source/core/html/HTMLTrackElement.cpp |
index d9a9108db84e47dbe6ea33b0f85e5cc76b3d113c..7dc0f0cdeb783572f0aab8a84e7974b45f99efda 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLTrackElement.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLTrackElement.cpp |
@@ -94,7 +94,15 @@ void HTMLTrackElement::parseAttribute(const QualifiedName& name, const AtomicStr |
// 4.8.10.12.3 Sourcing out-of-band text tracks |
// As the kind, label, and srclang attributes are set, changed, or removed, the text track must update accordingly... |
} else if (name == kindAttr) { |
- track()->setKind(!value.isNull() ? value.lower() : TextTrack::subtitlesKeyword()); |
+ AtomicString lowerCaseValue = value.lower(); |
+ // 'missing value default' ("subtitles") |
+ if (lowerCaseValue.isNull()) |
+ lowerCaseValue = TextTrack::subtitlesKeyword(); |
+ // 'invalid value default' ("metadata") |
+ else if (!TextTrack::isValidKindKeyword(lowerCaseValue)) |
+ lowerCaseValue = TextTrack::metadataKeyword(); |
+ |
+ track()->setKind(lowerCaseValue); |
} else if (name == labelAttr) { |
track()->setLabel(value); |
} else if (name == srclangAttr) { |