Skip to content

Instantly share code, notes, and snippets.

View gterzian's full-sized avatar

Gregory Terzian gterzian

View GitHub Profile
----------------------- MODULE ImageCacheThree -----------------------
EXTENDS FiniteSets, Integers, Sequences
CONSTANT N
VARIABLES image_states, image_queue, keys_used, keys, keys_batch
-----------------------------------------------------------------------------
Image == 1..N
ImageState == {"None", "PendingKey", "HasKey", "Loaded"}
------------------------- MODULE ImageCacheOne -------------------------
EXTENDS FiniteSets, Integers, Sequences
CONSTANT N
VARIABLES image_states, keys_used
-----------------------------------------------------------------------------
Image == 1..N
ImageState == {"None", "Loaded"}
TypeOk == /\ image_states \in [Image -> ImageState]
/\ keys_used \in Int
--------------------------- MODULE ImageCacheTwo ---------------------------
EXTENDS FiniteSets, Integers, Sequences
CONSTANT N
VARIABLES image_states, keys_used, keys
-----------------------------------------------------------------------------
Image == 1..N
ImageState == {"None", "PendingKey", "HasKey", "Loaded"}
@gterzian
gterzian / servo_issues.md
Last active June 11, 2025 11:02
Interesting problems in Servo
-------------------------- MODULE CanvasRendering --------------------------
EXTENDS FiniteSets, Integers, Sequences
VARIABLES images_updated, display_lists_applied,
compositor_messages, canvas_state,
pending_display_list
CONSTANT N
----------------------------------------------------------------------------
Messages == {"DISPLAY_LIST", "UPDATE_IMAGE"}
-------------------------- MODULE CanvasRenderingBlocking --------------------------
EXTENDS FiniteSets, Integers, Sequences
VARIABLES images_updated, display_lists_applied, compositor_messages, canvas_state
CONSTANT N
----------------------------------------------------------------------------
Messages == {"DISPLAY_LIST", "UPDATE_IMAGE"}
CanvasState == {"PENDING", "UPDATED"}
-------------------------- MODULE CanvasRenderingBroken --------------------------
EXTENDS FiniteSets, Integers, Sequences
VARIABLES images_updated, display_lists_applied, compositor_messages
----------------------------------------------------------------------------
Messages == {"DISPLAY_LIST", "UPDATE_IMAGE"}
ReadyToApplyDisplayList == images_updated = display_lists_applied + 1
ImageUpdatedAndDisplayListApplied == images_updated = display_lists_applied

How to work on a Web API

Part 1: Basic Setup of a Web API

  1. Read-up on the relevant spec.
  2. Add .webidl file(s) in this folder for each interface that you want to implement. If one already exists, you want to add the missing parts to it.
  3. For each interface, this will generate a trait named {interface_name}Methods, accessible via use crate::dom::bindings::codegen::Bindings::{interface_name}Binding.
  4. Use this trait by:
    • Adding a matching struct, using #[dom_struct]
  • Adding methods with todo! bodies.
@gterzian
gterzian / servo_script_copilot.md
Last active February 21, 2025 12:03
How to use Copilot

How to work on a Web API with the assistance of Copilot

Part 1: Basic Setup of a Web API

  1. Read-up on the relevant spec.
  2. Add .webidl file(s) in this folder for each interface that you want to implement. If one already exists, you want to add the missing parts to it.
  3. For each interface, this will generate a trait named {interface_name}Methods, accessible via use crate::dom::bindings::codegen::Bindings::{interface_name}Binding.
  4. Use this trait by:
    • Adding a matching struct, using #[dom_struct]
  • Adding methods with todo! bodies.

ServiceWorker implementation items:

Interfaces

Client Context

  • ServiceWorker
  • ServiceWorkerRegistration
  • ServiceWorkerContainer
  • NavigationPreloadManager