1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:37:35 +00:00

LibWeb: Don't include DOM/Attr.h from DOM/Element.h

This required moving Element::for_each_attribute() out of line, but that
seems harmless enough.
This commit is contained in:
Andreas Kling 2023-05-08 06:49:38 +02:00 committed by Jelle Raaijmakers
parent 43616316de
commit 5b5fbecb38
5 changed files with 13 additions and 9 deletions

View file

@ -15,6 +15,7 @@
#include <LibWeb/CSS/ResolvedCSSStyleDeclaration.h>
#include <LibWeb/CSS/SelectorEngine.h>
#include <LibWeb/CSS/StyleComputer.h>
#include <LibWeb/DOM/Attr.h>
#include <LibWeb/DOM/DOMTokenList.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/Element.h>
@ -1673,4 +1674,12 @@ void Element::set_prefix(DeprecatedFlyString const& value)
m_qualified_name.set_prefix(value);
}
void Element::for_each_attribute(Function<void(DeprecatedFlyString const&, DeprecatedString const&)> callback) const
{
for (size_t i = 0; i < m_attributes->length(); ++i) {
auto const* attribute = m_attributes->item(i);
callback(attribute->name(), attribute->value());
}
}
}