[svgwg] Allow nesting filters instead of using 'in', 'in2' and 'result' attributes

SebastianZ has just created a new issue for 
https://github.com/w3c/svgwg:

== Allow nesting filters instead of using 'in', 'in2' and 'result' 
attributes ==
Filter elements currently use the `in` and `in2` attributes to specify
 their inputs and `result` for their output, which is somewhat hard to
 read, especially when the elements are in a different order than 
their inputs.

To improve readability it should be possible to nest the different 
filters to define the inputs similar to how it was mentioned in 
https://github.com/w3c/svgwg/issues/257#issuecomment-245678506.
That means, the children and their order define which is the first 
input and which the second.

Example:
Instead of

```svg
<filter id="example">
  <feGaussianBlur stdDeviation="4" in="SourceAlpha" result="blur" />
  <feOffset result="offset" in="blur" dy="5" dx="5" />
  <feTurbulence numOctaves="1" baseFrequency="0.05" 
result="turbulence" in="SourceGraphic" />
  <feComposite result="composite" operator="in" in2="offset" 
in="turbulence" />
  <feComposite operator="xor" in="SourceGraphic" in2="composite" />
</filter>
```

you could then write


```svg
<filter id="example">
  <feComposite operator="xor" in="SourceGraphic">
    <feComposite operator="in">
      <feTurbulence numOctaves="1" baseFrequency="0.05" 
in="SourceGraphic" />
      <feOffset result="offset" dy="5" dx="5">
        <feGaussianBlur stdDeviation="4" in="SourceAlpha" />
      </feOffset>
    </feComposite>
  </feComposite>
</filter>
```

The six keywords would be kept as keywords.
If it's wished to stay consistent, they need to be turned into 
elements as well, which would then look like

```svg
<filter id="example">
  <feComposite operator="xor">
    <sourcegraphic />
    <feComposite operator="in">
      <feTurbulence numOctaves="1" baseFrequency="0.05">
        <sourcegraphic />
      </feTurbulence>
      <feOffset result="offset" dy="5" dx="5">
        <feGaussianBlur stdDeviation="4">
          <sourcealpha />
        </feGaussianBlur>
      </feOffset>
    </feComposite>
  </feComposite>
</filter>
```

Sebastian

Please view or discuss this issue at 
https://github.com/w3c/svgwg/issues/258 using your GitHub account

Received on Friday, 9 September 2016 06:35:23 UTC