Skip to content

Lightpanda: the headless browser designed for AI and automation

Merge branch 'main' into inline-style-on-demand

Adrià Arrufata142c42b60c5
diff --cc src/SemanticTree.zig
index 0953ff859,685b84ffa..2eef6545e
--- a/src/SemanticTree.zig
+++ b/src/SemanticTree.zig
@@@ -129,10 -132,11 +132,11 @@@ fn walk
// Hidden subtrees are never entered, so below the root only the
// element's own display matters.
+ const style_manager = &ctx.owner_frame._style_manager;
const hidden = if (current_depth == 0)
- !el.isVisible(self.frame)
- style_manager.isHidden(el, .{}, .scan)
++ style_manager.isHidden(el, .{})
else
- self.frame._style_manager.hasDisplayNone(el);
- style_manager.hasDisplayNone(el, .scan);
++ style_manager.hasDisplayNone(el);
if (hidden) {
return;
}
diff --cc src/browser/webapi/css/CSSStyleDeclaration.zig
index 71d45c337,f282d5814..8a8aecb51
--- a/src/browser/webapi/css/CSSStyleDeclaration.zig
+++ b/src/browser/webapi/css/CSSStyleDeclaration.zig
@@@ -82,11 -82,16 +82,16 @@@ pub fn getPropertyValue(self: *const CS
// tree builders (Playwright ariaSnapshot) consult on every element.
if (self._is_computed) {
if (self._element) |element| {
- const style_manager = &element.ownerFrame(frame)._style_manager;
if (wrapped.eql(comptime .wrap("display"))) {
- if (style_manager.hasDisplayNone(element)) return "none";
+ const style_manager = &element.ownerFrame(frame)._style_manager;
- if (style_manager.hasDisplayNone(element, .materialize)) {
++ if (style_manager.hasDisplayNone(element)) {
+ return "none";
+ }
} else if (wrapped.eql(comptime .wrap("visibility"))) {
- if (style_manager.hasVisibilityHiddenInherited(element)) return "hidden";
+ const style_manager = &element.ownerFrame(frame)._style_manager;
+ if (style_manager.hasVisibilityHiddenInherited(element)) {
+ return "hidden";
+ }
}
}
}