mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 04:34:44 +00:00
SemanticTree: simplify TextVisitor printing logic
This commit is contained in:
@@ -424,14 +424,13 @@ const TextVisitor = struct {
|
|||||||
|
|
||||||
const is_text_only = std.mem.eql(u8, data.role, "StaticText") or std.mem.eql(u8, data.role, "none") or std.mem.eql(u8, data.role, "generic");
|
const is_text_only = std.mem.eql(u8, data.role, "StaticText") or std.mem.eql(u8, data.role, "none") or std.mem.eql(u8, data.role, "generic");
|
||||||
|
|
||||||
if (is_text_only and name_to_print != null) {
|
try self.writer.print("{d}", .{data.id});
|
||||||
try self.writer.print("{d} '{s}'", .{ data.id, name_to_print.? });
|
if (!is_text_only) {
|
||||||
} else {
|
try self.writer.print(" {s}", .{data.role});
|
||||||
try self.writer.print("{d} {s}", .{ data.id, data.role });
|
}
|
||||||
if (name_to_print) |n| {
|
if (name_to_print) |n| {
|
||||||
try self.writer.print(" '{s}'", .{n});
|
try self.writer.print(" '{s}'", .{n});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (data.value) |v| {
|
if (data.value) |v| {
|
||||||
if (v.len > 0) {
|
if (v.len > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user