Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/font-face.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset=utf-8>
<title>font face</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
const types = ["serif", "sans-serif", "cursive", "fantasy", "monospace"];
for (let type of types) {
test(() => {
let elem = document.createElement("font");
elem.setAttribute("face", type);
document.body.appendChild(elem);
let exp_type = window.getComputedStyle(elem, null).getPropertyValue("font-family");
assert_equals(exp_type, type);
}, `font face attribute ${type} is correct`);
}
</script>