Skip to content

Commit

Permalink
Fix HTML5 spec-compliance for support.html
Browse files Browse the repository at this point in the history
This page was failing HTML5 validation and producing warnings on IE11
due to the script tag being outside of the head tag.

Change-Id: I22a951ed0923561c4f25a4e8df501437bb685220
  • Loading branch information
joeyparrish committed Mar 2, 2016
1 parent b6ccd38 commit 185e8f6
Showing 1 changed file with 49 additions and 49 deletions.
98 changes: 49 additions & 49 deletions support.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,63 +18,63 @@
<head>
<title>Shaka Player Browser Support Test</title>
<script src="dist/shaka-player.compiled.js"></script>
</head>
<body><pre id="output"></pre></body>
<script>
function whenLoaded(fn) {
// IE 9 fires DOMContentLoaded, and enters the "interactive"
// readyState, before document.body has been initialized, so wait
// for window.load
if (document.readyState == 'loading' ||
document.readyState == 'interactive') {
if (window.attachEvent) {
// IE8
window.attachEvent('onload', fn);
<script>
function whenLoaded(fn) {
// IE 9 fires DOMContentLoaded, and enters the "interactive"
// readyState, before document.body has been initialized, so wait
// for window.load
if (document.readyState == 'loading' ||
document.readyState == 'interactive') {
if (window.attachEvent) {
// IE8
window.attachEvent('onload', fn);
} else {
window.addEventListener('load', fn);
}
} else {
window.addEventListener('load', fn);
fn();
}
} else {
fn();
}
}

function doTest() {
shaka.polyfill.installAll();
shaka.Player.support().then(function(support) {
var userAgent = navigator.userAgent;
var formatted = userAgent + '\n' + shaka.Player.version + '\n\n';
function doTest() {
shaka.polyfill.installAll();
shaka.Player.support().then(function(support) {
var userAgent = navigator.userAgent;
var formatted = userAgent + '\n' + shaka.Player.version + '\n\n';

var indent = ' ';
formatted += '{\n';
for (var topLevelKey in support) {
formatted += indent + topLevelKey + ': ';
if (typeof(support[topLevelKey]) == 'boolean') {
formatted += support[topLevelKey].toString();
} else {
var obj = support[topLevelKey];
formatted += '{\n';
for (var subKey in obj) {
formatted += indent + indent + subKey + ': ';
formatted += obj[subKey].toString();
formatted += '\n';
var indent = ' ';
formatted += '{\n';
for (var topLevelKey in support) {
formatted += indent + topLevelKey + ': ';
if (typeof(support[topLevelKey]) == 'boolean') {
formatted += support[topLevelKey].toString();
} else {
var obj = support[topLevelKey];
formatted += '{\n';
for (var subKey in obj) {
formatted += indent + indent + subKey + ': ';
formatted += obj[subKey].toString();
formatted += '\n';
}
formatted += indent + '}';
}
formatted += indent + '}';
formatted += '\n';
}
formatted += '\n';
}
formatted += '}\n';
formatted += '}\n';

var output = document.getElementById('output');
var output = document.getElementById('output');

if (output.textContent === undefined) {
// IE8 and other very old browsers don't have textContent.
output.innerText = formatted;
} else {
output.textContent = formatted;
}
});
}
if (output.textContent === undefined) {
// IE8 and other very old browsers don't have textContent.
output.innerText = formatted;
} else {
output.textContent = formatted;
}
});
}

whenLoaded(doTest);
</script>
whenLoaded(doTest);
</script>
</head>
<body><pre id="output"></pre></body>
</html>

0 comments on commit 185e8f6

Please sign in to comment.