mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 04:34:44 +00:00
Use attributes for checkbox rendering
This commit is contained in:
@@ -249,14 +249,15 @@ fn renderElement(el: *Element, state: *State, writer: *std.Io.Writer, page: *Pag
|
|||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
.input => {
|
.input => {
|
||||||
const input = el.as(Element.Html.Input);
|
if (el.getAttributeSafe(comptime .wrap("type"))) |type_attr| {
|
||||||
if (input._input_type == .checkbox) {
|
if (std.ascii.eqlIgnoreCase(type_attr, "checkbox")) {
|
||||||
if (input._checked) {
|
if (el.getAttributeSafe(comptime .wrap("checked"))) |_| {
|
||||||
try writer.writeAll("[x] ");
|
try writer.writeAll("[x] ");
|
||||||
} else {
|
} else {
|
||||||
try writer.writeAll("[ ] ");
|
try writer.writeAll("[ ] ");
|
||||||
|
}
|
||||||
|
state.last_char_was_newline = false;
|
||||||
}
|
}
|
||||||
state.last_char_was_newline = false;
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user