WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
51979
Fix percentage values in radius of radial gradients
https://bugs.webkit.org/show_bug.cgi?id=51979
Summary
Fix percentage values in radius of radial gradients
Simon Fraser (smfr)
Reported
2011-01-05 20:50:27 PST
We don't correctly handle % radii for -webkit-radial-gradient.
Attachments
Patch
(86.82 KB, patch)
2011-01-05 20:56 PST
,
Simon Fraser (smfr)
darin
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Simon Fraser (smfr)
Comment 1
2011-01-05 20:56:37 PST
Created
attachment 78094
[details]
Patch
Darin Adler
Comment 2
2011-01-05 21:00:53 PST
Comment on
attachment 78094
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=78094&action=review
> WebCore/css/CSSGradientValue.cpp:603 > -float CSSRadialGradientValue::resolveRadius(CSSPrimitiveValue* radius, RenderStyle* style, RenderStyle* rootStyle) > +float CSSRadialGradientValue::resolveRadius(CSSPrimitiveValue* radius, RenderStyle* style, RenderStyle* rootStyle, float widthOrHeight, bool allowPercentage)
If you make it const float* widthOrHeightForPercentage then you could pass 0 to mean percentage is not allowed. Sadly, you can’t take a pointer to the width or height function result of a FloatSize. Another idea would be to use NAN to mean there is no width or height to compute the percentage of.
> WebCore/css/CSSGradientValue.cpp:723 > + secondRadius = resolveRadius(m_endHorizontalSize.get(), renderer->style(), rootStyle, size.width(), true); > + aspectRatio = secondRadius / resolveRadius(m_endVerticalSize.get(), renderer->style(), rootStyle, size.height(), true);
The true here is mysterious. This usually pushes us to use enums or some alternate design that avoids a mystery bool.
Simon Fraser (smfr)
Comment 3
2011-01-05 21:28:40 PST
http://trac.webkit.org/changeset/75136
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