render: expose real geometry to JS behind the render feature

getBoundingClientRect, offsetWidth/Height, and offsetTop/Left now read
real box geometry from the obscura-render layout cache when the render
feature is compiled in. elementFromPoint inherits correct hit-testing
because it already delegates to getBoundingClientRect per element.

Adds a render feature on obscura-js (propagated through obscura-browser
and obscura-cli), a lazily-computed layout cache and viewport in
ObscuraState (feature-gated, cleared on navigation), and an
op_layout_geometry op. bootstrap.js probes the op with typeof, so the
default scraping build is unchanged and falls through to the synthetic
rect.

With --features render, block siblings stack and flex children place
horizontally at correct positions, and elementFromPoint resolves the
right element. Default build returns the synthetic rect unchanged.
Obstacle course 33/33; obscura-js unit failures identical to main.
This commit is contained in:
SGavrl committed 2026-06-30 20:36:43 +00:00
1 parent f0f9b048d0
commit 399181b975
7 files changed
+125 -33

No files matched your search

+1
View File
@@ -6,6 +6,7 @@ edition.workspace = true
[features]
default = []
stealth = ["obscura-net/stealth", "obscura-js/stealth"]
render = ["obscura-js/render"]
[dependencies]
obscura-dom = { workspace = true }