Skip to content

v0.2.8

Latest

Choose a tag to compare

@brainkim brainkim released this 02 Dec 02:34

0.2.8 fixes layout and paint bugs found on real sites, bounds what untrusted input can cost, and adds radial gradients and more of the terminal for programs in a pty embed.

Security

  • A clipboard reply is no longer typed as keystrokes. A reply to a clipboard read that came late and in pieces, as it does from a terminal that asks the user first, or one past 64K, was read as typing into whatever had focus. Such a reply is now discarded to its end.
  • Malformed input from the terminal can no longer crash or stall the process. This matters most for a program served over SSH, where every session shares one process. A key code past Unicode's range threw and ended the process, and 64K of unterminated escape strings took seven seconds to read. A cursor row or cell size no terminal could report is ignored.
  • A page's <meta> Content Security Policy now applies inside its frames. An image the policy blocked still loaded from an <iframe srcdoc>. A frame's document inherits the policies of every document it is shown in.
  • An object-src that matches nothing forbids a pty embed, as 'none' does. With no sources listed, the embed's program ran. The guides now say ptyEmbeds is for markup you trust, as scripting is.
  • Untrusted markup and images cost less to show:
    • A GIF with an invalid code no longer hangs the process.
    • A selector one compound longer than the tree is deep took time that doubled with each level. Functional pseudo-classes now nest 64 deep at most.
    • Declarative shadow trees count toward the parser's depth limit, which they escaped, and a chain of custom properties ends at 256.
    • Images hold at most a gigabyte of full-size pixels between them, past which the oldest draw from their reduced copy. Four 64-byte BMPs could hold that much.
  • A program in a pty embed is held to what the emulator can keep: image placements, image bytes, PNG decode time, the characters in one cell and how far a repeat goes are all bounded.

Added

  • Programs in a pty embed get the clipboard, the cursor's color, the cell's size and grapheme clusters. OSC 52 writes and reads the page's terminal clipboard while the page is visible, OSC 12 and 112 set and reset the cursor's color, CSI 14 t and 16 t report the screen and cell in pixels, CSI 22 t and 23 t push and pop the title, and mode 2027 makes a cluster as wide as the page measures it.
  • radial-gradient() and repeating-radial-gradient(). A gradient that fades to transparent now blends with what is under it, or with the terminal's background, instead of cutting off at half opacity. Canvas as a stop is the terminal's background.

Fixed

  • Leaving fullscreen on kitty put the shell's prompt on the bottom row. Thanks to @Trippnology for the report and diagnosis (#212).
  • :host in ShadowRoot.querySelector() and querySelectorAll(), and in matches() and closest(), now matches. Thanks to @draarivpatel-ui (#208).
  • A positioned box's size no longer depends on where it is put. An absolute box half a row down could be a row shorter, so a dialog that centres itself from its own height, as Substack's does, never settled.
  • A positioned child of a fixed bar with a z-index slid down the page as it scrolled.
  • performance.measure() takes a navigation timing name such as navigationStart in place of a mark, as Next.js passes. It threw.
  • An inline-flex box holding only inline content lays it out as flex items. Its text ran past the box.
  • An outline no longer erases the border of another box it passes over.
  • Borders join only within one layer. A sticky header's rule grew a tee wherever a border scrolled under it.
  • A contenteditable that starts with blank lines puts the caret on the first one when it takes focus.
  • A Node executable finds the node-pty shipped beside it. A program bundled to CommonJS, as a Node single executable is, looked for node-pty in the directory it was started from rather than beside itself, so its pty embeds did not work. The ES module build is not affected.

Changed

  • An iframe in a document with no window has no document of its own. contentDocument and contentWindow are null until the iframe is in a document that has one.

These notes were generated with Claude Code.