🛸 Sync 2026-08-05 08:32:18

This commit is contained in:
github-actions[bot] committed 2026-08-05 08:32:18 +08:00
1 parent 3b5b6ffcb7
commit cf2d942509
6 files changed
+47 -25

No files matched your search

@@ -303,8 +303,10 @@ function colorAxis(key, attr, hueProp, colorProp) {
* EXPLICITLY — including the default, so it overrides a router default (see the header; lsDel would
* mean "inherit") — and remove the property AT the default, so 02-tokens' own value shows through.
* They differ ONLY in how the number formats onto the property (px vs a 0..2 multiplier), so that is
* the one argument that varies. The sd() field name is passed in explicitly: unlike enum/hue it is
* NOT the key minus 'fs-' ('fs-radius' -> rounding, 'fs-tint-strength' -> tint_strength). */
* the one argument that varies. The sd() field name is passed in explicitly because ONE instance
* needs a RENAME rather than a spelling: 'fs-radius' -> rounding. The other four would fall out of
* the same hyphen fold enumAxis and colorAxis do ('fs-tint-strength' -> tint_strength), but a
* factory that is right for four keys out of five is the trap those two walked into. */
function propAxis(key, sdKey, prop, min, max, dfl, fmt) {
const inRange = (n) => (typeof n === 'number' && n >= min && n <= max);
const def = () => { const d = sd(sdKey); return inRange(d) ? d : dfl; };
@@ -518,12 +518,18 @@ function silence(el) {
*
* A foreign sheet is injected by ONE page and has no business painting any other. Before this, an
* invasive sheet made the whole document spent (documentPoisoned) and the SPA fell back to a full
* load on the way OUT — correct, but stock LuCI pays it: `view/status/cpu.js` and its four realtime
* siblings each `document.head.append(E('style', …))` at MODULE EVAL, and that style carries
* `svg text { fill: #eee; font-size: 9pt }` — real properties on a bare selector, so invasive by the
* only definition that catches `[class] { padding: 0 !important }`. Measured on the router: 37 of 38
* pages navigated in-place instead of 38, `status/realtime/load` 15 ms -> 157 ms, and the whole
* realtime family 2-10x slower.
* load on the way OUT — correct, and paid by ORDINARY pages: `luci-app-filemanager`, a stock app,
* calls its `insertCss()` at MODULE EVAL and lands two <style>s in <head> (its own rules plus the
* HexEditor's), and `luci-app-ssclash` adds four more as the Ace editor initialises. Both carry
* real properties on bare selectors (`.hexview:focus`, `.ace_gutter`), which is invasive by the
* only definition that also catches `[class] { padding: 0 !important }`.
*
* Measured on owrt2512, 25.12.4, with ownership taken out of documentPoisoned() and put back:
* leaving either page is a FULL LOAD, 5 runs of 5, and with ownership all 5 are in place —
* medians 24 ms (filemanager) and 27 ms (ssclash). The control is a page that injects nothing
* (System -> General): in place either way. Stock LuCI's own pages inject nothing into <head> on
* 24.10/25.12 — the realtime graphs style their SVG text with an inline `style=` attribute — so
* what this costs a router is decided entirely by which apps are installed on it.
*
* Removing the sheet on the way out is NOT the fix, and it is the obvious one: the append is at
* module top level, `L.require` caches the module, so a second visit re-runs nothing and the page