diff --git a/Userland/Libraries/LibWeb/HTML/AttributeNames.cpp b/Userland/Libraries/LibWeb/HTML/AttributeNames.cpp
index d4425d2679..9bc32452bf 100644
--- a/Userland/Libraries/LibWeb/HTML/AttributeNames.cpp
+++ b/Userland/Libraries/LibWeb/HTML/AttributeNames.cpp
@@ -39,5 +39,38 @@ ENUMERATE_HTML_ATTRIBUTES
}
}
+
+// https://html.spec.whatwg.org/#boolean-attribute
+bool is_boolean_attribute(FlyString const& attribute)
+{
+ // NOTE: This is the list of attributes from https://html.spec.whatwg.org/#attributes-3
+ // with a Value column value of "Boolean attribute".
+ return attribute.is_one_of(
+ AttributeNames::allowfullscreen,
+ AttributeNames::async,
+ AttributeNames::autofocus,
+ AttributeNames::autoplay,
+ AttributeNames::checked,
+ AttributeNames::controls,
+ AttributeNames::default_,
+ AttributeNames::defer,
+ AttributeNames::disabled,
+ AttributeNames::formnovalidate,
+ AttributeNames::inert,
+ AttributeNames::ismap,
+ AttributeNames::itemscope,
+ AttributeNames::loop,
+ AttributeNames::multiple,
+ AttributeNames::muted,
+ AttributeNames::nomodule,
+ AttributeNames::novalidate,
+ AttributeNames::open,
+ AttributeNames::playsinline,
+ AttributeNames::readonly,
+ AttributeNames::required,
+ AttributeNames::reversed,
+ AttributeNames::selected);
+}
+
}
}
diff --git a/Userland/Libraries/LibWeb/HTML/AttributeNames.h b/Userland/Libraries/LibWeb/HTML/AttributeNames.h
index 18de3a9ff8..061131938e 100644
--- a/Userland/Libraries/LibWeb/HTML/AttributeNames.h
+++ b/Userland/Libraries/LibWeb/HTML/AttributeNames.h
@@ -232,5 +232,8 @@ ENUMERATE_HTML_ATTRIBUTES
#undef __ENUMERATE_HTML_ATTRIBUTE
}
+
+bool is_boolean_attribute(FlyString const& attribute);
+
}
}