<!DOCTYPE html>
<html>
<head>
<script>
if (window.testRunner) {
    testRunner.waitUntilDone();
    testRunner.dumpAsText();
    testRunner.dumpResourceLoadCallbacks();
}

let loadCount = 0;
function didLoad(element)
{
    if (!loadCount) {
        document.querySelector('link').rel = 'stylesheet';
        setTimeout(() => document.querySelector('link').rel = 'StyleSheet', 50);
        setTimeout(() => document.querySelector('link').rel = '  StyleSheet', 100);
        setTimeout(() => document.querySelector('link').media = 'all', 150);
        setTimeout(() => document.querySelector('link').media = 'All', 200);
        setTimeout(() => document.querySelector('link').type = 'text/css', 250);
        setTimeout(() => document.querySelector('link').href = 'resources/link-stylesheet-load-once.css', 300);
        setTimeout(() => document.querySelector('link').href = '  ../HTMLLinkElement/resources/link-stylesheet-load-once.css', 350);
        setTimeout(() => {
            if (window.testRunner)
              testRunner.notifyDone();
        }, 400);
    }
    ++loadCount;
    result.innerHTML = loadCount;
}

</script>
<link rel="stylesheet" type="text/css" media="all" href="resources/link-stylesheet-load-once.css" onload="didLoad(this)">
</head>
<body>
<p>This tests overriding rel content attribute with the same value.<br>
You should see 1 in a green box below:</p>
<div id="result"></div>
</body>
</html>
