axnode: don't extract all text content as name

ignore name extraction for more elements
This commit is contained in:
Pierre Tachoire
2026-01-14 21:58:05 +01:00
parent eb45bd051c
commit ef315a46bc

View File

@@ -553,7 +553,38 @@ fn writeName(axnode: AXNode, w: anytype, page: *Page) !?AXSource {
// TODO Check for <label> with matching "for" attribute
// TODO Check if input is wrapped in a <label>
},
.textarea, .select, .img, .audio, .video, .iframe, .embed, .object, .progress, .meter, .p => {},
.textarea,
.select,
.img,
.audio,
.video,
.iframe,
.embed,
.object,
.progress,
.meter,
.main,
.nav,
.aside,
.header,
.footer,
.form,
.section,
.article,
.ul,
.ol,
.dl,
.menu,
.thead,
.tbody,
.tfoot,
.tr,
.td,
.div,
.span,
.p,
.details,
=> {},
else => {
// write text content if exists.
var buf = std.Io.Writer.Allocating.init(page.call_arena);
@@ -639,6 +670,7 @@ fn ignoreText(node: *DOMNode) bool {
.select,
.optgroup,
.colgroup,
.script,
=> true,
// All other elements should include their text content
else => false,