Skip to content

Investigate number parser reuse #8928

Open

Description

@annevk

I vaguely recall @ayg complaining ages ago about duplicating the parsers we already have for ECMAScript and Web IDL. I think the idea against that was that HTML should in theory be able to go beyond the limits imposed by those parsers. That might still be a worthwhile goal of sorts, but I don't think there's a good reason to have multiple specifications define ConvertToInt and the like.

Activity

  1. added
    clarification
    on Feb 21, 2023
  2. domenic commented on Feb 22, 2023

    @domenic
    Member

    I don't think we should ask JS to change here. So it's a question of whether HTML can change to JS's semantics.

    I think this might be a normative change, but probably one we could get away with.

    For integers, the algorithms to compare are:

    These definitely seem different, including e.g.:

    • the definition of white space that is used
    • how much leading/trailing garbage is allowed
    • ES's algorithm allows implementation-defined results after 20 digits (!)
    • ES's algorithm converts the results to floating point using 𝔽.

    For floats:

    I haven't investigated the differences there.

  3. added a commit that references this issue on Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    clarificationnormative change

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions