<!doctype html>
<title>CSS Color Adjust Test: meta color-scheme - attribute changes</title>
<meta id="meta" name="color-scheme" content="dark">
<link rel="help" href="https://drafts.csswg.org/css-color-adjust-1/#color-scheme-meta">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/compute-root-color-scheme.js"></script>
<script>
  assert_root_color_scheme("dark", "Meta color-scheme initially 'dark'.");

  meta.removeAttribute("name");
  assert_root_color_scheme("normal", "Removed name attribute from meta color-scheme.");

  meta.setAttribute("name", "color-scheme");
  assert_root_color_scheme("dark", "Set meta name to color-scheme.");

  meta.setAttribute("content", "");
  assert_root_color_scheme("normal", "Set content attribute of meta color-scheme to empty string.");

  meta.setAttribute("content", ",,invalid");
  assert_root_color_scheme("normal", "Set content attribute of meta color-scheme to an invalid value.");

  meta.setAttribute("content", "light");
  assert_root_color_scheme("light", "Set content attribute of meta color-scheme to 'light'.");

  meta.removeAttribute("content");
  assert_root_color_scheme("normal", "Removed the content attribute of meta color-scheme.");
</script>
