[css-properties-values-api] Make empty universal custom props valid

In CustomProperty::ApplyValue, we parse the specified token sequence
(in this case an empty sequence), against the registered grammar
(in this case the universal syntax), and ultimately we call
CSSVariableParser::ParseVariableReferenceValue, to "parse" this
empty token sequence. ParseVariableReferenceValue had an incorrect
check on empty ranges - likely a remnant of the old spec, which did
not allow empty values.

Fixed: 1485804
Change-Id: I13ba8d9196c50a5a74c5991e2fec4c961b6a0c28
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4890262
Reviewed-by: Steinar H Gunderson <sesse@chromium.org>
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1201429}
diff --git a/css/css-properties-values-api/var-reference-registered-properties.html b/css/css-properties-values-api/var-reference-registered-properties.html
index ea1b7b3..4fb1a86 100644
--- a/css/css-properties-values-api/var-reference-registered-properties.html
+++ b/css/css-properties-values-api/var-reference-registered-properties.html
@@ -221,4 +221,21 @@
 test_using_invalid_fallback('<length> | none', 'nolength');
 test_using_invalid_fallback('<color>', 'var(--length-1)');
 
+test(function(t){
+    CSS.registerProperty({
+        name: '--registered-universal-no-initial',
+        syntax: '*',
+        inherits: false
+    });
+    t.add_cleanup(() => {
+        element.style = '';
+    });
+    element.style = [
+        '--registered-universal-no-initial:;',
+        'background-color: var(--registered-universal-no-initial) green',
+    ].join(';');
+    let computedStyle = getComputedStyle(element);
+    assert_equals(computedStyle.getPropertyValue('background-color'), 'rgb(0, 128, 0)');
+}, 'Empty universal custom property can be substituted with var()');
+
 </script>