Skip to content

Instantly share code, notes, and snippets.

View marcoscaceres's full-sized avatar
🏠
Working from home

Marcos Cáceres marcoscaceres

🏠
Working from home
View GitHub Profile
@domenic
domenic / Elements.js
Last active December 18, 2015 23:49
class Elements extends Array
import { absolutizeRelativeSelectorList } from "http://dev.w3.org/csswg/selectors/#absolutizing";
// Assume JSIDL conversions have been applied already,
// i.e. we don't do `selectors = String(selectors)` manually.
class Elements extends Array {
query(selectors) {
return this.queryAll(selectors)[0]; // highly inefficient obviously, but clear semantics
}
queryAll(selectors) {