lit compatibility

Aims to improve compatibility for the lit framework (e.g. what Reddit is using).

1 - Adds support for adoptedStyleSheets to the Document and ShadowRoot
2 - Adds mock support for replace and replaceSync to the CSSStyleSheet
3 - Optionally include shadowroot in dump
4 - Special-case setting innerHTML on a TemplateElement
This commit is contained in:
Karl Seguin
2025-08-07 16:47:31 +08:00
parent bede244598
commit f5da89b50b
10 changed files with 140 additions and 8 deletions

View File

@@ -799,6 +799,14 @@ pub fn Env(comptime State: type, comptime WebApis: type) type {
return promise;
}
pub fn newArray(self: *JsContext, len: u32) JsObject {
const arr = v8.Array.init(self.isolate, len);
return .{
.js_context = self,
.js_obj = arr.castTo(v8.Object),
};
}
// Wrap a v8.Exception
fn createException(self: *const JsContext, e: v8.Value) Exception {
return .{