mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Parse "input" tags during the "in body" insertion mode
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 06:02:38 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/772b51038e5
@@ -26,6 +26,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <AK/Types.h>
|
||||
@@ -104,6 +105,16 @@ public:
|
||||
m_tag.self_closing_acknowledged = true;
|
||||
}
|
||||
|
||||
StringView attribute(const FlyString& attribute_name)
|
||||
{
|
||||
ASSERT(is_start_tag() || is_end_tag());
|
||||
for (auto& attribute : m_tag.attributes) {
|
||||
if (attribute_name == attribute.name_builder.string_view())
|
||||
return attribute.value_builder.string_view();
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
Type type() const { return m_type; }
|
||||
|
||||
String to_string() const;
|
||||
|
||||
Reference in New Issue
Block a user