Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html>
<title>Custom Functions: &lt;dashed-function&gt; with named argument syntax</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
<script>
test_valid_value('top', '--func(myident)');
test_valid_value('top', '--func(--myident)');
test_valid_value('top', '--func(--)');
test_valid_value('top', '--func(50px --myident:)');
// Arguments may not begin within <dashed-ident> <colon> (ignoring whitespace);
// this pattern is reserved for named arguments in the future.
//
//
// Note: This matches the "bad declaration" handling in
test_invalid_value('top', '--func(--myident:)');
test_invalid_value('top', '--func( --myident:)');
test_invalid_value('top', '--func(--myident :)');
test_invalid_value('top', '--func(--myident: )');
test_invalid_value('top', '--func( --myident : )');
test_invalid_value('top', '--func(10px, --myident : )');
// It's valid when wrapped in {}, though:
test_valid_value('top', '--func({--myident:})');
test_valid_value('top', '--func({ --myident:})');
test_valid_value('top', '--func({--myident :})');
test_valid_value('top', '--func({--myident: })');
test_valid_value('top', '--func(10px, { --myident : })');
</script>