Skip to content

Commit e643f5e

Browse files
darrnshntabatkins
authored andcommitted
Add constructor to CSSVariableReferenceValue (#547)
* Add constructor to CSSVariableReferenceValue * Specify what fallback is set to if not passed.
1 parent 2818b07 commit e643f5e

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

css-typed-om/Overview.bs

+15-1
Original file line numberDiff line numberDiff line change
@@ -543,9 +543,10 @@ interface CSSUnparsedValue : CSSStyleValue {
543543
getter (DOMString or CSSVariableReferenceValue) (unsigned long index);
544544
};
545545

546+
[Constructor(DOMString variable, optional CSSUnparsedValue fallback)]
546547
interface CSSVariableReferenceValue {
547548
attribute DOMString variable;
548-
attribute CSSUnparsedValue? fallback;
549+
readonly attribute CSSUnparsedValue? fallback;
549550
};
550551
</pre>
551552

@@ -560,6 +561,19 @@ The <dfn attribute for=CSSUnparsedValue>length</dfn> attribute indicates how man
560561

561562
The <dfn for=CSSUnparsedValue>indexed getter</dfn> retrieves the string fragment or variable reference at the provided index.
562563

564+
<div algorithm>
565+
The <dfn constructor for=CSSVariableReferenceValue>CSSVariableReferenceValue(|variable|, |fallback|)</dfn> constructor must,
566+
when called,
567+
perform the following steps:
568+
569+
1. Return a new {{CSSVariableReferenceValue}}
570+
with its {{CSSVariableReferenceValue/variable}} internal slot
571+
set to |variable|
572+
and its {{CSSVariableReferenceValue/fallback}} internal slot
573+
set to |fallback| (if passed)
574+
or `null` otherwise.
575+
</div>
576+
563577
<!--
564578
██ ██ ████████ ██ ██ ██ ██ ███████ ████████ ████████
565579
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██

0 commit comments

Comments
 (0)