Bug 44392 - [Qt] Gradient: Support inner radius larger than outer radius
Summary: [Qt] Gradient: Support inner radius larger than outer radius
Status: RESOLVED FIXED
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
URL:
Keywords: HTML5, Qt, QtTriaged
Depends on:
Blocks:
 
Reported: 2010-08-21 22:09 PDT by Andreas Kling
Modified: 2010-08-22 01:39 PDT (History)
0 users

See Also:


Attachments
Proposed patch (3.60 KB, patch)
2010-08-21 22:14 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff
Proposed patch v2 (3.68 KB, patch)
2010-08-22 00:07 PDT, Andreas Kling
ariya.hidayat: review+
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-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>