[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ASV0GKCGWM1485HK3ZBXCC":3,"skill-same:01M7ASV0GKCGWM1485HK3ZBXCC":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7ASV0GKCGWM1485HK3ZBXCC","browser-rendering-pipeline",null,"Use when working on or debugging how a page gets rendered: the HTML parser that must never fail and the DOM, the CSS cascade, selector matching and why it's backwards, style invalidation as the hard part, the rendering pipeline and its key data structures (DOM → style → layout → paint → composite), the layout algorithms (block, inline, flex, grid), the compositor and the GPU, the JavaScript engine (V8, JavaScriptCore, SpiderMonkey), bindings as the underestimated layer, and the event loop and rendering lifecycle.","the-vibey-project\u002Fvibey","the-vibey-project","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F329298758?v=4","01M7AJHGZ9722CTJ4JNQZVRH0Q","the vibey project","01M7AJHGZVMG2K7TGXQ6XFHVG3",5,"MIT","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fweb-browser-development\u002Fskills\u002Fbrowser-rendering-pipeline\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: browser-rendering-pipeline\ndescription: \"Use when working on or debugging how a page gets rendered: the HTML parser that must never fail and the DOM, the CSS cascade, selector matching and why it's backwards, style invalidation as the hard part, the rendering pipeline and its key data structures (DOM → style → layout → paint → composite), the layout algorithms (block, inline, flex, grid), the compositor and the GPU, the JavaScript engine (V8, JavaScriptCore, SpiderMonkey), bindings as the underestimated layer, and the event loop and rendering lifecycle.\"\n---\n\n# Browser Development: HTML Parsing and the DOM, CSS and Style, Layout, Paint, Compositing, and JavaScript Integration\n\n> **Part 2 of 5** of the *Web Browser Development* reference (plugin `web-browser-development`), covering §4–§7. Sibling skills: `browser-engine-architecture-and-networking` (§0–§3), `browser-security-and-privacy` (§8–§9), `browser-extensions-platform-and-standards` (§10–§14), `browser-development-reference` (§15–§20). Section numbers are shared across the set; a reference written as §N → `skill` points into that sibling skill.\n>\n> **Currency:** Verified August 2026. See §17 → `browser-development-reference` for the currency snapshot and what goes stale first.\n\n> **How to read this.** Reference, not tutorial. Sections are independent. Three markers:\n> - **[DURABLE]** — architecture, algorithms, or a constraint every engine has\n>   independently arrived at. Does not expire.\n> - **[ENGINE]** — specific to Blink\u002FChromium, Gecko, WebKit, or Servo\u002FLadybird. Verify\n>   against that project's source or docs.\n> - **[CONTESTED]** — the vendors genuinely disagree, often because their business models\n>   differ. Both cases given, including the commercial motive where it's load-bearing.\n>\n> **⚠️ GOTCHA** boxes mark the mistakes that produce security holes, jank, or\n> compatibility breakage that can never be undone.\n>\n> **The two framings that organize everything below:**\n> 1. **A browser is a hostile-input execution environment that must never say no.** It\n>    runs untrusted code from anyone, on documents that are frequently malformed, and it\n>    is not permitted to refuse or crash. Every architectural decision — the multi-process\n>    model, the error-tolerant parser, the sandbox — descends from that.\n> 2. **The web's compatibility constraint is stronger than any other platform's.** You\n>    cannot break existing sites. Not the well-written ones, not the abandoned ones. This\n>    is why the platform accretes and rarely subtracts, and why \"just fix it properly\"\n>    is almost never available.\n\n---\n\n## §4. HTML Parsing and the DOM\n\n### 4.1 The parser must never fail\n\n**[DURABLE] The HTML parsing algorithm is fully specified, including error recovery, and\nyou must implement it exactly.** This is unusual and important: HTML is not a grammar you\ncan choose how to recover from. The spec defines a tokenizer state machine plus a tree\nconstruction stage with ~23 \"insertion modes,\" and it defines the correct output for\n*every* malformed input — including the famous **\"adoption agency algorithm\"** for\nmis-nested formatting tags.\n\n**Why it's specified this way**: before HTML5, every engine recovered differently, so\nmalformed pages (which is most pages) rendered differently everywhere. The spec codified\nwhat browsers already did. **Deviating from it is a compatibility bug, not a design\nchoice.**\n\nOther parser realities:\n- **Speculative\u002Fpreload scanning** — while the main parser is blocked on a synchronous\n  script, a second scanner races ahead to find subresources and start fetching them. A\n  large real-world performance win.\n- **`document.write`** — can inject content into the token stream mid-parse. It is the\n  single ugliest constraint on parser architecture and the reason streaming parsers have to\n  be re-entrant.\n- **Scripts block by default**; `async` and `defer` change the ordering guarantees.\n  Getting the ordering exactly right is required for compatibility.\n\n### 4.2 The DOM\n\nA mutable tree with live collections, mutation observers, ranges, and shadow trees.\nImplementation concerns that dominate:\n- **Memory layout and node size** — multiplied by hundreds of thousands of nodes.\n- **Live `NodeList`s and `HTMLCollection`s** — must reflect mutations, which means either\n  recomputing or maintaining invalidation. A classic performance trap for both engine and\n  page author.\n- **Shadow DOM** — encapsulation boundaries that affect selector matching, event\n  retargeting, and style scoping. Each of those is real work.\n- **The JS binding layer** (§7.2) is where a surprising fraction of the complexity lives.\n\n---\n\n## §5. CSS and Style\n\n### 5.1 The cascade\n\n**[DURABLE] Style resolution is: for each element, find every declaration that applies,\nsort by the cascade, and produce a computed value for every property.** The cascade order\n(later wins):\n```\n1. origin & importance   user-agent \u003C user \u003C author \u003C animations\n                         \u003C author !important \u003C user !important \u003C UA !important\n                         \u003C transitions\n2. cascade layers        (@layer — later layers win within the same origin)\n3. specificity           (id, class\u002Fattr\u002Fpseudo-class, type\u002Fpseudo-element)\n4. order of appearance\n```\nThen **inheritance** for inherited properties, then computed → used → actual values.\n\n**⚠️ Specificity is not a single number.** It's a 3-tuple compared lexicographically —\n`(1,0,0)` beats `(0,99,99)`. Implementations that pack it into an integer eventually\noverflow on pathological selectors, and real sites contain pathological selectors.\n\n### 5.2 Selector matching, and why it's backwards\n\n**[DURABLE] Match selectors right-to-left.** Given `div.container > p a`, an engine starts\nat the candidate `a` element and walks *up*, because matching left-to-right would require\ndescending the entire subtree of every `div.container`. This single fact explains most of\nCSS performance advice.\n\nOptimizations every engine implements: **bloom filters** for ancestor checks (cheap\n\"definitely not a match\" rejection), **rule hashing** by rightmost simple selector\n(id\u002Fclass\u002Ftag buckets), **style sharing caches** for elements with identical inputs, and\n**invalidation sets** — precomputed knowledge of which rules could possibly be affected by\na given class\u002Fattribute change, so a `classList.toggle` doesn't restyle the document.\n\n**[ENGINE] Servo's Stylo** — parallel style resolution in Rust — is the notable\narchitectural departure, and it shipped in Firefox. Style is unusually parallelizable\nbecause sibling subtrees are largely independent; layout is much less so.\n\n### 5.3 Invalidation is the hard part\n\n**[DURABLE] Computing style from scratch is easy. Knowing what to recompute when something\nchanges is where engines live or die.** A DOM mutation, a class change, a media-query\nflip, a container resize, or a `:hover` must invalidate the minimum possible set. Getting\nthis wrong shows up as jank, not as incorrect rendering, which makes it hard to test and\neasy to regress.\n\n**Container queries and `:has()` made this dramatically harder** — both create\ndependencies that flow *up* or *sideways* rather than down the tree, breaking the\nassumption that style depends only on ancestors.\n\n---\n\n## §6. Layout, Paint, and Compositing\n\n### 6.1 The rendering pipeline\n\n**[ENGINE — Chromium's RenderingNG names the stages; every engine has equivalents]:**\n```\nANIMATE    mutate computed styles and property trees over time\nSTYLE      apply CSS to the DOM → computed styles\nLAYOUT     compute size and position → the IMMUTABLE FRAGMENT TREE\nPRE-PAINT  compute property trees; invalidate display lists and texture tiles\nSCROLL     update scroll offsets by mutating property trees\nPAINT      compute a DISPLAY LIST describing how to raster\nCOMMIT     copy property trees and display lists to the compositor\nLAYERIZE   group display items into composited layers  (CompositeAfterPaint)\nRASTER     display list → GPU texture tiles\nACTIVATE \u002F AGGREGATE \u002F DRAW   assemble and execute the compositor frame on the GPU\n```\n\n**[DURABLE] The crucial property: stages can be skipped.** Animating `transform` or\n`opacity`, and scrolling, mutate only property trees — so they skip style, layout,\npre-paint, and paint entirely and **run on the compositor thread**, never touching the main\nthread. That is exactly why \"animate transform\u002Fopacity, not width\u002Fheight\u002Ftop\u002Fleft\" is the\nuniversal performance advice, and why an engine's threading architecture is a *developer-\nfacing* fact.\n\n### 6.2 The key data structures\n\n- **Fragment tree** — LayoutNG's output. **Immutable.** The predecessor was a single\n  long-lived mutable tree where each node held both inputs (available size, float\n  positions) and outputs (final geometry), dirtied and re-cleaned in place. Making layout\n  results immutable is what made caching and incremental layout predictable — this is the\n  single most instructive architectural lesson in modern rendering.\n- **Property trees** — separate transform, clip, effect, and scroll hierarchies. They\n  collapse the combinatorial complexity of nested effects into one structure usable at\n  every pipeline stage, and they're what lets the compositor animate without the main\n  thread.\n- **Display lists and paint chunks** — the input to raster and layerization.\n- **Compositor frames** — surfaces, render surfaces, and GPU texture tiles.\n- **Frame trees** — local and remote nodes recording which document is in which renderer\n  process (this is where Site Isolation meets rendering: a cross-site iframe is a *remote*\n  frame, rendered elsewhere and composited in).\n\n### 6.3 Layout algorithms\n\nYou must implement, correctly and interoperably: **block and inline** formatting contexts\n(including floats, margin collapsing, and line breaking — the oldest and gnarliest code in\nany engine), **flexbox**, **grid** (and **subgrid**), **tables** (an algorithm nobody\nenjoys and everybody needs), **positioned layout**, **fragmentation** (multicol, print,\nand page breaking), **writing modes** (vertical text, RTL — and these interact with\neverything), and **text shaping** (HarfBuzz-class complexity: ligatures, bidi per UAX #9,\ngrapheme clusters, font fallback).\n\n> **⚠️ GOTCHA — text is harder than layout.** Font fallback, shaping, bidi, line-breaking\n> per UAX #14, and emoji sequences are collectively a larger correctness surface than the\n> box algorithms, and getting them wrong is immediately visible to users in languages the\n> implementers don't read.\n\n### 6.4 The compositor and the GPU\n\n**[DURABLE] Two threads, and the split is the whole design.** The **main thread** runs\nJS, style, layout, and paint. The **compositor thread** handles scroll, composited\nanimations, and frame submission. If the main thread is blocked for 500 ms, scrolling\nstill works — that is the entire justification for the architecture's complexity.\n\n- **Layerization** — deciding what gets its own texture. Too few layers means repainting on\n  every animation frame; too many exhausts GPU memory. `will-change` is the author-facing\n  hint, and it is routinely abused into the second failure mode.\n- **Raster** — display list → texture tiles, on worker threads or the GPU (Skia; Chromium's\n  newer path via Dawn\u002F**WebGPU**-adjacent infrastructure). Tiling exists so you only raster\n  what's near the viewport.\n- **Frame budget**: **16.6 ms at 60 Hz, 8.3 ms at 120 Hz** — and that's the budget for\n  *everything*, including the compositor's own work.\n- **Checkerboarding** — when the compositor needs content that isn't rastered yet, it\n  shows old content or a blank pattern rather than dropping the frame. Preferring a stale\n  frame to a late frame is the correct trade and worth internalizing.\n- **GPU process isolation** — GPU drivers are large, buggy, vendor-supplied C code.\n  Running them in a separate sandboxed process is standard, and **Chromium is deploying\n  MiracleObject on the GPU main thread specifically targeting up to ~90% of UAF\n  vulnerabilities there**, deliberately trading localized runtime performance for temporal\n  memory safety.\n\n---\n\n## §7. JavaScript Integration\n\n### 7.1 The engine\n\nV8 (Chromium), SpiderMonkey (Gecko, and Servo), JavaScriptCore (WebKit), LibJS (Ladybird).\nAll modern ones are **tiered**: interpreter → baseline JIT → optimizing JIT, with\ntype-feedback-driven speculation, guards, and **deoptimization** back to the interpreter\nwhen a guard fails. **Hidden classes\u002Fshapes plus inline caches** are what make dynamic\nproperty access fast, and are the biggest single idea in dynamic-language performance.\n\n**⚠️ Note the design tension Ladybird surfaces:** it has argued for **no JIT**, on\nsecurity and complexity grounds — JITs are a huge exploit surface and require W^X gymnastics\n— at an obvious performance cost. That's a real, live trade-off, not a settled question,\nand it's the same trade Apple makes by restricting JIT entitlements on iOS.\n\n### 7.2 Bindings — the underestimated layer\n\n**[DURABLE] The DOM is C++; the DOM is also JavaScript objects. Reconciling those two\nobject models is a large, subtle subsystem.** WebIDL defines the interfaces; a code\ngenerator produces the glue. The hard parts:\n- **Cross-heap garbage collection cycles.** A DOM node references a JS event listener which\n  closes over the DOM node. Neither collector alone can see the cycle. Solutions: Blink's\n  **Oilpan** (tracing GC for C++ DOM objects, unified with V8's collector), Gecko's\n  cycle collector. **Getting this wrong means leaking every page the user visits.**\n- **Wrapper lifetime and identity** — the same DOM node must yield the same JS object every\n  time.\n- **Security checks on every cross-origin access** — a `window` reference across origins\n  exposes a tiny allow-list, and every access must be checked.\n- **The cost of crossing the boundary** is real; hot DOM APIs are why engines invest in\n  fast paths.\n\n### 7.3 The event loop and rendering lifecycle\n\n**[DURABLE] Exactly one specification governs when things happen, and page-visible\nbehaviour depends on it:**\n```\nrun a task (one macrotask: event, timer, network callback)\n  → drain the MICROTASK queue completely (promises, MutationObserver)\n    ⚠️ microtasks that enqueue microtasks can starve the loop forever\n→ if it's time to render:\n     run rAF callbacks\n     run ResizeObserver \u002F IntersectionObserver\n     update rendering: style → layout → paint → commit\n→ idle callbacks (requestIdleCallback) if time remains\n```\n**⚠️ Forced synchronous layout (\"layout thrashing\")** — reading a geometry property\n(`offsetHeight`, `getBoundingClientRect`) after a write forces layout *immediately*,\nmid-task. Interleaving reads and writes in a loop turns one layout into N. This is the\nsingle most common page-performance bug, and the engine's only defence is to expose it in\nDevTools.\n\n**Scheduling** is now a first-class engine concern: task prioritization, `scheduler.yield()`,\n`isInputPending`, long-task attribution, and — the metric that made all of this visible —\n**INP** (Interaction to Next Paint), which measures the *full* interaction lifecycle rather\nthan just input delay.\n","# Browser Development: HTML Parsing and the DOM, CSS and Style, Layout, Paint, Compositing, and JavaScript Integration\n\n> **Part 2 of 5** of the *Web Browser Development* reference (plugin `web-browser-development`), covering §4–§7. Sibling skills: `browser-engine-architecture-and-networking` (§0–§3), `browser-security-and-privacy` (§8–§9), `browser-extensions-platform-and-standards` (§10–§14), `browser-development-reference` (§15–§20). Section numbers are shared across the set; a reference written as §N → `skill` points into that sibling skill.\n>\n> **Currency:** Verified August 2026. See §17 → `browser-development-reference` for the currency snapshot and what goes stale first.\n\n> **How to read this.** Reference, not tutorial. Sections are independent. Three markers:\n> - **[DURABLE]** — architecture, algorithms, or a constraint every engine has\n>   independently arrived at. Does not expire.\n> - **[ENGINE]** — specific to Blink\u002FChromium, Gecko, WebKit, or Servo\u002FLadybird. Verify\n>   against that project's source or docs.\n> - **[CONTESTED]** — the vendors genuinely disagree, often because their business models\n>   differ. Both cases given, including the commercial motive where it's load-bearing.\n>\n> **⚠️ GOTCHA** boxes mark the mistakes that produce security holes, jank, or\n> compatibility breakage that can never be undone.\n>\n> **The two framings that organize everything below:**\n> 1. **A browser is a hostile-input execution environment that must never say no.** It\n>    runs untrusted code from anyone, on documents that are frequently malformed, and it\n>    is not permitted to refuse or crash. Every architectural decision — the multi-process\n>    model, the error-tolerant parser, the sandbox — descends from that.\n> 2. **The web's compatibility constraint is stronger than any other platform's.** You\n>    cannot break existing sites. Not the well-written ones, not the abandoned ones. This\n>    is why the platform accretes and rarely subtracts, and why \"just fix it properly\"\n>    is almost never available.\n\n---\n\n## §4. HTML Parsing and the DOM\n\n### 4.1 The parser must never fail\n\n**[DURABLE] The HTML parsing algorithm is fully specified, including error recovery, and\nyou must implement it exactly.** This is unusual and important: HTML is not a grammar you\ncan choose how to recover from. The spec defines a tokenizer state machine plus a tree\nconstruction stage with ~23 \"insertion modes,\" and it defines the correct output for\n*every* malformed input — including the famous **\"adoption agency algorithm\"** for\nmis-nested formatting tags.\n\n**Why it's specified this way**: before HTML5, every engine recovered differently, so\nmalformed pages (which is most pages) rendered differently everywhere. The spec codified\nwhat browsers already did. **Deviating from it is a compatibility bug, not a design\nchoice.**\n\nOther parser realities:\n- **Speculative\u002Fpreload scanning** — while the main parser is blocked on a synchronous\n  script, a second scanner races ahead to find subresources and start fetching them. A\n  large real-world performance win.\n- **`document.write`** — can inject content into the token stream mid-parse. It is the\n  single ugliest constraint on parser architecture and the reason streaming parsers have to\n  be re-entrant.\n- **Scripts block by default**; `async` and `defer` change the ordering guarantees.\n  Getting the ordering exactly right is required for compatibility.\n\n### 4.2 The DOM\n\nA mutable tree with live collections, mutation observers, ranges, and shadow trees.\nImplementation concerns that dominate:\n- **Memory layout and node size** — multiplied by hundreds of thousands of nodes.\n- **Live `NodeList`s and `HTMLCollection`s** — must reflect mutations, which means either\n  recomputing or maintaining invalidation. A classic performance trap for both engine and\n  page author.\n- **Shadow DOM** — encapsulation boundaries that affect selector matching, event\n  retargeting, and style scoping. Each of those is real work.\n- **The JS binding layer** (§7.2) is where a surprising fraction of the complexity lives.\n\n---\n\n## §5. CSS and Style\n\n### 5.1 The cascade\n\n**[DURABLE] Style resolution is: for each element, find every declaration that applies,\nsort by the cascade, and produce a computed value for every property.** The cascade order\n(later wins):\n```\n1. origin & importance   user-agent \u003C user \u003C author \u003C animations\n                         \u003C author !important \u003C user !important \u003C UA !important\n                         \u003C transitions\n2. cascade layers        (@layer — later layers win within the same origin)\n3. specificity           (id, class\u002Fattr\u002Fpseudo-class, type\u002Fpseudo-element)\n4. order of appearance\n```\nThen **inheritance** for inherited properties, then computed → used → actual values.\n\n**⚠️ Specificity is not a single number.** It's a 3-tuple compared lexicographically —\n`(1,0,0)` beats `(0,99,99)`. Implementations that pack it into an integer eventually\noverflow on pathological selectors, and real sites contain pathological selectors.\n\n### 5.2 Selector matching, and why it's backwards\n\n**[DURABLE] Match selectors right-to-left.** Given `div.container > p a`, an engine starts\nat the candidate `a` element and walks *up*, because matching left-to-right would require\ndescending the entire subtree of every `div.container`. This single fact explains most of\nCSS performance advice.\n\nOptimizations every engine implements: **bloom filters** for ancestor checks (cheap\n\"definitely not a match\" rejection), **rule hashing** by rightmost simple selector\n(id\u002Fclass\u002Ftag buckets), **style sharing caches** for elements with identical inputs, and\n**invalidation sets** — precomputed knowledge of which rules could possibly be affected by\na given class\u002Fattribute change, so a `classList.toggle` doesn't restyle the document.\n\n**[ENGINE] Servo's Stylo** — parallel style resolution in Rust — is the notable\narchitectural departure, and it shipped in Firefox. Style is unusually parallelizable\nbecause sibling subtrees are largely independent; layout is much less so.\n\n### 5.3 Invalidation is the hard part\n\n**[DURABLE] Computing style from scratch is easy. Knowing what to recompute when something\nchanges is where engines live or die.** A DOM mutation, a class change, a media-query\nflip, a container resize, or a `:hover` must invalidate the minimum possible set. Getting\nthis wrong shows up as jank, not as incorrect rendering, which makes it hard to test and\neasy to regress.\n\n**Container queries and `:has()` made this dramatically harder** — both create\ndependencies that flow *up* or *sideways* rather than down the tree, breaking the\nassumption that style depends only on ancestors.\n\n---\n\n## §6. Layout, Paint, and Compositing\n\n### 6.1 The rendering pipeline\n\n**[ENGINE — Chromium's RenderingNG names the stages; every engine has equivalents]:**\n```\nANIMATE    mutate computed styles and property trees over time\nSTYLE      apply CSS to the DOM → computed styles\nLAYOUT     compute size and position → the IMMUTABLE FRAGMENT TREE\nPRE-PAINT  compute property trees; invalidate display lists and texture tiles\nSCROLL     update scroll offsets by mutating property trees\nPAINT      compute a DISPLAY LIST describing how to raster\nCOMMIT     copy property trees and display lists to the compositor\nLAYERIZE   group display items into composited layers  (CompositeAfterPaint)\nRASTER     display list → GPU texture tiles\nACTIVATE \u002F AGGREGATE \u002F DRAW   assemble and execute the compositor frame on the GPU\n```\n\n**[DURABLE] The crucial property: stages can be skipped.** Animating `transform` or\n`opacity`, and scrolling, mutate only property trees — so they skip style, layout,\npre-paint, and paint entirely and **run on the compositor thread**, never touching the main\nthread. That is exactly why \"animate transform\u002Fopacity, not width\u002Fheight\u002Ftop\u002Fleft\" is the\nuniversal performance advice, and why an engine's threading architecture is a *developer-\nfacing* fact.\n\n### 6.2 The key data structures\n\n- **Fragment tree** — LayoutNG's output. **Immutable.** The predecessor was a single\n  long-lived mutable tree where each node held both inputs (available size, float\n  positions) and outputs (final geometry), dirtied and re-cleaned in place. Making layout\n  results immutable is what made caching and incremental layout predictable — this is the\n  single most instructive architectural lesson in modern rendering.\n- **Property trees** — separate transform, clip, effect, and scroll hierarchies. They\n  collapse the combinatorial complexity of nested effects into one structure usable at\n  every pipeline stage, and they're what lets the compositor animate without the main\n  thread.\n- **Display lists and paint chunks** — the input to raster and layerization.\n- **Compositor frames** — surfaces, render surfaces, and GPU texture tiles.\n- **Frame trees** — local and remote nodes recording which document is in which renderer\n  process (this is where Site Isolation meets rendering: a cross-site iframe is a *remote*\n  frame, rendered elsewhere and composited in).\n\n### 6.3 Layout algorithms\n\nYou must implement, correctly and interoperably: **block and inline** formatting contexts\n(including floats, margin collapsing, and line breaking — the oldest and gnarliest code in\nany engine), **flexbox**, **grid** (and **subgrid**), **tables** (an algorithm nobody\nenjoys and everybody needs), **positioned layout**, **fragmentation** (multicol, print,\nand page breaking), **writing modes** (vertical text, RTL — and these interact with\neverything), and **text shaping** (HarfBuzz-class complexity: ligatures, bidi per UAX #9,\ngrapheme clusters, font fallback).\n\n> **⚠️ GOTCHA — text is harder than layout.** Font fallback, shaping, bidi, line-breaking\n> per UAX #14, and emoji sequences are collectively a larger correctness surface than the\n> box algorithms, and getting them wrong is immediately visible to users in languages the\n> implementers don't read.\n\n### 6.4 The compositor and the GPU\n\n**[DURABLE] Two threads, and the split is the whole design.** The **main thread** runs\nJS, style, layout, and paint. The **compositor thread** handles scroll, composited\nanimations, and frame submission. If the main thread is blocked for 500 ms, scrolling\nstill works — that is the entire justification for the architecture's complexity.\n\n- **Layerization** — deciding what gets its own texture. Too few layers means repainting on\n  every animation frame; too many exhausts GPU memory. `will-change` is the author-facing\n  hint, and it is routinely abused into the second failure mode.\n- **Raster** — display list → texture tiles, on worker threads or the GPU (Skia; Chromium's\n  newer path via Dawn\u002F**WebGPU**-adjacent infrastructure). Tiling exists so you only raster\n  what's near the viewport.\n- **Frame budget**: **16.6 ms at 60 Hz, 8.3 ms at 120 Hz** — and that's the budget for\n  *everything*, including the compositor's own work.\n- **Checkerboarding** — when the compositor needs content that isn't rastered yet, it\n  shows old content or a blank pattern rather than dropping the frame. Preferring a stale\n  frame to a late frame is the correct trade and worth internalizing.\n- **GPU process isolation** — GPU drivers are large, buggy, vendor-supplied C code.\n  Running them in a separate sandboxed process is standard, and **Chromium is deploying\n  MiracleObject on the GPU main thread specifically targeting up to ~90% of UAF\n  vulnerabilities there**, deliberately trading localized runtime performance for temporal\n  memory safety.\n\n---\n\n## §7. JavaScript Integration\n\n### 7.1 The engine\n\nV8 (Chromium), SpiderMonkey (Gecko, and Servo), JavaScriptCore (WebKit), LibJS (Ladybird).\nAll modern ones are **tiered**: interpreter → baseline JIT → optimizing JIT, with\ntype-feedback-driven speculation, guards, and **deoptimization** back to the interpreter\nwhen a guard fails. **Hidden classes\u002Fshapes plus inline caches** are what make dynamic\nproperty access fast, and are the biggest single idea in dynamic-language performance.\n\n**⚠️ Note the design tension Ladybird surfaces:** it has argued for **no JIT**, on\nsecurity and complexity grounds — JITs are a huge exploit surface and require W^X gymnastics\n— at an obvious performance cost. That's a real, live trade-off, not a settled question,\nand it's the same trade Apple makes by restricting JIT entitlements on iOS.\n\n### 7.2 Bindings — the underestimated layer\n\n**[DURABLE] The DOM is C++; the DOM is also JavaScript objects. Reconciling those two\nobject models is a large, subtle subsystem.** WebIDL defines the interfaces; a code\ngenerator produces the glue. The hard parts:\n- **Cross-heap garbage collection cycles.** A DOM node references a JS event listener which\n  closes over the DOM node. Neither collector alone can see the cycle. Solutions: Blink's\n  **Oilpan** (tracing GC for C++ DOM objects, unified with V8's collector), Gecko's\n  cycle collector. **Getting this wrong means leaking every page the user visits.**\n- **Wrapper lifetime and identity** — the same DOM node must yield the same JS object every\n  time.\n- **Security checks on every cross-origin access** — a `window` reference across origins\n  exposes a tiny allow-list, and every access must be checked.\n- **The cost of crossing the boundary** is real; hot DOM APIs are why engines invest in\n  fast paths.\n\n### 7.3 The event loop and rendering lifecycle\n\n**[DURABLE] Exactly one specification governs when things happen, and page-visible\nbehaviour depends on it:**\n```\nrun a task (one macrotask: event, timer, network callback)\n  → drain the MICROTASK queue completely (promises, MutationObserver)\n    ⚠️ microtasks that enqueue microtasks can starve the loop forever\n→ if it's time to render:\n     run rAF callbacks\n     run ResizeObserver \u002F IntersectionObserver\n     update rendering: style → layout → paint → commit\n→ idle callbacks (requestIdleCallback) if time remains\n```\n**⚠️ Forced synchronous layout (\"layout thrashing\")** — reading a geometry property\n(`offsetHeight`, `getBoundingClientRect`) after a write forces layout *immediately*,\nmid-task. Interleaving reads and writes in a loop turns one layout into N. This is the\nsingle most common page-performance bug, and the engine's only defence is to expose it in\nDevTools.\n\n**Scheduling** is now a first-class engine concern: task prioritization, `scheduler.yield()`,\n`isInputPending`, long-task attribution, and — the metric that made all of this visible —\n**INP** (Interaction to Next Paint), which measures the *full* interaction lifecycle rather\nthan just input delay.\n",{"name":5,"description":7},"develop","ae32736a1aabddabca5d2c96d665aa0ebc7d8700","src\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fweb-browser-development\u002Fskills\u002Fbrowser-rendering-pipeline",3,"https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey","https:\u002F\u002Fthe-vibey-project.github.io\u002Fvibey\u002F","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project","https:\u002F\u002Fvibewithadam.matthewsteinberger.com","freedom for software engineers","2026-11-15 05:47:42",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add the-vibey-project\u002Fvibey --skill browser-rendering-pipeline",{"tool":40,"command":41},"bunx","bunx skills add the-vibey-project\u002Fvibey --skill browser-rendering-pipeline",{"tool":43,"command":44},"pnpm","pnpm dlx skills add the-vibey-project\u002Fvibey --skill browser-rendering-pipeline","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fweb-browser-development\u002Fskills\u002Fbrowser-rendering-pipeline\u002FSKILL.md",true,[],[49,56,63,70,77,84],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M7AT1FQJAE1FQYAMDTF490Y4","white-paper-writing","Use when writing white papers, technical reports, policy documents, thought leadership pieces, or any long-form authoritative document. Triggers on requests to write, structure, outline, or review white papers, technical reports, position papers, policy briefs, or evidence-driven arguments. Also use for B2B content marketing strategy, technical documentation requiring authority, academic-style reports, or any document that must educate while persuading. Use when someone asks \"how should I structure this\" for a long-form document.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fwhite-paper-writing\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7AT16BJRJJKK2MASXRZS76G","prose-technical-mechanics","Use when editing or writing prose at a technical\u002Fmechanical level: choosing between Anglo-Saxon and Latinate diction, placing information in topic vs stress positions, writing periodic vs cumulative sentences, handling sentence rhythm, punctuation as logic, transitions, paragraph structure, or phonesthetics. Use when someone wants to understand WHY prose works or doesn't, not just surface-level style advice. Triggers on word choice, sentence structure, emphasis, rhythm, diction, or any deep writing mechanics question.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fprose-technical-mechanics\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7AT0W9HT0ZZ9Y287NW99MR3","prose-mechanics","Use when writing, editing, or analyzing prose style; when trying to avoid generic AI-sounding writing; when applying specific prose styles such as journalistic, academic, narrative, KJV biblical, Hemingway plain, Latinate\u002FJamesian, Orwellian, Augustan, Victorian, Early Modern (Bacon, Browne, Milton), or free indirect discourse; or when coaching someone on writing voice and mechanics. Triggers on any request to improve, analyze, or write in a specific prose style, to fix \"AI-sounding\" writing, to make prose more vivid or concrete, to vary sentence rhythm, or to understand how a particular writer achieves their effects.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fprose-mechanics\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7AT0KR635JX66X2X6F3E2CP","narrative-structure","Use when structuring stories, pitches, presentations, white papers, or any persuasive narrative; analyzing the hero's journey in fiction or non-fiction; applying StoryBrand for business communication; designing narrative arcs for thought leadership; or understanding Vogler, Snyder, Propp, or Campbell frameworks. Triggers on any narrative structure, storytelling, pitch structure, StoryBrand, hero's journey, three-act structure, Freytag, Save the Cat, narrative arc, or \"how should I structure this story\u002Fpitch\u002Fpresentation\" request.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fnarrative-structure\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7AT0AKGW09NKKZDYBT8VRDE","legal-brief-writing","Use when writing legal briefs, motions, or any court filing; when analyzing judicial cognition and persuasion; when applying elite brief-writing techniques from Roberts, Clement, Kagan, Garner; or when structuring legal arguments for maximum persuasion. Also use for autistic\u002Fneurodivergent advocates who need to understand how their natural communication style maps to elite legal advocacy. Triggers on any legal writing, brief drafting, motion preparation, or legal argument structuring request.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Flegal-brief-writing\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7AT00VWPS4Q8B5VEMXX9NQT","journal-publishability-criteria","Use whenever a research paper, article or preprint is being written, revised, reviewed or published, and specifically before every publication of docs\u002Fpaper.md. Covers what legitimate journals actually gate on, in order of gating — the editor's desk screen (scope, novelty, package problems), what reviewers judge (methodological soundness, claims the evidence can carry, statistical and qualitative reporting), EQUATOR reporting guidelines, the ICMJE authorship criteria, COPE's view of text recycling, the near-universal generative-AI policy (no AI author, disclosure, author responsibility), TOP 2025 transparency standards, how to verify a journal is legitimate, submitting without an institution, and a pre-submission checklist. Triggers on requests to evaluate, review, prepare or submit a paper, to judge publishability, to write a declarations or data-availability section, to disclose AI use, or to check a journal.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fjournal-publishability-criteria\u002FSKILL.md",[],[]]