Skip to content

WebIDL Guide

Marcos Cáceres edited this page Aug 10, 2016 · 20 revisions

To specify an interface using WebIDL, first write your WebIDL in a <pre class="idl"> block.

For example:

<pre class="idl">
[Constructor]
interface Request {
  readonly attribute ByteString method;
  readonly attribute USVString url;
};
</pre>

Defining the interface

There are two ways to define an interface.

  1. Use a <dfn> element directly.
  2. Use the data-dfn-for attribute on a parent element.

Interface: simple definition and linking

Given interface Request {};, you can define the interface like so:

<section>
  <h2>The <code>Request</code> interface</h2>
  <pre class=idl>
    interface Request {};
  </pre>
  <p>The <dfn>Request</dfn> interface represents a request.</p>
  <p>An instance of <a>Request</a> allows you to make a request.</a>
</section>

Methods and attributes

To

Guides

Configuration options

W3C Configuration options

Linter rules

Internal properties

Handled by ReSpec for you.

Special <section> IDs

HTML elements

Custom Elements

WebIDL

HTML attributes

CSS Classes

Special properties

Clone this wiki locally