blob: 77422177e0760ffe1f690344a05e4b8aecab57ca [file] [log] [blame]
<!DOCTYPE html>
<title>Test that u, b, i WebVTT objects are being styled correctly.</title>
<script src="../media-file.js"></script>
<script src="../media-controls.js"></script>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<video></video>
<script>
async_test(function(t) {
var video = document.querySelector('video');
video.src = findMediaFile('video', '../content/test');
var track = document.createElement('track');
track.src = 'captions-webvtt/styling-default.vtt';
track.kind = 'captions';
track.default = true;
video.appendChild(track);
video.onseeked = t.step_func_done(function() {
var cueNode = textTrackCueElementByIndex(video, 0).firstChild.firstElementChild;
assert_equals(getComputedStyle(cueNode).fontWeight, '700');
cueNode = cueNode.nextElementSibling;
assert_equals(getComputedStyle(cueNode).fontStyle, 'italic');
cueNode = cueNode.nextElementSibling;
assert_equals(getComputedStyle(cueNode).textDecoration, 'underline solid rgb(255, 255, 255)');
});
video.currentTime = 0.1;
});
</script>