blob: 640d34390146d90c68167d4a9ae9998795f6ecf4 [file] [edit]
<!DOCTYPE html>
<meta charset="utf-8">
<title>getComputedStyle should not return pseudo-class styles by default</title>
<link rel="help" href="https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<!-- Regression test for https://github.com/jsdom/jsdom/issues/3607 -->
<style>
button { background-color: rgb(127, 255, 212); }
button:hover { background-color: rgb(255, 228, 196); }
</style>
<button id="button">Submit</button>
<script>
"use strict";
test(() => {
const button = document.getElementById("button");
const styles = window.getComputedStyle(button);
assert_equals(styles.backgroundColor, "rgb(127, 255, 212)");
}, "getComputedStyle should return the default style, not :hover style");
</script>