mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 02:28:12 +00:00
LibWeb: Define method to check if an attribute is a boolean attribute
This commit is contained in:
parent
21c1494ac5
commit
941bc47538
2 changed files with 36 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue