<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Security-Policy" content="style-src 'sha256-FSRZotz4y83Ib8ZaoVj9eXKaeWXVUawM8zAPfYeYySs='">
    <style>p { color: green; }</style>
    <style>p { color: red; }</style>
    <style>p { color: purple; }</style>
    <style>p { color: blue; }</style>
</head>
<body>
    <p>
        This tests the effect of a valid style-hash value, with one valid
        style and several invalid ones. It passes if the valid style is applied
        and three console warnings are visible.
    </p>
    <script>
        if (window.testRunner)
            testRunner.dumpAsText();

        var color = window.getComputedStyle(document.querySelector('p')).color;
        if (color === "rgb(0, 128, 0)")
            alert("PASS: The 'p' element's text is green, which means the style was correctly applied.");
        else
            alert("FAIL: The 'p' element's text is " + color + ", which means the style was incorrectly applied.");
    </script>
</body>
</html>
