summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-conditional/at-supports-whitespace.html
blob: 12683ab92bb46af035b5bfa17b466b23736d1c5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE html>
<title>Parsing of @supports with whitespace</title>
<link rel="help" href="https://drafts.csswg.org/css-conditional-3/#at-supports">
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<main id=main></main>
<script>
  let examples = [
    '@supports ((a)) {}',
    '@supports ((a) ) {}',
    '@supports ( (a)) {}',
    '@supports ( (a) ) {}',

    '@supports (not (a)) {}',
    '@supports (not (a) ) {}',
    '@supports ( not (a)) {}',
    '@supports ( not (a) ) {}',

    '@supports ((a) and (b)) {}',
    '@supports ((a) and (b) ) {}',
    '@supports ( (a) and (b)) {}',
    '@supports ( (a) and (b) ) {}',

    '@supports ((a) or (b)) {}',
    '@supports ((a) or (b) ) {}',
    '@supports ( (a) or (b)) {}',
    '@supports ( (a) or (b) ) {}',
  ];

  for (let example of examples) {
    test((t) => {
      let style = document.createElement('style');
      t.add_cleanup(() => style.remove());
      style.textContent = example;
      main.append(style);
      assert_equals(style.sheet.rules.length, 1);
    }, example);
  }
</script>