@@ -8816,9 +8816,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
8816
8816
<dfn extended-attribute data-lt="ReflectPositiveWithFallback"
8817
8817
data-x="xattr-ReflectPositiveWithFallback"><code>[ReflectPositiveWithFallback]</code></dfn>, <dfn
8818
8818
extended-attribute data-lt="ReflectRange"
8819
- data-x="xattr-ReflectRange"><code>[ReflectRange]</code></dfn>, and <dfn extended-attribute
8820
- data-lt="ReflectDefault" data-x="xattr-ReflectDefault"><code>[ReflectDefault]</code></dfn> IDL
8821
- <span>extended attribute</span>s.</p>
8819
+ data-x="xattr-ReflectRange"><code>[ReflectRange]</code></dfn>, <dfn extended-attribute
8820
+ data-lt="ReflectDefault" data-x="xattr-ReflectDefault"><code>[ReflectDefault]</code></dfn>, and
8821
+ <dfn extended-attribute data-lt="ReflectEnum"
8822
+ data-x="xattr-ReflectEnum"><code>[ReflectEnum]</code></dfn> IDL <span>extended
8823
+ attribute</span>s.</p>
8822
8824
8823
8825
<p>The <code data-x="xattr-Reflect">[Reflect]</code>, <code
8824
8826
data-x="xattr-ReflectURL">[ReflectURL]</code> <code
@@ -8889,6 +8891,33 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
8889
8891
<span>extended attribute</span> have a <span>default value</span> provided by <code
8890
8892
data-x="xattr-ReflectDefault">[ReflectDefault]</code>.</p>
8891
8893
8894
+ <p>The <code data-x="xattr-ReflectEnum">[ReflectEnum]</code> <span>extended attribute</span> must
8895
+ take an identifier. It must not appear on anything other than an interface member attribute with a
8896
+ type of <code data-x="idl-DOMString">DOMString</code>. Additionally, it must also only appear
8897
+ alongside <code data-x="xattr-Reflect">[Reflect]</code>. The identifier provided by <code
8898
+ data-x="xattr-ReflectEnum">[ReflectEnum]</code> must be that of an IDL enum, this is used to
8899
+ represent the known-value keywords.
8900
+
8901
+ <p>To declare the value used for the <span>invalid value default</span>, <span>missing value
8902
+ default</span>, and the empty value states, we introduce the <dfn extended-attribute
8903
+ data-x="xattr-InvalidValueDefault"><code>[InvalidValueDefault]</code></dfn>, <dfn
8904
+ extended-attribute data-x="xattr-MissingValueDefault"><code>[MissingValueDefault]</code></dfn>,
8905
+ and <dfn extended-attribute
8906
+ data-x="xattr-EmptyValueDefault"><code>[EmptyValueDefault]</code></dfn> IDL <span>extended
8907
+ attribute</span>s.</p>
8908
+
8909
+ <p>The <code data-x="xattr-InvalidValueDefault">[InvalidValueDefault]</code>, <code
8910
+ data-x="xattr-MissingValueDefault">[MissingValueDefault]</code> and <code
8911
+ data-x="xattr-EmptyValueDefault">[EmptyValueDefault]</code> <span>extended attribute</span>s must
8912
+ either take no arguments, or take a string. They must not appear on anything other than an
8913
+ enum.</p>
8914
+
8915
+ <p>IDL attributes with the <code data-x="xattr-ReflectEnum">[ReflectEnum]</code> <span>extended
8916
+ attribute</span> are <span>limited to only known values</span>.</p>
8917
+
8918
+ <p>TODO: Define how [InvalidValueDefault], [MissingValueDefault], and [EmptyValueDefault] actually
8919
+ work.</p>
8920
+
8892
8921
<h4>Using reflect in specifications</h4>
8893
8922
8894
8923
<p><span data-x="reflect">Reflection</span> is primarily about improving web developer ergonomics
@@ -12034,7 +12063,14 @@ interface <dfn interface>HTMLElement</dfn> : <span>Element</span> {
12034
12063
undefined <span data-x="dom-showPopover">showPopover</span>(optional <span>ShowPopoverOptions</span> options = {});
12035
12064
undefined <span data-x="dom-hidePopover">hidePopover</span>();
12036
12065
boolean <span data-x="dom-togglePopover">togglePopover</span>(optional (<span>TogglePopoverOptions</span> or boolean) options = {});
12037
- [<span>CEReactions</span>] attribute DOMString? <span data-x="dom-popover">popover</span>;
12066
+ [<span>CEReactions</span>, <span data-x="xattr-Reflect">Reflect</span>, <span data-x="xattr-ReflectEnum">ReflectEnum</span>=<span>PopoverKeywords</span>] attribute DOMString? <dfn attribute for="HTMLElement" data-x="dom-popover">popover</dfn>;
12067
+ };
12068
+
12069
+ [<span data-x="xattr-InvalidValueDefault">InvalidValueDefault</span>=<span data-x="attr-popover-manual">"manual"</span>, <span data-x="xattr-MissingValueDefault">MissingValueDefault</span>, <span data-x="xattr-EmptyValueDefault">EmptyValueDefault</span>=<span data-x="attr-popover-auto">"auto"</span>]
12070
+ enum <dfn enum>PopoverKeywords</dfn> {
12071
+ <dfn attr-value for="html-global/popover" data-x="attr-popover-auto">"auto"</dfn>,
12072
+ <dfn attr-value for="html-global/popover" data-x="attr-popover-manual">"manual"</dfn>,
12073
+ <dfn attr-value for="html-global/popover" data-x="attr-popover-hint">"hint"</dfn>
12038
12074
};
12039
12075
12040
12076
dictionary <dfn dictionary>ShowPopoverOptions</dfn> {
@@ -86323,23 +86359,20 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
86323
86359
<th>Brief description
86324
86360
<tbody>
86325
86361
<tr>
86326
- <td><dfn attr-value for="html-global/popover"><code
86327
- data-x="attr-popover-auto">auto</code></dfn>
86328
- <td rowspan=2><dfn data-x="attr-popover-auto-state">Auto</dfn>
86362
+ <td><code data-x="attr-popover-auto">auto</code></td>
86363
+ <td rowspan=2><dfn data-x="attr-popover-auto-state">Auto</dfn></td>
86329
86364
<td rowspan=2>Closes other popovers when opened; has <span data-x="popover light dismiss">light
86330
86365
dismiss</span> and responds to <span data-x="close request">close requests</span>.
86331
86366
<tr>
86332
86367
<td>(the empty string)
86333
86368
<tr>
86334
- <td><dfn attr-value for="html-global/popover"><code
86335
- data-x="attr-popover-manual">manual</code></dfn>
86336
- <td><dfn data-x="attr-popover-manual-state">Manual</dfn>
86369
+ <td><code data-x="attr-popover-manual">manual</code></td>
86370
+ <td><dfn data-x="attr-popover-manual-state">Manual</dfn></td>
86337
86371
<td>Does not close other popovers; does not <span data-x="popover light dismiss">light
86338
86372
dismiss</span> or respond to <span data-x="close request">close requests</span>.
86339
86373
</tr>
86340
86374
<tr>
86341
- <td><dfn attr-value for="html-global/popover"><code
86342
- data-x="attr-popover-hint">hint</code></dfn></td>
86375
+ <td><code data-x="attr-popover-hint">hint</code></td>
86343
86376
<td><dfn data-x="attr-popover-hint-state">Hint</dfn></td>
86344
86377
<td>Closes other hint popovers when opened, but not other auto popovers; has <span
86345
86378
data-x="popover light dismiss">light dismiss</span> and responds to <span data-x="close
@@ -86353,10 +86386,6 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
86353
86386
default">invalid value default</i> is the <span data-x="attr-popover-manual-state">Manual</span>
86354
86387
state.</p>
86355
86388
86356
- <p>The <dfn attribute for="HTMLElement"><code data-x="dom-popover">popover</code></dfn> IDL
86357
- attribute must <span>reflect</span> the <span data-x="attr-popover">popover</span> attribute,
86358
- <span>limited to only known values</span>.</p>
86359
-
86360
86389
<p>Every <span data-x="HTML elements">HTML element</span> has a <dfn export>popover visibility
86361
86390
state</dfn>, initially <span data-x="popover-hidden-state">hidden</span>, with these potential
86362
86391
values:</p>
0 commit comments