[NoInterfaceObject]
interface DOMRectUtils {
readonly attribute unrestricted double top;
readonly attribute unrestricted double right;
readonly attribute unrestricted double bottom;
readonly attribute unrestricted double left;
}
// Using ES5 syntax to avoid any confusion. | |
function makeSlots(obj, slotNames) { /* native code */ } | |
function setSlot(obj, name, value) { /* native code */ } | |
function getSlot(obj, name) { /* native code */ } | |
function ensureBranded(obj) { | |
if (getSlot(obj, 'domPointer') !== 'DOM_POINTER_FOR_MY_DOM_POINT') { | |
throw new TypeError('Incompatible method or accessor call: ' + | |
'the this value is not a MyDOMPoint'); |
"use strict"; | |
var http = require("http"); | |
http.createServer(function (req) { | |
console.log(req.headers); | |
}) | |
.listen(1337); | |
http.get('http://localhost:1337'); |
[Constructor(DOMQuadInit quad)]
[Constructor(unrestricted optional double x = 0, unrestricted optional double y = 0,
unrestricted optional double width = 0, unrestricted optional double height = 0)]
interface DOMRectReadOnly {
readonly attribute unrestricted double x;
readonly attribute unrestricted double y;
readonly attribute unrestricted double width;
self.onfetch = ev => { | |
var serverReq = ev.request; | |
var clientReq = new Request(serverReq.url, { | |
method: serverReq.method, | |
headers: serverReq.headers, | |
mode: serverReq.mode, | |
credentials: serverReq.credentials | |
}); | |
serverReq.body.pipeTo(clientReq.body); |
function EventEmitter() { | |
this._eventsMap = Object.create(null); | |
} | |
EventEmitter.prototype.on = function (eventName, handler) { | |
if (!this._eventsMap[eventName]) { | |
this._eventsMap[eventName] = []; | |
} | |
this._eventsMap[eventName].push(handler); |
/** | |
* Turns: { | |
* keyOne: promiseOne, | |
* keyTwo: promiseTwo | |
* } into { | |
* keyOne: resolutionOne, | |
* keyTwo: resolutionTwo | |
* } | |
* | |
* (To avoid messing around with unclear array indices when calling different |
This document contains my personal summary of how ARIA and HTML interact. It might be useful background reading.
ARIA lets you set three things on an element: roles, states, or properties. States and properties are only conceptually different so we can discuss them together as stoperties for conciseness. (ARIA uses the term "attributes" but there are already several uses of that word floating around so we don't continue that practice in this document.) An element's role is a string and an element's stoperties are given by a string-to-string map.
Like many features of elements, elements maintain their "true" role and stoperties as internal state. There are also HTML attributes which can affect these. For example, <hr>
will have role separator
, even though it has no role=""
attribute.
In what follows, let el.[[role]]
and el.[[aria-expanded]]
and the like be a fictional syntax for getting the true, screen-reader exposed ARIA values for an element. Let "no role" manifest as null
in JavaScript.
These code samples are meant to show how ARIA roles manifest themselves, both in an author-exposed way via attributes, and to screen-readers via the .[[true-values]]
. Seeing how these two interact is fairly enlightening.