-
Notifications
You must be signed in to change notification settings - Fork 284
Closed
Description
When parsing with DOMParser in JS, any HTMLTemplateElement discards its content.
<template>hello, world</template>
After parsing, when calling get_content on this element a fresh DocumentFragment is created instead of returning the DocumentFragment with the hello, world text node.
browser/src/browser/html/elements.zig
Lines 1209 to 1217 in fb6fbff
| pub fn get_content(self: *parser.Template, page: *Page) !*parser.DocumentFragment { | |
| const state = try page.getOrCreateNodeState(@ptrCast(@alignCast(self))); | |
| if (state.template_content) |tc| { | |
| return tc; | |
| } | |
| const tc = try parser.documentCreateDocumentFragment(@ptrCast(page.window.document)); | |
| state.template_content = tc; | |
| return tc; | |
| } |
I'm not sure if the parser needs to setup the node state, or get_content needs to be adjusted to pull the content from the correct place.
Metadata
Metadata
Assignees
Labels
No labels