LibWeb: Hide implementation details of HTMLToken attribute list

Previously, HTMLToken would expose the Vector<Attribute> directly to
its users. In preparation for a future change, all users now use
implementation-agnostic APIs which do not expose the Vector directly.
This commit is contained in:
Max Wipfli 2021-07-14 23:53:11 +02:00 committed by Ali Mohammad Pur
parent 15d8635afc
commit 918bde98b1
Notes: sideshowbarker 2024-07-18 08:52:54 +09:00
6 changed files with 108 additions and 59 deletions

View file

@ -42,12 +42,13 @@ String HTMLToken::to_string() const
builder.append(" { name: '");
builder.append(tag_name());
builder.append("', { ");
for (auto& attribute : m_tag.attributes) {
for_each_attribute([&](auto& attribute) {
builder.append(attribute.local_name);
builder.append("=\"");
builder.append(attribute.value);
builder.append("\" ");
}
return IterationDecision::Continue;
});
builder.append("} }");
}