[webkit-reviews] review granted: [Bug 51979] Fix percentage values in radius of radial gradients : [Attachment 78094] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 5 21:00:53 PST 2011


Darin Adler <darin at apple.com> has granted Simon Fraser (smfr)
<simon.fraser at apple.com>'s request for review:
Bug 51979: Fix percentage values in radius of radial gradients
https://bugs.webkit.org/show_bug.cgi?id=51979

Attachment 78094: Patch
https://bugs.webkit.org/attachment.cgi?id=78094&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
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.


More information about the webkit-reviews mailing list