Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-anchor-position/position-try-rule-caching-001.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Tests that given two sheets containing the same @position-try, modifying one sheet doesn't affect the other sheet</title>
<link rel="author" title="Kiet Ho" href="mailto:kiet.ho@apple.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(() => {
const style1 = new CSSStyleSheet();
const style2 = new CSSStyleSheet();
const cssText = "@position-try --try { position-area: center }";
style1.replaceSync(cssText);
style2.replaceSync(cssText);
style1.cssRules[0].style.positionArea = "bottom right";
assert_equals(style2.cssRules[0].style.positionArea, "center");
}, "Modifying one sheet containing @position-try rule doesn't affect another sheet");
</script>