[Webkit-unassigned] [Bug 35219] New: SVG stroke gradients do not render on axis-aligned paths

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Feb 21 14:06:42 PST 2010


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

           Summary: SVG stroke gradients do not render on axis-aligned
                    paths
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh Intel
        OS/Version: Mac OS X 10.6
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: SVG
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: mbostock at cs.stanford.edu


Created an attachment (id=49170)
 --> (https://bugs.webkit.org/attachment.cgi?id=49170)
Test case with horizontal and vertical gradients.

When a linearGradient stroke is applied to a path or polyline element, the
gradient will fail to render if the bounding box of the path has zero width or
zero height. (Presumably, because a divide-by-zero occurs.) This is the case
for axis-aligned paths and polylines, such as <path stroke="url(#gradient)"
stroke-width="100" d="M0 50L300 50"/>.

According to the SVG specification: "When stroking is performed using a complex
paint server, such as a gradient or a pattern, the stroke operation must be
identical to the result that would have occurred if the geometric shape defined
by the geometry of the current graphics element and its associated stroking
properties were converted to an equivalent 'path' element and then filled using
the given paint server."

Thus, the expected behavior is that the stroke gradient is rendered correctly,
with the orientation is determined by the bounding box of that path's *stroke*
(rather than its fill), such as <path fill="url(#gradient)" d="M0 0L0 100 300
100 300 0Z"/>. Instead, the actual behavior is that the path is stroked with
opaque black.

Opera passes this test. Firefox produces the same (black) output as WebKit, and
Batik renders white. A simple workaround is to offset one of the line
coordinates, so the path is not axis-aligned, e.g., <path
stroke="url(#gradient)" stroke-width="100" d="M0 49.999L300 50"/>.

-- 
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