servo / servo/html5ever

`html5ever::tokenizer::Tokenizer::process_token_and_continue` needs to go away

Open
#496 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
2.6k
Forks
288
Avg merge
2d 22h
Merged PRs (30d)
8

Description

It will panic if you don't return Continue and the callee has no way of knowing if they are being called from a "normal" code path where you are allowed to return whatever you want and or a special panic-if-not Continue codepath. Not cool.

This is dangerous and basically means that returning anything but Continue is forbidden if you don't want panics.

At they very least this should be documented.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading html5ever::tokenizer::Tokenizer::process_token_and_continue and tracing its callers to understand the normal and panic-if-not-Continue paths. This issue is complete when the unsafe return behavior is removed or the Continue requirement is clearly documented, with the affected tokenizer behavior covered by tests if existing tests are found.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.