Skip to content

arcTo and ellipse accept negative radii #2626

Open

Description

@dajiaohuang

The Canvas 2D radius-taking methods should reject negative radii, but the arcTo() implementation proceeds with a negative radius and ellipse() only checks for zero before passing its radii into Cairo. arcTo() also handles degenerate points before any radius validation, so a negative value can be silently treated as a line in those cases.

The repository already vendors WPT cases for negative arcTo and ellipse radii in test/wpt/path-objects.yaml; those cases expect INDEX_SIZE_ERR. Could these methods validate their radius arguments before modifying the path, consistently with arc() and the API contract?

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions