@@ -2706,54 +2706,40 @@ Script-based Custom Media Queries</h3>
2706
2706
██ ██ ██ ██ ██ ██ ██ ██ ██ ██
2707
2707
██████ ██████ ██████ ███████ ██ ██
2708
2708
-->
2709
- <!--
2709
+
2710
2710
<h2 id='custom-mq-cssom'>
2711
2711
CSSOM</h2>
2712
2712
2713
- The <a interface>CSSRule</a> interface is extended as follows:
2714
-
2715
- <pre class="idl partial">
2716
- partial interface CSSRule {
2717
- const unsigned short CUSTOM_MEDIA_RULE = 17;
2718
- };
2719
- </pre>
2720
-
2721
- The <a interface>CSSCustomMediaRule</a> interface represents a ''@custom-media'' rule.
2722
-
2723
- <pre class="idl">
2724
- [Exposed=Window]
2725
- interface CSSCustomMediaRule : CSSRule {
2726
- attribute CSSOMString name;
2727
- [SameObject, PutForwards=mediaText] readonly attribute MediaList media;
2728
- };
2729
- </pre>
2730
-
2731
- <dl dfn-type=attribute dfn-for=CSSCustomMediaRule>
2732
- <dt> <dfn>name</dfn> , of type <code> CSSOMString</code>
2733
- <dd>
2734
- The <a attribute>name</a> attribute on getting must return a <code> CSSOMString</code> object
2735
- that contains the serialization of the <<extension-name>> defined for the associated rule.
2736
-
2737
- On setting the <a attribute>name</a> attribute,
2738
- run the following steps:
2713
+ The {{CSSCustomMediaRule}} interface represents a ''@custom-media'' rule.
2739
2714
2740
- <ol >
2741
- <li> <a>Parse a component value</a> from the value.
2715
+ <pre class="idl" export >
2716
+ typedef (MediaList or boolean) CustomMediaQuery;
2742
2717
2743
- <li>
2744
- If the returned value is an <<extension-name>> ,
2745
- replace the associated rule's name with the <<extension-name>> 's representation.
2718
+ [Exposed=Window, RuntimeEnabled=CSSCustomMedia]
2719
+ interface CSSCustomMediaRule : CSSRule {
2720
+ readonly attribute CSSOMString name;
2721
+ readonly attribute CustomMediaQuery query;
2722
+ };
2723
+ </pre>
2746
2724
2747
- <li>
2748
- Otherwise, do nothing.
2749
- </ol>
2725
+ <dl dfn-type=attribute dfn-for=CSSCustomMediaRule>
2726
+ <dt> <dfn>name</dfn>
2727
+ <dd>
2728
+ Returns a CSSOMString representing the <<extension-name>> of the ''@custom-media'' rule.
2750
2729
2751
- <dt> <dfn>media</dfn> , of type <a interface>MediaList</a> , readonly
2752
- <dd>
2753
- The <a attribute>media</a> attribute must return a <a interface>MediaList</a> object
2754
- for the <<media-query-list>> specified with the associated rule.
2755
- </dl>
2756
- -->
2730
+ <dt> <dfn>query</dfn>
2731
+ <dd>
2732
+ Represents the value of the <a>custom media query</a> .
2733
+ The returned {{CustomMediaQuery}} will be one of the following:
2734
+ <ul>
2735
+ <li> A {{MediaList}} object,
2736
+ if the rule was defined with a <<media-query-list>> .
2737
+ <li> The boolean true,
2738
+ if the rule was defined with the value <a value for="@custom-media">true</a> .
2739
+ <li> The boolean false,
2740
+ if the rule was defined with the value <a value for="@custom-media">false</a> .
2741
+ </ul>
2742
+ </dl>
2757
2743
2758
2744
<!--
2759
2745
██ ██ ██████ ████████ ████████ ████████ ████████ ████████ ████████ ██████
0 commit comments