Bug 41298 - [Qt] Use HTML5-conformant gradient interpolation mode
Summary: [Qt] Use HTML5-conformant gradient interpolation mode
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: QtWebKit Unassigned
Keywords: Qt, QtTriaged
Depends on:
Reported: 2010-06-28 13:10 PDT by Andreas Kling
Modified: 2010-06-28 14:24 PDT (History)
1 user (show)

See Also:

Proposed patch (2.54 KB, patch)
2010-06-28 13:14 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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:
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.