mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibWeb: Insert title as first child on setting title of svg document
Before, the new title element got appended instead of prepended, as nullptr was passed as the "child" argument to the insert_before() function. This change makes two WPT tests pass in: http://wpt.live/html/dom/documents/dom-tree-accessors/document.title-09.html
This commit is contained in:
@@ -923,7 +923,7 @@ WebIDL::ExceptionOr<void> Document::set_title(String const& title)
|
||||
element = TRY(DOM::create_element(*this, HTML::TagNames::title, Namespace::SVG));
|
||||
|
||||
// 2. Insert element as the first child of the document element.
|
||||
document_element->insert_before(*element, nullptr);
|
||||
document_element->insert_before(*element, document_element->first_child());
|
||||
}
|
||||
|
||||
// 3. String replace all with the given value within element.
|
||||
|
||||
Reference in New Issue
Block a user