wpt: get the script content fonr the node itself

instead of using the first child only which result a partial content.
see https://github.com/Browsercore/browsercore/issues/59
This commit is contained in:
Pierre Tachoire
2023-10-11 11:31:40 +02:00
parent bf0af2c036
commit f3601f1245

View File

@@ -225,10 +225,7 @@ fn runWPT(arena: *std.heap.ArenaAllocator, f: []const u8, loader: *FileLoader) !
for (0..slen) |i| { for (0..slen) |i| {
const s = parser.nodeListItem(scripts, @intCast(i)).?; const s = parser.nodeListItem(scripts, @intCast(i)).?;
// search only script tag containing text a child. const src = parser.nodeTextContent(s).?;
const text = parser.nodeFirstChild(s) orelse continue;
const src = parser.nodeTextContent(text).?;
try js_env.run(alloc, src, "", &res, &cbk_res); try js_env.run(alloc, src, "", &res, &cbk_res);
// return the first failure. // return the first failure.