1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:17:44 +00:00

LibWeb: Support (and validate) prefixes in Document.createElementNS()

1% progression on ACID3. :^)
This commit is contained in:
Andreas Kling 2022-03-02 10:55:16 +01:00
parent 4fb67c1621
commit bfa7aad0f6
5 changed files with 41 additions and 14 deletions

View file

@ -101,13 +101,15 @@ ExceptionOr<void> Element::set_attribute(const FlyString& name, const String& va
}
// https://dom.spec.whatwg.org/#validate-and-extract
static ExceptionOr<QualifiedName> validate_and_extract(FlyString namespace_, FlyString qualified_name)
ExceptionOr<QualifiedName> validate_and_extract(FlyString namespace_, FlyString qualified_name)
{
// 1. If namespace is the empty string, then set it to null.
if (namespace_.is_empty())
namespace_ = {};
// FIXME: 2. Validate qualifiedName.
// 2. Validate qualifiedName.
if (auto result = Document::validate_qualified_name(qualified_name); result.is_exception())
return result.exception();
// 3. Let prefix be null.
FlyString prefix = {};