From fa6503c560b2af251e38551cc2cd70f156ba5817 Mon Sep 17 00:00:00 2001
From: SGavrl <277843151+SGavrl@users.noreply.github.com>
Date: Sun, 26 Jul 2026 22:33:36 +0000
Subject: [PATCH] dom: apply dynamically linked stylesheets
---
crates/obscura-js/js/bootstrap.js | 145 ++++++++++++++++++++++++++++--
crates/obscura-js/src/runtime.rs | 65 ++++++++++++++
2 files changed, 204 insertions(+), 6 deletions(-)
diff --git a/crates/obscura-js/js/bootstrap.js b/crates/obscura-js/js/bootstrap.js
index 65ffaa1..81807d9 100644
--- a/crates/obscura-js/js/bootstrap.js
+++ b/crates/obscura-js/js/bootstrap.js
@@ -295,11 +295,127 @@ function _resolveResourceUrl(src) {
} catch(e) { return src; }
}
-// A dynamically-inserted must fetch and fire
-// load/error so frameworks awaiting the link's onload (Promise.all of lazy
-// CSS + JS, antd/bootstrap loaders, etc.) resolve instead of hanging forever.
-// There is no layout engine to apply the CSS, but the load-event contract
-// matches Chrome. Issue #409.
+const _linkedStylesheetNodes = new WeakMap();
+
+// A fetched sheet becomes an inline