Re: [svgwg] [circle][ellipse] SVG 2 silent on negative values for cx/cy (#1145)

Some additional investigation.

## What implementations actually do

- A negative value on `r`/`rx`/`ry`/`width`/`height` is **invalid**, and the property is
  treated as if its **initial value** were specified aka `auto` for `rx`/`ry`/`width`/`height`,
  `0` for `r`. The used value then follows that property's **normal resolution**.
- Therefore `<ellipse rx="-20" ry="30">` renders as a **circle of radius 30** (rx → `auto` →
  mirrors ry) in Blink, Gecko **and** WebKit (all confirmed live, bbox 60×60). It does **not**
  collapse to 0. `<rect rx="-20" ry="30">` is likewise **rounded** in all three engines.
- `0` is the outcome only for `r`, for **both** `rx`/`ry` negative-or-`auto`, and for
  `width`/`height` on shapes (via the §Sizing `auto` table).
- `cx`/`cy`/`x`/`y` **accept** negatives in all three engines.

This *refines* the WG resolution: "compute to `auto`" is correct; "resolve to 0" is only one
branch of `auto` resolution.

## Cross-engine `getComputedStyle` / `baseVal` divergences (rendering is NOT affected)


| Probe | WebKit 26 | Gecko 154 | Blink 152 |
|---|---|---|---|
| `r="-20"` (attr) computed | `0px` | `0px` | **`-20px`** |
| `r="-20"` (attr) baseVal | keeps `-20` | resets `0` | keeps `-20` |
| `rx="-20"` (attr) computed | `auto` | `auto` | **`-20px`** |
| `rx="-20"` (attr) baseVal | keeps `-20` | resets `0` | keeps `-20` |
| `rx="-20"` (**CSS**) computed | `auto` | `auto` | `auto` |
| `width="-50"` (attr) computed | `0px` | **`auto`** | `0px` |



- **Blink** returns the *raw negative* from `getComputedStyle` on the presentation-attribute
  path for `r`/`rx`/`ry` (`-20px`), even though it *renders* mirrored/zeroed correctly and its
  own **CSS** path returns `auto`. So Blink's attribute vs CSS computed values disagree. Pinning
  the **computed value** to `auto`/`0` (per the resolution) would make Blink conformant.
- **Gecko** resets `baseVal` to `0` (does not retain the negative); WebKit/Blink retain it.
- Engines disagree on the computed serialization of a negative `width`: `0px` (WK/Blink) vs
  `auto` (Gecko). The spec should state the computed value explicitly.
- **Chrome 152 mirrors by default**, so `SvgIgnoreNegativeEllipseRadiiEnabled` is enabled in
  stable Chrome.


-- 
GitHub Notification of comment by karlcow
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/1145#issuecomment-5054345380 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 23 July 2026 04:28:02 UTC