LibWeb: Implement <template> parsing

Note that there is currently no way to display them as we can't
currently clone nodes.

Adds special case for templates for dumping to console.
Doesn't add it to the DOM inspector as I'm not sure how to do it.
This commit is contained in:
Luke 2020-08-19 22:30:33 +01:00 committed by Andreas Kling
parent f48feae0b2
commit 7902d215b3
Notes: sideshowbarker 2024-07-19 03:23:09 +09:00
14 changed files with 174 additions and 28 deletions

View file

@ -63,6 +63,8 @@ GUI::ModelIndex DOMTreeModel::parent_index(const GUI::ModelIndex& index) const
if (!node.parent())
return {};
// FIXME: Handle the template element (child elements are not stored in it, all of its children are in its document fragment "content")
// No grandparent? Parent is the document!
if (!node.parent()->parent()) {
return create_index(0, 0, m_document.ptr());