Bug 41298

Summary: [Qt] Use HTML5-conformant gradient interpolation mode
Product: WebKit Reporter: Andreas Kling <kling>
Component: Layout and RenderingAssignee: QtWebKit Unassigned <webkit-qt-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue
Priority: P2 Keywords: Qt, QtTriaged
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Proposed patch none

Description Andreas Kling 2010-06-28 13:10:19 PDT
The default behavior of QLinearGradient conflicts with the HTML5 specification.
We should be doing per-component interpolation in linear rather than premultiplied space.

Tthere's an internal method, QGradient::setInterpolationMode() for exactly this purpose.

Quoth the spec: The color of the gradient at each stop is the color specified for that stop. Between each such stop, the colors and the alpha component must be linearly interpolated over the RGBA space without premultiplying the alpha value to find the color to use at that offset.

This fixes one in-tree test for Qt:
* canvas/philip/tests/2d.gradient.interpolate.colouralpha.html

Spec link:
http://www.whatwg.org/specs/web-apps/current-work/#colors-and-styles
Comment 1 Andreas Kling 2010-06-28 13:14:44 PDT
Created attachment 59927 [details]
Proposed patch
Comment 2 WebKit Commit Bot 2010-06-28 14:24:53 PDT
Comment on attachment 59927 [details]
Proposed patch

Clearing flags on attachment: 59927

Committed r62037: <http://trac.webkit.org/changeset/62037>
Comment 3 WebKit Commit Bot 2010-06-28 14:24:57 PDT
All reviewed patches have been landed.  Closing bug.