Bug 41484 - [Qt] Clamp color stops passed to QGradient to 1.0
Summary: [Qt] Clamp color stops passed to QGradient to 1.0
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: QtWebKit Unassigned
Keywords: Qt, QtTriaged
Depends on:
Blocks: 35784
  Show dependency treegraph
Reported: 2010-07-01 14:15 PDT by Andreas Kling
Modified: 2010-07-26 06:55 PDT (History)
2 users (show)

See Also:

Proposed patch (1.34 KB, patch)
2010-07-01 14:18 PDT, Andreas Kling
vestbo: review-
vestbo: commit-queue-
Details | Formatted Diff | Diff
Proposed patch v2 (1.33 KB, patch)
2010-07-01 14:24 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-07-01 14:15:55 PDT
The conversion between HTML5 gradients and QRadialGradient values can overflow a tiny bit (1.00000002 anyone?)
QGradient::addColorStop() will silently (release builds) ignore these color stops.
Comment 1 Andreas Kling 2010-07-01 14:18:49 PDT
Created attachment 60285 [details]
Proposed patch
Comment 2 Andreas Kling 2010-07-01 14:20:16 PDT
Oops, that's QGradient::setColorAt(). addColorStop() is the CanvasGradient counterpart.
Comment 3 Tor Arne Vestbø 2010-07-01 14:24:20 PDT
Comment on attachment 60285 [details]
Proposed patch

qMin(lastStop, 1.0f)
Comment 4 Andreas Kling 2010-07-01 14:24:47 PDT
Created attachment 60287 [details]
Proposed patch v2

*cough* Updated to use qMin() for less fugliness.
Comment 5 Tor Arne Vestbø 2010-07-01 14:27:03 PDT
Comment on attachment 60287 [details]
Proposed patch v2

Comment 6 Andreas Kling 2010-07-01 14:28:00 PDT
(In reply to comment #5)
> <3

Comment 7 WebKit Commit Bot 2010-07-01 20:51:37 PDT
Comment on attachment 60287 [details]
Proposed patch v2

Clearing flags on attachment: 60287

Committed r62353: <http://trac.webkit.org/changeset/62353>
Comment 8 WebKit Commit Bot 2010-07-01 20:51:43 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Andreas Kling 2010-07-26 05:57:55 PDT
Adding as release blocker since it fixes display artifacts on some popular canvas demos.
Comment 10 Simon Hausmann 2010-07-26 06:55:35 PDT
Revision r62353 cherry-picked into qtwebkit-2.0 with commit 6621e196cc9e867434eab580b02fe1dee1d9141e