[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"docs:adr\u002F0002-rust-and-fragmentation-in-layout":3},{"versions":4,"version":13,"nav":16,"path":72,"page":80},[5,10],{"name":6,"label":7,"prefix":8,"channel":9},"0.1","0.1.0 (latest)","","latest",{"name":11,"label":12,"prefix":11,"channel":11},"next","next (main)",{"name":6,"label":7,"prefix":8,"channel":9,"base":14,"ref":15},"\u002Fdocs","v0.1.0",[17,21,24,27,30,33,36,39,43,46,49,52,55,58,61,65,68,71,74,77],{"slug":18,"title":19,"group":20},"index","Overview","Guide",{"slug":22,"title":23,"group":20},"getting-started","Getting started",{"slug":25,"title":26,"group":20},"php","PHP API",{"slug":28,"title":29,"group":20},"laravel","Laravel",{"slug":31,"title":32,"group":20},"resources","Resources",{"slug":34,"title":35,"group":20},"deployment","Deployment",{"slug":37,"title":38,"group":20},"troubleshooting","Troubleshooting",{"slug":40,"title":41,"group":42},"css","CSS reference","Reference",{"slug":44,"title":45,"group":42},"paged-media","Paged media",{"slug":47,"title":48,"group":42},"fonts","Fonts",{"slug":50,"title":51,"group":42},"extensions","Extensions",{"slug":53,"title":54,"group":42},"pdf","The PDF",{"slug":56,"title":57,"group":42},"cli","Command line",{"slug":59,"title":60,"group":42},"rust","Rust library",{"slug":62,"title":63,"group":64},"protocol","Worker protocol","Internals",{"slug":66,"title":67,"group":64},"releasing","Releasing",{"slug":69,"title":70,"group":64},"adr\u002F0001-record-architecture-decisions","1. Record architecture decisions",{"slug":72,"title":73,"group":64},"adr\u002F0002-rust-and-fragmentation-in-layout","2. Rust core with fragmentation inside layout",{"slug":75,"title":76,"group":64},"adr\u002F0003-css-parsing-and-own-selector-matching","3. lightningcss for parsing, own selector matching and cascade",{"slug":78,"title":79,"group":64},"adr\u002F0004-extensions-only-where-css-has-no-way","4. Extensions only where CSS has no way",{"title":73,"seoTitle":81,"seoDescription":82,"html":83,"headings":84,"editUrl":95,"sourceUrl":96,"markdownUrl":97,"prev":98,"next":99},"2. Rust core with fragmentation inside layout · Fagus docs","Measurements on 2026-11-01 (see bench\u002FREADME.md) compared PlutoBook (C++), fulgur, fullbleed and ironpress (Rust), mPDF (PHP) and Chrome.","\u003Ch1 id=\"2-rust-core-with-fragmentation-inside-layout\">2. Rust core with fragmentation inside layout\u003C\u002Fh1>\n\u003Cul>\n\u003Cli>Status: accepted\u003C\u002Fli>\n\u003Cli>Date: 2026-11-02\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"context\">Context\u003Ca class=\"f-doc-anchor\" href=\"#context\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Measurements on 2026-11-01 (see \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fnforst\u002Ffagus\u002Fblob\u002Fv0.1.0\u002Fbench\u002FREADME.md#results-of-2026-11-01\">bench\u002FREADME.md\u003C\u002Fa>) compared PlutoBook (C++), fulgur, fullbleed and ironpress (Rust), mPDF (PHP) and Chrome. PlutoBook was the fastest by far on multi-page documents (about 3 ms per page) because it breaks pages while laying out. Engines that split pages after layout or re-run layout per page were 5 to 50 times slower per page and got page breaks wrong (no repeated table headers).\u003C\u002Fp>\n\u003Ch2 id=\"decision\">Decision\u003Ca class=\"f-doc-anchor\" href=\"#decision\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>The engine is written in Rust: memory safety for untrusted templates, C++-level speed, a single static binary.\u003C\u002Fli>\n\u003Cli>Every layout algorithm takes an optional break token and returns a fragment plus an optional break token for the next fragmentainer (page or column), following Chromium's LayoutNG.\u003C\u002Fli>\n\u003Cli>Lengths inside layout are integers in 1\u002F64 px.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"consequences\">Consequences\u003Ca class=\"f-doc-anchor\" href=\"#consequences\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Flexbox, grid and tables break across pages with the same mechanism. Repeated table headers reuse fragments. Page counters (&quot;page X of Y&quot;) are placed after pagination without a second layout pass.\u003C\u002Fp>\n",[85,89,92],{"id":86,"text":87,"level":88},"context","Context",2,{"id":90,"text":91,"level":88},"decision","Decision",{"id":93,"text":94,"level":88},"consequences","Consequences","https:\u002F\u002Fgithub.com\u002Fnforst\u002Ffagus\u002Fedit\u002Fmain\u002Fdocs\u002Fadr\u002F0002-rust-and-fragmentation-in-layout.md","https:\u002F\u002Fgithub.com\u002Fnforst\u002Ffagus\u002Fblob\u002Fv0.1.0\u002Fdocs\u002Fadr\u002F0002-rust-and-fragmentation-in-layout.md","\u002Fdocs\u002Fadr\u002F0002-rust-and-fragmentation-in-layout.md",{"slug":69,"title":70},{"slug":75,"title":76}]