mirror of
https://github.com/RGBCube/serenity
synced 2025-05-15 22:54:57 +00:00
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:
parent
f48feae0b2
commit
7902d215b3
14 changed files with 174 additions and 28 deletions
|
@ -133,14 +133,14 @@ DOM::Element* StackOfOpenElements::topmost_special_node_below(const DOM::Element
|
|||
return found_element;
|
||||
}
|
||||
|
||||
DOM::Element* StackOfOpenElements::last_element_with_tag_name(const FlyString& tag_name)
|
||||
StackOfOpenElements::LastElementResult StackOfOpenElements::last_element_with_tag_name(const FlyString& tag_name)
|
||||
{
|
||||
for (ssize_t i = m_elements.size() - 1; i >= 0; --i) {
|
||||
auto& element = m_elements[i];
|
||||
if (element.local_name() == tag_name)
|
||||
return &element;
|
||||
return { &element, i };
|
||||
}
|
||||
return nullptr;
|
||||
return { nullptr, -1 };
|
||||
}
|
||||
|
||||
DOM::Element* StackOfOpenElements::element_before(const DOM::Element& target)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue