Bug 44392

Summary: [Qt] Gradient: Support inner radius larger than outer radius
Product: WebKit Reporter: Andreas Kling <kling>
Component: Layout and RenderingAssignee: QtWebKit Unassigned <webkit-qt-unassigned>
Status: RESOLVED FIXED    
Severity: Normal Keywords: HTML5, Qt, QtTriaged
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Proposed patch
none
Proposed patch v2 ariya.hidayat: review+

Description Andreas Kling 2010-08-21 22:09:08 PDT
We should reverse the gradient if the inner radius is larger than the outer one.

This is relevant both for CSS and the CanvasGradient API.

Example pages with apparent missing support:
- http://www.kaleidoscopeapp.com/
- http://graphicpeel.com/cssiosicons

Fixing this will also cause us to pass the following tests:
- canvas/philip/tests/2d.gradient.radial.outside2.html
- canvas/philip/tests/2d.gradient.radial.outside3.html
Comment 1 Andreas Kling 2010-08-21 22:14:57 PDT
Created attachment 65047 [details]
Proposed patch
Comment 2 Andreas Kling 2010-08-22 00:07:58 PDT
Created attachment 65049 [details]
Proposed patch v2

Updated patch addressing comments from Ariya on IRC.
Comment 3 Ariya Hidayat 2010-08-22 00:15:10 PDT
Comment on attachment 65049 [details]
Proposed patch v2

LGTM.re=me.

Minor issue:


WebCore/platform/graphics/qt/GradientQt.cpp:76
 +          if (m_radial && !qFuzzyCompare(outerRadius, qreal(0))) {
Should be qFuzzyCompare(1 + outerRadius, qreal(1)).
Comment 4 Andreas Kling 2010-08-22 01:39:32 PDT
Committed r65783: <http://trac.webkit.org/changeset/65783>