[Webkit-unassigned] [Bug 112717] New: SVG filters aren't zoomed properly when used within CSS

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 19 10:51:27 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=112717

           Summary: SVG filters aren't zoomed properly when used within
                    CSS
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: SVG
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: sugoi at chromium.org
                CC: zimmermann at kde.org, krit at webkit.org,
                    senorblanco at chromium.org


SVG filters aren't zoomed properly when used within CSS. Here are 3 cases to illustrate the problem, the first 2 cases work and the 3rd one fails.

Case 1 - CSS :

HTML code :
<img style="-webkit-filter:blur(10px)" src="resources/reference.png">

What happens:
We create a BlurFilterOperation object and scale its values in StyleResolver::createFilterOperations() using the zoomFactor which is applied when calling convertToFloatLength(). The behavior is good.

Case 2 - SVG :

HTML code :
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width=160 height=300>
  <defs>
    <filter id="f1">
      <feGaussianBlur in="SourceGraphic" stdDeviation="10"/>
    </filter>
  </defs>
  <image x="0" y="0" width="160px" height="90px" xlink:href="resources/reference.png" filter="url(#f1)"/>
</svg>

What happens :
We create a SVGFilter object and use SVGFilter::applyHorizontalScale() and SVGFilter::applyVerticalScale() to apply the zoom factor. The behavior is good.

Case 3 - SVG within CSS :

HTML code :
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="0" height="0">
  <defs>
    <filter id="f1">
      <feGaussianBlur stdDeviation="10"/>
    </filter>
  </defs>
</svg>
<img style="-webkit-filter: url(#f1); filter: url(#f1);" src="resources/reference.png">

What happens :
We create a SVG Filter inside a CSS. This does not create a SVGFilter object, but creates the base class Filter object instead (It creates a REFERENCE filter operation within FilterEffectRenderer::build()). Since the base class functions Filter::applyHorizontalScale() and Filter::applyVerticalScale() have no information about the zoom, the blur kernel size is not scaled and the behavior is wrong.

Blur is just an example. All filters that require an adjustment for the zoom factor are most likely also wrong.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list