mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 03:58:12 +00:00
LibHTML: DOM fixup should handle a completely empty document
We were forgetting to check if there was even a first child of the root Document node.
This commit is contained in:
parent
7b0f3b19df
commit
73af2f8d02
1 changed files with 1 additions and 1 deletions
|
@ -57,7 +57,7 @@ bool Document::is_child_allowed(const Node& node) const
|
||||||
|
|
||||||
void Document::fixup()
|
void Document::fixup()
|
||||||
{
|
{
|
||||||
if (!is<DocumentType>(first_child()))
|
if (!first_child() || !is<DocumentType>(*first_child()))
|
||||||
prepend_child(adopt(*new DocumentType(*this)));
|
prepend_child(adopt(*new DocumentType(*this)));
|
||||||
|
|
||||||
if (is<HTMLHtmlElement>(first_child()->next_sibling()))
|
if (is<HTMLHtmlElement>(first_child()->next_sibling()))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue