- From: Karl Dubost via GitHub <noreply@w3.org>
- Date: Wed, 19 Nov 2025 08:01:17 +0000
- To: public-svg-issues@w3.org
The text from the Chromium patch is:
> Match camelCased SVG attributes selectors in html documents.
>
> Attribute names are stored lower-case in stylesheets in HTML documents.
SVG attribute names are normalized to the camelCase form in HTML
documents. That meant SVG attributes with camelCase like viewBox never
matched in HTML documents.
>
> We had the same issue for camelCased element names in [1]. In that CL
we decided to allow insensitive matching for non-html elements in order
to avoid having to store the tag names twice in CSSSelector, even if
that is wrong according to the HTML spec. This CL does exactly the same
for attribute selectors.
The code from @Ahmad-S792
```html
<style>
[viewBox] { color: green }
[VIEWBOX] { background-color: green }
</style>
<div viewBox id="t1"></div>
<div viewbox id="t2"></div>
<svg viewBox="0 0 800 10" id="t3"></svg>
<svg VIEWBOX="0 0 800 10" id="t4"></svg>
```
The tests failing on Safari AND Chrome in the jsfiddle from @Ahmad-S792
* `<svg viewBox="0 0 800 10" id="t3"></svg>` with `getComputedStyle(t3).backgroundColor, "rgb(0, 128, 0)`. Green has not been applied (aka VIEWBOX didn't match)
* `<svg VIEWBOX="0 0 800 10" id="t4"></svg>` with `getComputedStyle(t4).backgroundColor, "rgb(0, 128, 0)`. Green has not been applied (aka VIEWBOX didn't match)
--
GitHub Notification of comment by karlcow
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/1032#issuecomment-3551308618 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 19 November 2025 08:01:18 UTC