Automatic update from web-platform-tests WebKit export of https://bugs.webkit.org/show_bug.cgi?id=317193 -- wpt-commits: 4a954c6ee822ca9f86d0fd966872bcf90da007f5 wpt-pr: 60845
34 lines
1.1 KiB
HTML
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>
|