Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 10 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /css/css-navigation/tentative/parsing/navigation-rule-location-valid.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Serialization of @navigation navigation-location-test and navigation-location-between-test</title>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
<script>
test(()=> {
const canonical = "@navigation (at: --foo) {\n}";
test_valid_rule(canonical);
test_valid_rule(" @Navigation (At:--foo){ \n} ", canonical);
}, "navigation-location-test");
test(()=> {
const canonical = "@navigation (between: --a and --b) {\n}";
test_valid_rule(canonical);
test_valid_rule("@Navigation ( Between:--a And --b ){ \n} ", canonical);
}, "navigation-location-between-test");
test(()=> {
const canonical = "@navigation (between: url-pattern(\"/a/\") and url-pattern(\"/b/\")) {\n}";
test_valid_rule(canonical);
test_valid_rule("@Navigation (Between:url-pattern( \"/a/\" ) And url-pattern( \"/b/\" )){ \n }", canonical);
}, "navigation-location-between-test with url-pattern()");
test(()=> {
const canonical = "@navigation ((from: --a) or (at: --b)) {\n}";
test_valid_rule(canonical);
test_valid_rule("@Navigation ( ( From:--a ) Or ( At:--b) ){ \n} ", canonical);
}, "complex navigation-location-test");
test(()=> {
const canonical = "@navigation ((between: --a and --b) or (at: --c)) {\n}";
test_valid_rule(canonical);
test_valid_rule("@Navigation ( ( Between:--a And --b ) Or ( At:--c) ){ \n} ", canonical);
}, "complex mixed");
</script>