DOMRect constructor

More default computed styles (color and backgroundColor)

HTMLMetaElement properties

Case-insensitive findAdjacentNodes position parameter

Allow computedStyle pseudo_element parameter (ignore, log not implemented)

Window.isSecureContext always returns false
This commit is contained in:
Karl Seguin
2025-12-30 09:33:00 +08:00
parent 7b74161e9c
commit 169582c992
9 changed files with 100 additions and 39 deletions

View File

@@ -219,6 +219,14 @@ fn getDefaultPropertyValue(self: *const CSSStyleDeclaration, normalized_name: []
const element = self._element orelse return "";
return getDefaultDisplay(element);
}
if (std.mem.eql(u8, normalized_name, "color")) {
const element = self._element orelse return "";
return getDefaultColor(element);
}
if (std.mem.eql(u8, normalized_name, "background-color")) {
// transparent
return "rgba(0, 0, 0, 0)";
}
return "";
}
@@ -256,6 +264,18 @@ fn isInlineTag(tag_name: []const u8) bool {
return false;
}
fn getDefaultColor(element: *const Element) []const u8 {
switch (element._type) {
.html => |html| {
return switch (html._type) {
.anchor => "rgb(0, 0, 238)", // blue
else => "rgb(0, 0, 0)",
};
},
.svg => return "rgb(0, 0, 0)",
}
}
pub const Property = struct {
_name: String,
_value: String,