mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-31 01:28:55 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user