Skip to content

Conversation

@krichprollsch
Copy link
Member

Libdom uses the doc's body and title attributes by default. But it fallback to the DOM tree if the attributes are NULL.

I think it's better to have only the DOM tree set on document creation.

Libdom uses the doc's body and title attributes by default.
But it fallback to the DOM tree if the attributes are NULL.

I think it's better to have only the DOM tree set on document creation.
@krichprollsch krichprollsch self-assigned this May 19, 2025
_ = try nodeAppendChild(elementToNode(html), elementToNode(head));

if (title) |t| {
try documentHTMLSetTitle(doc_html, t);
Copy link
Contributor

@sjorsdonkers sjorsdonkers May 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems it would be more performant if we do set it as it would not have to search for it here.
If we keep it, it would be good to comment why it is there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

documentCreateDocument calls already documentHTMLSetTitle. But moving this tree creation to documentCreateDocument will be clearer.

@krichprollsch krichprollsch merged commit 58cc5d8 into main May 19, 2025
9 checks passed
@krichprollsch krichprollsch deleted the implementation-update branch May 19, 2025 14:14
@github-actions github-actions bot locked and limited conversation to collaborators May 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants