WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
51843
Implement repeating CSS3 gradients
https://bugs.webkit.org/show_bug.cgi?id=51843
Summary
Implement repeating CSS3 gradients
Simon Fraser (smfr)
Reported
2011-01-03 12:01:56 PST
CSS3 has repeating gradients, which need to be implemented.
Attachments
Patch
(443.90 KB, patch)
2011-01-05 12:39 PST
,
Simon Fraser (smfr)
hyatt
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Simon Fraser (smfr)
Comment 1
2011-01-05 12:39:27 PST
Created
attachment 78028
[details]
Patch
Dave Hyatt
Comment 2
2011-01-05 12:44:17 PST
Comment on
attachment 78028
[details]
Patch The 60 lines of code in addStops might be better off in a separate function. r=me though whatever you decide to do.
Simon Fraser (smfr)
Comment 3
2011-01-05 13:07:46 PST
http://trac.webkit.org/changeset/75097
Dirk Schulze
Comment 4
2011-01-07 08:36:15 PST
(In reply to
comment #3
)
>
http://trac.webkit.org/changeset/75097
Is it possible to pull this down to Gradient? This way platforms could benefit of their own implementations and we could reuse the code for SVG.
Simon Fraser (smfr)
Comment 5
2011-01-07 08:51:26 PST
(In reply to
comment #4
)
> (In reply to
comment #3
) > >
http://trac.webkit.org/changeset/75097
> > Is it possible to pull this down to Gradient? This way platforms could benefit of their own implementations and we could reuse the code for SVG.
No, because you have to know the size of the box being rendered into to know how many repeats you add. This cannot be in Gradient, because a single Gradient may be re-used to render to different places.
Dirk Schulze
Comment 6
2011-01-07 11:17:25 PST
(In reply to
comment #5
)
> (In reply to
comment #4
) > > (In reply to
comment #3
) > > >
http://trac.webkit.org/changeset/75097
> > > > Is it possible to pull this down to Gradient? This way platforms could benefit of their own implementations and we could reuse the code for SVG. > > No, because you have to know the size of the box being rendered into to know how many repeats you add. > > This cannot be in Gradient, because a single Gradient may be re-used to render to different places.
Hm. You're right, gradient should be as independent of the drawing area as possible to reuse it :-/ But you'Re adding the color stops manually, so reusing it might cause the gradient to be not-reusable as well. And what about adding supportsSpreadMethods() to Gradient and add a check CSSGradientValue::addStops? Platforms could decide for their own if they return true or false. setSpreadMethod is also able to handle more than just repeating and pad (default). Doesn't CSS support reflection as well (
http://doc.trolltech.com/4.7/qradialgradient.html
)?
Simon Fraser (smfr)
Comment 7
2011-01-07 11:26:28 PST
> Hm. You're right, gradient should be as independent of the drawing area as possible to reuse it :-/ But you're adding the color stops manually, so reusing it might cause the gradient to be not-reusable as well.
In CSSGradientValue I know that this Gradient is only used to render into boxes of a given size.
> And what about adding supportsSpreadMethods() to Gradient and add a check CSSGradientValue::addStops? Platforms could decide for their own if they return true or false. setSpreadMethod is also able to handle more than just repeating and pad (default). Doesn't CSS support reflection as well (
http://doc.trolltech.com/4.7/qradialgradient.html
)?
That sounds OK.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug