<html>
<head>
<title>CSS4 media query test: prefers-contrast.</title>
<style type="text/css">
p { color: black; }
</style>
<script>
window.addEventListener("load", function () {
    if (!window.internals)
        return;

    window.internals.settings.forcedPrefersContrastAccessibilityValue = "on";
    if (window.matchMedia("(prefers-contrast)").matches)
        document.getElementById("a").style.color = "green";
    if (window.matchMedia("(prefers-contrast: more)").matches)
        document.getElementById("b").style.color = "green";

    window.internals.settings.forcedPrefersContrastAccessibilityValue = "off";
    if (!window.matchMedia("(prefers-contrast)").matches)
        document.getElementById("c").style.color = "green";
    if (window.matchMedia("(prefers-contrast: no-preference)").matches)
        document.getElementById("d").style.color = "green";
}, false);
</script>
</head>
<body>
  <p id="a">This text should be green.</p>
  <p id="b">This text should be green.</p>
  <p id="c">This text should be green.</p>
  <p id="d">This text should be green.</p>
</body>
</html>
