From ebe7f589051e98298951c02174758afc8b7674c2 Mon Sep 17 00:00:00 2001 From: slhx agent Date: Mon, 11 May 2026 10:27:09 +0200 Subject: [PATCH] test(examples): guard browser e2e product path req: examples/005 req: convention/002 --- .../techdemo/templates/control_center.heml | 2 +- slhx-js/runtime/slhx.js | 5 +- slhx-test/tests/examples_contract.rs | 50 ++++++++++++++++--- 3 files changed, 46 insertions(+), 11 deletions(-) diff --git a/examples/techdemo/templates/control_center.heml b/examples/techdemo/templates/control_center.heml index 5d522c4..fac86cf 100644 --- a/examples/techdemo/templates/control_center.heml +++ b/examples/techdemo/templates/control_center.heml @@ -27,7 +27,7 @@ - +
diff --git a/slhx-js/runtime/slhx.js b/slhx-js/runtime/slhx.js index d9959f5..e09ed40 100644 --- a/slhx-js/runtime/slhx.js +++ b/slhx-js/runtime/slhx.js @@ -23,10 +23,7 @@ function formOwner(el) { if (!el || el.tagName === "FORM") return el; if (el.getAttribute && el.getAttribute("form")) return document.getElementById(el.getAttribute("form")); - const closest = el.closest ? el.closest("form") : null; - if (closest) return closest; - const root = rootOf(el); - return root && root.querySelector("form[data-slhx-form]"); + return el.closest ? el.closest("form") : null; } function formHandleId(form) { diff --git a/slhx-test/tests/examples_contract.rs b/slhx-test/tests/examples_contract.rs index aac24c7..5aecd55 100644 --- a/slhx-test/tests/examples_contract.rs +++ b/slhx-test/tests/examples_contract.rs @@ -12,14 +12,28 @@ fn canonical_examples_do_not_author_browser_javascript() { } for (line_no, line) in text.lines().enumerate() { let trimmed = line.trim(); - if trimmed.contains(""#) { - failures.push(format!("{}:{}: inline "#) + { + failures.push(format!( + "{}:{}: inline