Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/document-metadata/the-style-element/with-spaces.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>Spaces inside style sheet properties should work fine</title>
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
<style>
.cool-class {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<p class="cool-class">
Hello!
</p>
<script>
"use strict";
setup({ single_test: true });
const el = document.querySelector(".cool-class");
// Check whitespace parsing independently of font-family serialization.
assert_in_array(window.getComputedStyle(el).fontFamily, [
`"Helvetica Neue", Helvetica, Arial, sans-serif`,
"Helvetica Neue, Helvetica, Arial, sans-serif"
]);
done();
</script>