1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:28:10 +00:00

LibWeb: Use FlyString for create_element() namespace strings

This commit is contained in:
Andreas Kling 2023-11-04 09:46:23 +01:00
parent 8f82bd044b
commit f052823f5f
21 changed files with 65 additions and 64 deletions

View file

@ -104,17 +104,17 @@ JS::NonnullGCPtr<Document> DOMImplementation::create_html_document(Optional<Stri
MUST(html_document->append_child(*doctype));
// 4. Append the result of creating an element given doc, html, and the HTML namespace, to doc.
auto html_element = create_element(html_document, HTML::TagNames::html, Namespace::HTML).release_value_but_fixme_should_propagate_errors();
auto html_element = create_element(html_document, HTML::TagNames::html, MUST(FlyString::from_deprecated_fly_string(Namespace::HTML))).release_value_but_fixme_should_propagate_errors();
MUST(html_document->append_child(html_element));
// 5. Append the result of creating an element given doc, head, and the HTML namespace, to the html element created earlier.
auto head_element = create_element(html_document, HTML::TagNames::head, Namespace::HTML).release_value_but_fixme_should_propagate_errors();
auto head_element = create_element(html_document, HTML::TagNames::head, MUST(FlyString::from_deprecated_fly_string(Namespace::HTML))).release_value_but_fixme_should_propagate_errors();
MUST(html_element->append_child(head_element));
// 6. If title is given:
if (title.has_value()) {
// 1. Append the result of creating an element given doc, title, and the HTML namespace, to the head element created earlier.
auto title_element = create_element(html_document, HTML::TagNames::title, Namespace::HTML).release_value_but_fixme_should_propagate_errors();
auto title_element = create_element(html_document, HTML::TagNames::title, MUST(FlyString::from_deprecated_fly_string(Namespace::HTML))).release_value_but_fixme_should_propagate_errors();
MUST(head_element->append_child(title_element));
// 2. Append a new Text node, with its data set to title (which could be the empty string) and its node document set to doc, to the title element created earlier.
@ -123,7 +123,7 @@ JS::NonnullGCPtr<Document> DOMImplementation::create_html_document(Optional<Stri
}
// 7. Append the result of creating an element given doc, body, and the HTML namespace, to the html element created earlier.
auto body_element = create_element(html_document, HTML::TagNames::body, Namespace::HTML).release_value_but_fixme_should_propagate_errors();
auto body_element = create_element(html_document, HTML::TagNames::body, MUST(FlyString::from_deprecated_fly_string(Namespace::HTML))).release_value_but_fixme_should_propagate_errors();
MUST(html_element->append_child(body_element));
// 8. docs origin is thiss associated documents origin.