Files
sousa-gecko/testing/web-platform/tests/css/css-syntax/serialize-escape-identifiers.html
T
Kiet Ho be9fe4c1ba Bug 2050643 [wpt PR 60845] - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=317193, a=testonly
Automatic update from web-platform-tests
WebKit export of https://bugs.webkit.org/show_bug.cgi?id=317193

--

wpt-commits: 4a954c6ee822ca9f86d0fd966872bcf90da007f5
wpt-pr: 60845
2026-07-06 08:45:53 +00:00

34 lines
1.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Properly escape CSS identifiers</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel="help" href="https://crbug.com/343000522">
<style id="sheet">
@import 'abc' layer(\{\});
@counter-style abc\{\}oops {}
@font-feature-values abc\{\}oops {}
@font-palette-values --abc\{\}oops {}
@keyframes abc\{\}oops {}
@layer abc\;oops\!;
@media \( {}
@position-try abc\{\}oops {}
@counter-style abc\{\}oops {}
@namespace abc\{\}oops "test";
@page abc\{\}def {}
</style>
</head>
<body>
<script>
test(()=>{
const rules = Array.from(document.styleSheets[0].cssRules);
const text = rules.map(r => r.cssText).join('\n');
sheet.innerText = text;
const new_rules = Array.from(document.styleSheets[0].cssRules);
const new_text = new_rules.map(r => r.cssText).join('\n');
assert_equals(new_text, text);
}, 'Rules must be the same after serialization round-trip, even with escaped characters');
</script>