Re: [svgwg] Need to better define what rules apply to an element in an <svg:use> subtree. (#504)

I don't know if they are related, but I had a funky problem using `<use>` with external SVG:

*extern.svg*
```svg

<svg
  version="1.1"
  xmlns="http://www.w3.org/2000/svg"
  xmlns:xlink="http://www.w3.org/1999/xlink">
  <defs>
    <g id="square">
      <g class="inside-use">
        <rect width="100" height="100"/>
      </g>
    </g>
  </defs>
</svg>
```

*page.html*
```html
<style>
.inside-use {
  fill: red;
}
.shape .inside-use {
  fill: green;
}
</style>
<svg viewBox="0 0 100 100" class="shape">
  <use xlink:href="extern.svg#square"></use>
</svg>

```

Currently, the path `.inside-use` matches the rect and makes it red.
But it doesn't notice that, I want to access the rect when it's inside the `shape` class.
Because `.shape .inside-use` isn't valid for the shadow content.

The goal is to color the different parts (in this example: `inside-use`) depending on the class of the outer `svg` tag

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


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

Received on Thursday, 30 May 2024 10:51:29 UTC