Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/browser/console/console.zig
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ pub const Console = struct {
});
}

pub fn _trace(values: []js.Object, page: *Page) !void {
if (values.len == 0) {
return;
}
log.debug(.console, "debug", .{
.stack = page.js.stackTrace() catch "???",
.args = try serializeValues(values, page),
});
}

pub fn _clear() void {}

pub fn _count(self: *Console, label_: ?[]const u8, page: *Page) !void {
Expand Down
13 changes: 13 additions & 0 deletions src/tests/html/svg.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
<!DOCTYPE html>
<script src="../testing.js"></script>

<svg width="200" height="100" style="border:1px solid #ccc" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 100">
<rect></rect>
<text x="100" y="95" font-size="14" text-anchor="middle">OVER 9000!!</text>
</svg>

<script id=svg>
testing.expectEqual(false, 'AString' instanceof SVGElement);

const svg = document.querySelector('svg');
testing.expectEqual('http://www.w3.org/2000/svg', svg.getAttribute('xmlns'));
testing.expectEqual('http://www.w3.org/2000/svg', svg.getAttributeNode('xmlns').value);
testing.expectEqual('http://www.w3.org/2000/svg', svg.attributes.getNamedItem('xmlns').value);
testing.expectEqual('0 0 200 100', svg.getAttribute('viewBox'));
testing.expectEqual('viewBox', svg.getAttributeNode('viewBox').name);
testing.expectEqual(true, svg.outerHTML.includes('viewBox'));
</script>
2 changes: 1 addition & 1 deletion vendor/netsurf/libdom