ident-function-parsing.html (1414B)
1 <!DOCTYPE html> 2 <title>CSS Values: The ident() Function (parsing)</title> 3 <link rel="help" href="https://drafts.csswg.org/css-values-5/#ident"> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <script src="/css/support/parsing-testcommon.js"></script> 7 <script> 8 // Any property that accepts <custom-ident> will do. 9 let prop = 'view-transition-name'; 10 11 test_invalid_value(prop, 'ident()'); 12 test_invalid_value(prop, 'ident( )'); 13 test_invalid_value(prop, 'ident(rgb(1, 2, 3))'); 14 test_invalid_value(prop, 'ident(5px)'); 15 16 test_valid_value(prop, 'ident(myident)'); 17 test_valid_value(prop, 'ident( myident)', 'ident(myident)'); 18 test_valid_value(prop, 'ident(myident )', 'ident(myident)'); 19 test_valid_value(prop, 'ident("myident")'); 20 test_valid_value(prop, 'ident("myident" 3)'); 21 test_valid_value(prop, 'ident(3 "myident")'); 22 test_valid_value(prop, 'ident("my" "ident")'); 23 test_valid_value(prop, 'ident(my "ident")'); 24 test_valid_value(prop, 'ident("my" ident)'); 25 test_valid_value(prop, 'ident(my ident)'); 26 test_valid_value(prop, 'ident(-- myident)'); 27 test_valid_value(prop, 'ident(my 3 3 3 3 ident)') 28 29 // Check for support in specific properties (WIP): 30 let ident = 'ident("myident" 42)'; 31 32 // https://drafts.csswg.org/css-view-transitions/#view-transition-name-prop 33 test_valid_value('view-transition-name', ident); 34 </script>