Skip to content

Instantly share code, notes, and snippets.


Elliott Sprehn esprehn

View GitHub Profile
View test.html
<!doctype html>
function a() {
return new Promise((resolve, reject) => {
setTimeout(() => reject(new Error('test')), 100);
function b() {
return new Promise((resolve, reject) => {
setTimeout(() => resolve(), 100);
esprehn / text.js
Created Aug 30, 2017
spreading the woes
View text.js
// VM2014:1 Uncaught TypeError: Cannot read property 'Symbol(Symbol.iterator)' of null
// at <anonymous>:1:5
// VM2026:1 Uncaught TypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined
// at <anonymous>:1:5
// {}
esprehn / caret.html
Created Mar 23, 2017
Blinking caret that sleeps the main thread for 500ms
View caret.html
<!DOCTYPE html>
#caret {
height: 16px;
width: 1px;
background: black;
will-change: opacity;
opacity: 1;
transition: opacity;
View gist:754787730025ea329559c7e5abbe7b1b
../../third_party/WebKit/Source/wtf/text/StringConcatenate.h:272:42: error: no matching constructor for initialization of 'StringTypeAdapter<const char *const>'
StringTypeAdapter<const StringType1> adapter1(string1);
^ ~~~~~~~
../../third_party/WebKit/Source/wtf/text/StringOperators.h:40:23: note: in instantiation of function template specialization 'WTF::makeString<const char *, WTF::String>' requested here
return String(makeString(m_string1, m_string2));
../../third_party/WebKit/Source/core/clipboard/DataTransferItemList.cpp:82:61: note: in instantiation of member function 'WTF::StringAppend<const char *, const WTF::String>::operator String' requested here
exceptionState.throwDOMException(NotSupportedError, "An item already exists for type '" + type + "'.");
../../third_party/WebKit/Source/wtf/text/StringConcatenate.h:47:7: note: candidate constructor (the
esprehn / pseudos.js
Last active Sep 1, 2016
Find all the pseudos
View pseudos.js
(function() {
var selectors = new Map();
for (let sheet of Array.from(document.styleSheets)) {
for (let rule of Array.from(sheet.cssRules || [])) {
var text = rule.selectorText || "";
for (let match of (text.match(/\:([a-zA-Z0-9\-]+)/g) || []))
selectors.set(match, (selectors.get(match) || 0) + 1);
return [
View CSS Houdini May 9th 2016.txt
Clockwise from the podium:
Peter Linss
Rossen (Microsoft)
Brad Kemper
Andre Ribkey
Elika (fantasai)
View gist:718242dbcae337d8c67d
<!DOCTYPE html>
<template id="template">
:host { color: red; display: block; }
View fake_vs_real.html
<!DOCTYPE html>
<template id="template">
:host { color: red; display: block; }
View gist:c6a8b9b7898ef72ada82
DocumentStyleSheetCollection::updateActiveStyleSheets mode=0 type=0 full=1
#0 0x7fc54872a153 base::debug::StackTrace::StackTrace()
#1 0x7fc53e16eb10 blink::DocumentStyleSheetCollection::updateActiveStyleSheets()
#2 0x7fc53e1c4b09 blink::StyleEngine::updateActiveStyleSheets()
#3 0x7fc53e080d8d blink::Page::settingsChanged()
#4 0x7fc5476af266 blink::WebSettingsImpl::setStandardFontFamily()
#5 0x7fc5464f3cd7 content::RenderView::ApplyWebPreferences()
#6 0x7fc5464f2458 content::RenderViewImpl::Initialize()
#7 0x7fc5464f4917 content::RenderViewImpl::Create()
esprehn / Sheet API.idl
Created Feb 18, 2016
CSSStyleSheet API
View Sheet API.idl
dictionary CSSStyleSheetInit {
// TODO: Should also take a MediaList, but those have no constructor. When
// it does take those, it should make a copy so mutations to the list don't
// impact the sheet. This is for v2 of the API.
DOMString media = "";
DOMString title = "";
boolean alternate = false;
boolean disabled = false;