mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-20 16:13:21 +00:00
24 lines
617 B
C++
24 lines
617 B
C++
|
|
#include <LibWeb/DOM/Element.h>
|
||
|
|
#include <LibWeb/Parser/StackOfOpenElements.h>
|
||
|
|
|
||
|
|
namespace Web {
|
||
|
|
|
||
|
|
StackOfOpenElements::~StackOfOpenElements()
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
bool StackOfOpenElements::has_in_scope(const FlyString& tag_name) const
|
||
|
|
{
|
||
|
|
static Vector<FlyString> list { "applet", "caption", "html", "table", "td", "th", "marquee", "object", "template" };
|
||
|
|
for (ssize_t i = m_elements.size() - 1; i >= 0; --i) {
|
||
|
|
auto& node = m_elements.at(i);
|
||
|
|
if (node.tag_name() == tag_name)
|
||
|
|
return true;
|
||
|
|
if (list.contains_slow(node.tag_name()))
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
ASSERT_NOT_REACHED();
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|