File: random-serialize.tentative.html

package info (click to toggle)
thunderbird 1%3A140.3.1esr-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,608,628 kB
  • sloc: cpp: 7,671,698; javascript: 5,901,131; ansic: 3,898,955; python: 1,413,270; xml: 653,997; asm: 462,284; java: 180,948; sh: 113,489; makefile: 20,460; perl: 14,288; objc: 13,059; yacc: 4,583; pascal: 3,352; lex: 1,720; ruby: 1,222; exp: 762; sql: 715; awk: 580; php: 436; lisp: 430; sed: 70; csh: 10
file content (54 lines) | stat: -rw-r--r-- 2,844 bytes parent folder | download | duplicates (7)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/css-values-5/#random">
<link rel="author" title="sam@webkit.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../support/parsing-testcommon.js"></script>
<div id=target></div>
<script>

test_valid_value('width', 'random(0px, 100px)');
test_valid_value('width', 'random(0px, 100px, 50px)');
test_valid_value('width', 'random(--foo, 0px, 100px)');
test_valid_value('width', 'random(auto, 0px, 100px)', 'random(0px, 100px)');
test_valid_value('width', 'random(--foo element-shared, 0px, 100px)');
test_valid_value('width', 'random(auto element-shared, 0px, 100px)', 'random(element-shared, 0px, 100px)');
test_valid_value('width', 'random(element-shared --foo, 0px, 100px)', 'random(--foo element-shared, 0px, 100px)');
test_valid_value('width', 'random(element-shared auto, 0px, 100px)', 'random(element-shared, 0px, 100px)');
test_valid_value('width', 'random(fixed 0.5, 0px, 100px)');
test_valid_value('width', 'random(--foo, 0px, 100px, 50px)');
test_valid_value('width', 'random(auto, 0px, 100px, 50px)', 'random(0px, 100px, 50px)');
test_valid_value('width', 'random(--foo element-shared, 0px, 100px, 50px)');
test_valid_value('width', 'random(auto element-shared, 0px, 100px, 50px)', 'random(element-shared, 0px, 100px, 50px)');
test_valid_value('width', 'random(element-shared --foo, 0px, 100px, 50px)', 'random(--foo element-shared, 0px, 100px, 50px)');
test_valid_value('width', 'random(element-shared auto, 0px, 100px, 50px)', 'random(element-shared, 0px, 100px, 50px)');
test_valid_value('width', 'random(fixed 0.5, 0px, 100px, 50px)');

// Test out of order.
test_valid_value('width', 'random(100px, 0px)');

// Test negative values
test_valid_value('width', 'random(-100px, -10px)');
test_valid_value('width', 'random(-100px, -10px, -5px)');

// Test mixed units.
test_valid_value('width', 'random(1em, 200rem)');

// Test nested expressions
test_valid_value('width', 'random(10 * 100px, 200em / 2)', 'random(1000px, 100em)');
test_valid_value('width', 'random(fixed calc(2 / 4), 0px, 100px)', 'random(fixed calc(0.5), 0px, 100px)');

// Test nested in expressions
test_valid_value('width', 'calc(2 * random(0px, 100px))');

// Test other types
test_valid_value('max-lines', 'random(25, 50)');
test_valid_value('max-lines', 'random(25, 50, 5)');
test_valid_value('scale', 'random(0.5, 2.5)');
test_valid_value('scale', 'random(0.5, 2.5, 0.1)');
test_valid_value('rotate', 'random(25deg, 1turn)', 'random(25deg, 360deg)');
test_valid_value('rotate', 'random(25deg, 1turn, 5deg)', 'random(25deg, 360deg, 5deg)');
test_valid_value('transition-delay', 'random(25ms, 50s)', 'random(0.025s, 50s)');
test_valid_value('transition-delay', 'random(25ms, 50s, 5s)', 'random(0.025s, 50s, 5s)');

</script>