Skip to content

Instantly share code, notes, and snippets.

View bfgeek's full-sized avatar

Ian Kilpatrick bfgeek

View GitHub Profile
@bfgeek
bfgeek / css-ui-nav.js
Last active May 23, 2016 17:13
css-ui nav
window.addEventListener("keydown", (evt) => {
let prop = '--nav-';
switch (evt.key) {
case "ArrowDown":
prop += 'down';
break;
case "ArrowUp":
prop += 'up';
break;
case "ArrowLeft":
// Main thread.
window.compositorWorklet.import('parallax.js').then(function() {
// Library ready to use.
// This creates an instance of the CompositorAnimator class inside
// the worklet that we can communicate to.
const animator = new CompositorAnimator('parallax', {rate: 0.5});
// Can postMessage directly to that instance.
@bfgeek
bfgeek / CanvasRenderingContext2D.idl
Last active November 30, 2015 22:34
CanvasRenderingContext2D.idl
typedef (HTMLImageElement or
HTMLVideoElement or
HTMLCanvasElement) CanvasImageSource;
interface CanvasRenderingContext2D {
// back-reference to the canvas
readonly attribute HTMLCanvasElement canvas;
void drawFocusIfNeeded(Element element);
<!doctype html>
<html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>CSS Script API Level 1</title>

Properties of Custom Layout

Similar to Custom Paint, we wanted to capture some of the properties of a Custom Layout API to agree on goals before heading into implementation details.

Note: "Custom Layout" is used here for both Line & Box Layout.

Anything we should change, remove, or add?

Required Properties of Custom Layout

Properties of Custom Paint

We wanted to capture a solid notion of the required and desirable properties of a Custom Paint API, so we can agree on goals before descending into API or implementation details.

So here’s our list :) Anything we should change, remove, or add?

Required Properties of Custom Paint

Custom Paint code happens explicitly after layout