Skip to content

Commit

Permalink
Use Web IDL's new-ish interface mixins concept
Browse files Browse the repository at this point in the history
WebIDL recently introduced dedicated syntax for mixins [1]. This
replaces the existing [NoInterfaceObject] and "implements" syntax with
"interface mixin" and "includes" in the appropriate places.

This fixes #1931, #1932 issues.

[1] whatwg/webidl@45e8173
  • Loading branch information
romandev authored and tabatkins committed Mar 15, 2018
1 parent ce8e44b commit 91aca93
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
14 changes: 5 additions & 9 deletions cssom-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1200,9 +1200,7 @@ The <dfn>associated CSS style sheet</dfn> of a node is the <a>CSS style sheet</a
interface.

<pre class=idl>
[Exposed=Window,
NoInterfaceObject]
interface LinkStyle {
interface mixin LinkStyle {
readonly attribute StyleSheet? sheet;
};
</pre>
Expand Down Expand Up @@ -1247,7 +1245,7 @@ must also define when a <a>CSS style sheet</a> is

<!-- XXX load/error events -->

<pre class="idl">ProcessingInstruction implements LinkStyle;</pre>
<pre class="idl">ProcessingInstruction includes LinkStyle;</pre>

The <dfn>prolog</dfn> refers to <a>nodes</a> that are children of the
<a>document</a> and are not <a>following</a> the
Expand Down Expand Up @@ -2718,9 +2716,7 @@ The {{ElementCSSInlineStyle}} Interface {#the-elementcssinlinestyle-interface}
The <code>ElementCSSInlineStyle</code> interface provides access to inline style properties of an element.

<pre class=idl>
[Exposed=Window,
NoInterfaceObject]
interface ElementCSSInlineStyle {
interface mixin ElementCSSInlineStyle {
[SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
};
</pre>
Expand All @@ -2732,13 +2728,13 @@ whose <a for="CSSStyleDeclaration">owner node</a> is the <a>context object</a>.
If the user agent supports HTML, the following IDL applies: [[HTML]]

<pre class=idl>
HTMLElement implements ElementCSSInlineStyle;
HTMLElement includes ElementCSSInlineStyle;
</pre>

If the user agent supports SVG, the following IDL applies: [[SVG11]]

<pre class=idl>
SVGElement implements ElementCSSInlineStyle;
SVGElement includes ElementCSSInlineStyle;
</pre>


Expand Down
12 changes: 5 additions & 7 deletions cssom-view-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1592,19 +1592,17 @@ dictionary ConvertCoordinateOptions {
CSSBoxType toBox = "border";
};

[Exposed=Window,
NoInterfaceObject]
interface GeometryUtils {
interface mixin GeometryUtils {
sequence&lt;DOMQuad> getBoxQuads(optional BoxQuadOptions options);
DOMQuad convertQuadFromNode(DOMQuadInit quad, GeometryNode from, optional ConvertCoordinateOptions options);
DOMQuad convertRectFromNode(DOMRectReadOnly rect, GeometryNode from, optional ConvertCoordinateOptions options);
DOMPoint convertPointFromNode(DOMPointInit point, GeometryNode from, optional ConvertCoordinateOptions options); // XXX z,w turns into 0
};

Text implements GeometryUtils; // like Range
Element implements GeometryUtils;
CSSPseudoElement implements GeometryUtils;
Document implements GeometryUtils;
Text includes GeometryUtils; // like Range
Element includes GeometryUtils;
CSSPseudoElement includes GeometryUtils;
Document includes GeometryUtils;

typedef (Text or Element or CSSPseudoElement or Document) GeometryNode;
</pre>
Expand Down

0 comments on commit 91aca93

Please sign in to comment.