diff --git a/src/browser/Page.zig b/src/browser/Page.zig index dedb2a6e..78195490 100644 --- a/src/browser/Page.zig +++ b/src/browser/Page.zig @@ -2908,9 +2908,12 @@ fn nodeIsReady(self: *Page, comptime from_parser: bool, node: *Node) !void { } if (node.is(Element.Html.Script)) |script| { if ((comptime from_parser == false) and script._src.len == 0) { - // script was added via JavaScript, but without a src, don't try - // to execute it (we'll execute it if/when the src is set) - return; + // Script was added via JavaScript without a src attribute. + // Only skip if it has no inline content either — scripts with + // textContent/text should still execute per spec. + if (node.firstChild() == null) { + return; + } } self.scriptAddedCallback(from_parser, script) catch |err| { diff --git a/src/browser/tests/element/html/script/dynamic_inline.html b/src/browser/tests/element/html/script/dynamic_inline.html new file mode 100644 index 00000000..d5cb60f2 --- /dev/null +++ b/src/browser/tests/element/html/script/dynamic_inline.html @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + +