Skip to content

html5ever: Add spec references for the tokenizer steps - #782

Merged
mrobinson merged 1 commit into
servo:mainfrom
simonwuelker:spec-steps
Aug 28, 2026
Merged

html5ever: Add spec references for the tokenizer steps#782
mrobinson merged 1 commit into
servo:mainfrom
simonwuelker:spec-steps

Conversation

@simonwuelker

Copy link
Copy Markdown
Member

Our tokenizer code mostly follows the spec directly, but sometimes we deviate. For example, when the specification says to reconsume a character in another state then sometimes we will inline what that state would do, to avoid one iteration of the state machine. This change adds spec text to the code like we do in the script crate in servo, and adds notes when our code deviates.

I've also tried to reorder the match arms of the state machine to match the order that they are listed in the spec, but parts of the code depend on the order of the arms, so its not always possible.

@github-actions github-actions Bot added the V-non-breaking A non-breaking change label Aug 27, 2026
@github-actions github-actions Bot added V-non-breaking A non-breaking change and removed V-non-breaking A non-breaking change labels Aug 27, 2026
@github-actions github-actions Bot added V-non-breaking A non-breaking change and removed V-non-breaking A non-breaking change labels Aug 27, 2026
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
@github-actions github-actions Bot added V-non-breaking A non-breaking change and removed V-non-breaking A non-breaking change labels Aug 28, 2026

@mrobinson mrobinson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Rubber-stamping this one. It seems like an improvement as long as tests pass.

@mrobinson
mrobinson added this pull request to the merge queue Aug 28, 2026
Merged via the queue into servo:main with commit c71f13a Aug 28, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

V-non-breaking A non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants