Runs: Chrome 160.0.8195.0 (wpt@1ab8957e4, 2026-12-01) | Firefox 163.0a1 (wpt@1ab8957e4, 2026-12-01) | Safari 257 preview (wpt@1ab8957e4, 2026-12-01) | Ladybird 1.0-6ebf3 (wpt@f779e426f, 2026-12-02) | Servo Servo 0.8 (wpt@75c11f957, 2026-12-01) | Blitz 713a982dc (wpt@705f393a6, 2026-12-01)
| Chrome | Firefox | Safari | Ladybird | Servo | Blitz | |
|---|---|---|---|---|---|---|
| Total | 1/1 | 1/1 | 1/1 | 1/1 | 1/1 | NOT RUN |
| Subtest | Chrome | Firefox | Safari | Ladybird | Servo | Blitz |
|---|---|---|---|---|---|---|
| eval blocks if the default policy rejects a value. | PASS | PASS | PASS | PASS | PASS | — |
/trusted-types/tt-block-eval.html
<!DOCTYPE html> <html> <head> <meta name="variant" content="?default"> <meta name="variant" content="?trusted-types-eval"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <meta http-equiv="Content-Security-Policy" content="require-trusted-types-for 'script'"> <script> if (location.search === "?trusted-types-eval") { const meta = document.createElement("meta"); meta.httpEquiv = "Content-Security-Policy"; meta.content = "script-src 'nonce-abc' 'trusted-types-eval'"; document.head.appendChild(meta); } </script> </head> <body> <script nonce="abc"> trustedTypes.createPolicy("default", {createScript: _ => null}); test(t => { let a = 0; assert_throws_js(EvalError, _ => { eval('a="hello there"'); }); assert_equals(a, 0); }, "eval blocks if the default policy rejects a value."); </script>