mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-02-04 06:23:45 +00:00
axnode: don't extract all text content as name
ignore name extraction for more elements
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user