Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/default.html - WPT Dashboard Interop Dashboard
<!doctype html>
<title>HTMLTrackElement.default</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<div id=log></div>
<script>
test(function(){
var track = document.createElement('track');
assert_equals(track['default'], false);
assert_equals(track.getAttribute('default'), null);
}, document.title + ' missing value');
test(function(){
var track = document.createElement('track');
track.setAttribute('default', '');
assert_equals(track['default'], true);
assert_equals(track.getAttribute('default'), '');
}, document.title + ' empty string content attribute');
test(function(){
var track = document.createElement('track');
track['default'] = '';
assert_equals(track['default'], false);
assert_equals(track.getAttribute('default'), null);
}, document.title + ' empty string IDL attribute');
test(function(){
var track = document.createElement('track');
track.setAttribute('default', 'foo');
assert_equals(track['default'], true);
assert_equals(track.getAttribute('default'), 'foo');
}, document.title + ' foo in content attribute');
test(function(){
var track = document.createElement('track');
track['default'] = 'foo';
assert_equals(track['default'], true);
assert_equals(track.getAttribute('default'), '');
}, document.title + ' foo in IDL attribute');
test(function(){
var track = document.createElement('track');
track['default'] = true;
assert_equals(track['default'], true);
assert_equals(track.getAttribute('default'), '');
}, document.title + ' true in IDL attribute');
test(function(){
var track = document.createElement('track');
track.setAttribute('default', '');
track['default'] = false;
assert_equals(track['default'], false);
assert_equals(track.getAttribute('default'), null);
}, document.title + ' false in IDL attribute');
</script>