Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.8.13 The area element: Inconsistency between circle state and rectangle state#10306

Open
Psychpsyo opened this issue Apr 29, 2024 · 0 comments

Comments

@Psychpsyo
Copy link

What is the issue with the HTML Standard?

The spec says that the <area> element, in circle state, needs coords with a non-negative radius.
This means a circle with radius (and area of) 0 is perfectly valid.

Rectangle state however demands that the coordinates for the bottom right be greater than the coordinates for the top left, making a 0 width or 0 height rectangle impossible.

I understand that neither of these are things you'd actually want to use but I'm currently making a utility to create image maps and accounting for the restriction on rectangle was a bit annoying.
So, since it's also inconsistent with what is allowed for circles (and polygons even), I'd propose restricting the rectangle's bottom right to be greater or equal to the top left instead of needing to be strictly greater.

Psychpsyo added a commit to Psychpsyo/html that referenced this issue May 1, 2024
This makes it so that an area's rectangle state can have
rectangles with a width or height of 0, by allowing the top left corner to be identical to the bottom right instead of having to
be strictly smaller.

This makes it consistent with the other two states, as circles
are allowed to have a radius of 0 and polygons can have all
their points along a line or even in a single spot, making
areas with a size of 0 possible.

Fixes whatwg#10306.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant