[svgwg] Issue: how should display:contents affect SVG conditional processing attributes? marked as Styling chapter

dirkschulze has just labeled an issue for https://github.com/w3c/svgwg as "Styling chapter":

== how should display:contents affect SVG conditional processing attributes? ==
https://drafts.csswg.org/css-display/#unbox-svg

The CSS Display spec says that attributes that affect layout or visual formatting should be ignored on SVG elements that are `display: contents`.  Are SVG conditional processing attributes in this category?  For example:

```svg
  <g systemLanguage="zz" style="display: contents">
    <rect width="100" height="100"/>
  </g>
```

Should the rectangle be rendered since `systemLanguage` is an attribute that affects rendering?

```svg
  <switch>
    <g systemLanguage="zz" style="display: contents">
      <rect width="100" height="100"/>
    </g>
  </switch>
```

Should the rectangle be rendered since `systemLanguage` is an attribute that affects rendering, even though it is the `<switch>` that is making the decision about which child to render?

```svg
  <switch>
    <g style="display: contents">
      <rect systemLanguage="zz" width="100" height="100" />
    </g>
    <circle cx="200" cy="200" r="100"/>
  </switch>
```

Should the `systemLanguage` affect the `<switch>`'s choice of which child to render?  (Either both the `<rect>` and `<circle>` should render, or neither should, IMO.)

---

I think my preference is to make conditional processing attributes not influenced by `display: contents`.  For the `<switch>` case, it would otherwise be inconsistent with how `display: none` children are treated when selecting which child to render (i.e., the `<switch>` can select a `display: none` child if its conditional processing attributes evaluate to true).  It also means we don't need to re-evaluate which child is being shown after we restyle elements (since a child could become `display: contents` dynamically).

/cc @emilio @lilles

See https://github.com/w3c/svgwg/issues/579

Received on Thursday, 8 November 2018 06:36:05 UTC