Commit Graph

21 Commits

Author SHA1 Message Date
sjhddh
c4176a282f fix: resolve memory leak in Option.getText() by using page arena 2026-03-14 06:50:26 +00:00
Adrià Arrufat
65d7a39554 SemanticTree: use payload captures for CData.Text checks
Improves conciseness and idiomatic Zig style by replacing .is(CData.Text) != null and .as() with direct payload captures in if statements.
2026-03-11 16:39:59 +09:00
Adrià Arrufat
37735b1caa SemanticTree: use StaticStringMap for structural role check
Improves performance and readability of isStructuralRole. Also includes minor syntax cleanup in AXNode.
2026-03-11 16:37:24 +09:00
Adrià Arrufat
1866e7141e SemanticTree: cast with as
Co-authored-by: Karl Seguin <karlseguin@users.noreply.github.com>
2026-03-11 16:33:39 +09:00
Adrià Arrufat
4f262e5bed SemanticTree: filter computed names for generic containers
This prevents token bloat in JSON/text dumps and ensures that StaticText leaf nodes are not incorrectly pruned when structural containers (like none, table) hoist their text.
2026-03-11 10:22:40 +09:00
Adrià Arrufat
064e7b404b SemanticTree: unify interactivity detection logic 2026-03-10 19:02:55 +09:00
Adrià Arrufat
a318c6263d SemanticTree: improve visibility, AX roles and xpath generation
- Use `checkVisibility` for more accurate element visibility detection.
- Add support for color, date, file, and month AX roles.
- Optimize XPath generation by tracking sibling indices during the walk.
- Refine interactivity detection for form elements.
2026-03-10 09:23:06 +09:00
Adrià Arrufat
83ba974f94 SemanticTree: optimize tree walking and xpath generation
- Use a reusable buffer for XPaths to reduce allocations.
- Improve `display: none` detection with proper CSS parsing.
- Pass parent name to children to avoid redundant AXNode lookups.
- Use `getElementById` for faster datalist lookups.
2026-03-09 22:53:39 +09:00
Adrià Arrufat
85ebbe8759 SemanticTree: improve accessibility tree and name calculation
- Add more structural roles (banner, navigation, main, list, etc.).
- Implement fallback for accessible names (SVG titles, image alt text).
- Skip children for leaf-like semantic nodes to reduce redundancy.
- Disable pruning in the default semantic tree view.
2026-03-09 21:04:47 +09:00
Adrià Arrufat
0a5eb93565 SemanticTree: Implement compound component metadata 2026-03-09 13:42:53 +09:00
Adrià Arrufat
b8a3135835 SemanticTree: add pruning support and move logic to walk 2026-03-09 13:02:03 +09:00
Adrià Arrufat
d80e926015 SemanticTree: unify tree traversal using visitor pattern 2026-03-09 11:09:27 +09:00
Adrià Arrufat
be73c14395 SemanticTree: rename dump to dumpJson and update log tags 2026-03-09 10:29:32 +09:00
Adrià Arrufat
4ba40f2295 CDP: implement intelligent pruning for textified semantic tree output 2026-03-08 22:48:22 +09:00
Adrià Arrufat
b674c2e448 CDP/MCP: add highly compressed text format for semantic tree 2026-03-08 22:42:00 +09:00
Adrià Arrufat
b8139a6e83 CDP/MCP: improve Stagehand compatibility for semantic tree 2026-03-08 15:48:44 +09:00
Adrià Arrufat
45705a3e29 webapi: move tag category logic to Tag enum 2026-03-06 16:34:23 +09:00
Adrià Arrufat
e0f0b9f210 SemanticTree: use AXRole enum for interactive role check 2026-03-06 16:26:08 +09:00
Adrià Arrufat
f2832447d4 SemanticTree: optimize tag and role filtering
* Refactored tag ignoring logic to use the el.getTag() enum switch
  instead of string comparisons, improving performance and safety.
* Replaced string comparisons for interactive roles with
  std.StaticStringMap.
* Renamed internal dumpNode method to dump for brevity.
2026-03-06 16:12:57 +09:00
Adrià Arrufat
471ba5baf6 String: refactor isAllWhitespace into String 2026-03-06 15:52:53 +09:00
Adrià Arrufat
248851701f Refactor: move SemanticTree to core and expose via MCP tools 2026-03-06 15:44:03 +09:00