From b3758045a8f5b4e90b0acd37927e22ff496276bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Arrufat?= Date: Tue, 15 Sep 2026 09:46:49 +0200 Subject: [PATCH] Resolve scroll containers through the style cascade Element.scrollContainer read the inline style= attribute only, so a scroller declared in a stylesheet was invisible to the scroll tool and to wheel scrolling, which then fell through to the viewport. StyleManager now tracks overflow-x and overflow-y alongside display, visibility, opacity and pointer-events, and exposes scrolls(el, axes) as an own-element probe. The overflow shorthand is expanded into its longhands in declaration order, in both the attribute scan and the materialized style object, so a shorthand and its longhands keep the precedence of the source text. overlay counts as auto, as in Chrome. Element.scrollContainer asks the style manager, and the two unused Props bits hold the new flags, so the per-element memo does not grow. --- src/browser/StyleManager.zig | 155 +++++++++++++----- src/browser/tests/mcp_actions.html | 4 + src/browser/webapi/Element.zig | 23 +-- .../webapi/css/CSSStyleDeclaration.zig | 2 +- src/mcp/tools.zig | 14 ++ src/server/cdp/domains/input.zig | 36 ++++ 6 files changed, 172 insertions(+), 62 deletions(-) diff --git a/src/browser/StyleManager.zig b/src/browser/StyleManager.zig index bbb70e47c..e18e9db9b 100644 --- a/src/browser/StyleManager.zig +++ b/src/browser/StyleManager.zig @@ -34,13 +34,14 @@ const CSSRule = @import("webapi/css/CSSRule.zig"); const CSSStyleRule = @import("webapi/css/CSSStyleRule.zig"); const CSSStyleSheet = @import("webapi/css/CSSStyleSheet.zig"); const CSSStyleProperties = @import("webapi/css/CSSStyleProperties.zig"); +const CSSStyleDeclaration = @import("webapi/css/CSSStyleDeclaration.zig"); const log = lp.log; const String = lp.String; const Allocator = std.mem.Allocator; // Tracks the CSS properties the renderless layout acts on (display, visibility, -// opacity, pointer-events) from +
+

Sheet leaf

+
Hover Me