Skip to content

Instantly share code, notes, and snippets.

View sliminality's full-sized avatar

Slim sliminality

View GitHub Profile
@paulirish
paulirish / what-forces-layout.md
Last active November 21, 2025 16:16
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@jfdm
jfdm / sodium-documented.h
Last active March 18, 2021 19:45
A well documented version of libNaCl and libSodium's ABI.
/** \mainpage
*
* __NaCl__ (pronounced _salt_) is a new easy-to-use high-speed
* software library for network communication, encryption, decryption,
* signatures, etc. NaCl's goal is to provide all of the core
* operations needed to build higher-level cryptographic tools.
*
* __Sodium__ is a portable, cross-compilable, installable,
* packageable, API-compatible version of NaCl.
*