<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - SVGFilterBuilder should drive the builtin sourceAlpha from the passed sourceGraphic"
   href="https://bugs.webkit.org/show_bug.cgi?id=144137">144137</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>SVGFilterBuilder should drive the builtin sourceAlpha from the passed sourceGraphic
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>528+ (Nightly build)
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>SVG
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>sabouhallawa&#64;apple.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>zimmermann&#64;kde.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=251526" name="attach_251526" title="test case">attachment 251526</a> <a href="attachment.cgi?id=251526&amp;action=edit" title="test case">[details]</a></span>
test case

Open the attached test case.

Result: A black square is displayed.
Expected: A lime square should be displayed.

When creating the SVGFilterBuilder, we create a SourceAlpha object from the current SourceGraphic. We should create the SourceAlpha from the previousEffect. If there is no effect applied before, the previousEffect will be the sourceGraphic.

In the attached test case. Here is what is happening:

1. A lime &lt;div&gt; is created.
2. On top of it, a red &lt;div&gt; is created. But two filter are applied to this &lt;div&gt;
   a. The first filter is css opacity(0) filter, which results a transparent square (the alpha bytes are all zeros)
   b. The second filter is an SVG filter which merges the SourceAlpha of the filter with the existing drawing.

The bug happens because we create the SourceAlpha of the SVGFilterBuilder from the current SourceGraphic. And since the current SourceGraphic is a lime square, the sourceAlpha will be black square (the r, g, b are zeros but a is 1). So when it is merged with the existing drawing it draws a black square.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>