Skip to content

Instantly share code, notes, and snippets.

View annevk's full-sized avatar

Anne van Kesteren annevk

View GitHub Profile
@annevk
annevk / gist:6174119
Created August 7, 2013 13:38
zip URLs

Overview

There's an idea floating around of introducing a zip URL for resources. The general structure would be:

zip:{URL-to-zip}!{relative-URL-inside-zip}

Lack of ! is a parsing failure.

The zip URL works by (URL) parsing everything between zip: and ! against a base URL (if any).

  1. Let first1024Bytes be null.

  2. In parallel:

    1. Let bytes be the empty byte sequence.

    2. Let transformStream be a new TransformStream.

    3. Let transformAlgorithm given a chunk be these steps:

@annevk
annevk / gist:5496188
Created May 1, 2013 16:00
bz describing fetching in Gecko.
[12:47] <annevk> bz: So now I've got http://fetch.spec.whatwg.org/#requests as architecture for fetching, mostly based on Hixie's work in HTML and my work in CORS. However, I've gotten the impression that browsers have a slightly different architecture. One that involves at least a global object of sorts.
[12:48] <annevk> bz: I'm wondering if I should attempt to reconcile the two. E.g. once a global object dies (removal of an <iframe>) we might want to kill all associated fetches as happens now.
[12:52] <annevk> The global object (or browsing context or whatever we use) can also be used to find out some information, such as the origin, CSP policy, and maybe referrer?
[13:45] <bz> annevk: good morning
[13:45] * bz reads up
[13:45] <annevk> bz: good afternoon ;)
[13:48] <bz> hmm
[13:48] <bz> So I can describe the setup in Gecko if you want
[13:48] <bz> Note that I'm not sure it's a great setup
[13:48] <bz> In fact, it has some crappy bits. ;)
@annevk
annevk / TransparentContainer.md
Last active December 18, 2019 01:30
TransparentContainer nodes

A TransparentContainer node is an object intended to be used as a primitive in templating systems. It's effectively a DocumentFragment node that is not "unwrapped" upon insertion. TransparentContainer nodes can be arbitrarily nested.

Selector matching and rendering will act as if any TransparentContainer nodes in the node tree are replaced by their contents.

Hierarchy restrictions placed upon nodes will need to apply to the children of TransparentContainer nodes as if the TransparentContainer node was not there. We can simplify these requirements somewhat by only allowing TransparentContainer nodes as descendants of the root element.

[Constructor,
 Exposed=Window]
interface TransparentContainer : Node {
@annevk
annevk / HSTS
Created September 14, 2014 17:35
Header set Strict-Transport-Security "max-age=31415926; includeSubDomains" env=HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
@annevk
annevk / problem.md
Created July 28, 2017 09:29
Globals for promises, streams, exceptions, and objects in general

Due to unfortunate legacy reasons the HTML Standard had to define a rather complicated global setup. There's not just "the current global" (ECMAScript's current realm), but also entry and incumbent.

Which globals entry and incumbent are is not always well-defined:

There's also a more general issue with which global to use for objects in IDL and which global to use for report the exception.

Solving these problems requires a bunch of investigative testing, recommendations for changes to browsers (and corresponding bugs being filed), and recommendations for changes to standa

@annevk
annevk / problem.md
Last active July 27, 2017 15:02
Navigation in HTML

The HTML Standard defines a navigate algorithm that is frought with interoperability issues. There are various endpoints that end up triggering it:

  • <iframe>
  • <a>
  • <form>
  • location.href
  • window.open()
  • ...

Although the algorithm is based on reverse engineering browsers, the browser landscape has changed and not all choices made were necessarily optimal for the current environment. Furthermore, browsers have not actively aligned with the standard and things have drifted. In order to do better we need to study the algorithm again and:

@annevk
annevk / problemstatement.md
Created July 26, 2017 09:40
ECMAScript agent tests

ECMAScript has a concept of agents. Browsers support multiple agents (see the HTML Standard):

  • Similar-origin window agent
  • Dedicated worker agent
  • Shared worker agent
  • Service worker agent
  • Worklet agent (this might actually end up being several more, but is not really part of the scope for now as worklets haven't shipped yet)

TC39 maintains a test suite, but this is only run in a single browser agent I'm told, the similar-origin window agent. That means it's highly likely that SharedArrayBuffer objects are poorly tested. It also means that we don't know for sure that all features ECMAScript defines work in each agent. And while there's unlikely to be differences, it would be good to verify that assumption. Goals:

@annevk
annevk / formatting.md
Last active April 15, 2016 08:45
Formatting conventions for standards

Use a column width of 100 characters.

Do not use newlines inside "inline" elements, even if that means exceeding the column width requirement.

<p>The
<dfn method for=DOMTokenList lt=remove(tokens)|remove()><code>remove(<var>tokens</var>&hellip;)</code></dfn>
method, when invoked, must run these steps:

is okay and

@annevk
annevk / gist:6609620
Created September 18, 2013 14:05
Stream sketch.
class Stream {
Promise<StreamItem> read();
}
class StreamItem {
any attribute value;
boolean attribute done;
}
class ByteStreamItem extends StreamItem {