Skip to content

Conversation

@mookums
Copy link
Contributor

@mookums mookums commented May 14, 2025

This solves the failing WPT: html/dom/documents/dom-tree-accessors/document.title-03.html by ensuring that any whitespace subslices are replaced by a single space.

@karlseguin
Copy link
Collaborator

You might be able to do this without an allocator.

The web apis, i.e. set_title, can take a title: []u8 rather than a []const u8, so you could normalize it in-place.

That leaves documentHTMLParse, and the question becomes, can the dom_string you get from get_title be mutated and passed back to set_title?? Worst case you could use the netsurf arena to create the new string, i.e. c.dom_string_create

@mookums mookums force-pushed the normalize-title-spaces branch from bef3985 to 4a849e5 Compare May 16, 2025 14:22
@mookums
Copy link
Contributor Author

mookums commented May 27, 2025

Going to close this. With our general focus to be as slim and performant as possible, feels antithetical to do an allocation just to pass a single WPT.

@mookums mookums closed this May 27, 2025
@github-actions github-actions bot locked and limited conversation to collaborators May 27, 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