[Webkit-unassigned] [Bug 72103] box-shadow creates incorrect shadow when border-radius is too large

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 3 02:23:59 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=72103





--- Comment #25 from Takashi Sakamoto <tasak at google.com>  2012-08-03 02:23:57 PST ---
Thank you for reviewing.

(In reply to comment #22)
> (From update of attachment 156055 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=156055&action=review
> 
> > Source/WebCore/platform/graphics/Path.cpp:138
> > +        float maxRadiusWidth = std::max(topLeftRadius.width() + topRightRadius.width(), bottomLeftRadius.width() + bottomRightRadius.width());
> > +        float maxRadiusHeight = std::max(topLeftRadius.height() + bottomLeftRadius.height(), topRightRadius.height() + bottomRightRadius.height());
> 
> We normally put a 'using namespace std' at the top of the file, then use min() and max() without the namespace qualifier.
> 
> > Source/WebCore/platform/graphics/Path.cpp:148
> > +        float scale = maxRadiusWidth > maxRadiusHeight ? rect.width() / maxRadiusWidth : rect.height() / maxRadiusHeight;
> > +        FloatSize adjustedTopLeftRadius(topLeftRadius);
> > +        FloatSize adjustedTopRightRadius(topRightRadius);
> > +        FloatSize adjustedBottomLeftRadius(bottomLeftRadius);
> > +        FloatSize adjustedBottomRightRadius(bottomRightRadius);
> > +        adjustedTopLeftRadius.scale(scale);
> > +        adjustedTopRightRadius.scale(scale);
> > +        adjustedBottomLeftRadius.scale(scale);
> > +        adjustedBottomRightRadius.scale(scale);
> > +        addPathForRoundedRect(rect, adjustedTopLeftRadius, adjustedTopRightRadius, adjustedBottomLeftRadius, adjustedBottomRightRadius, strategy);
> 
> Is it appropriate to have this code here, where it affects all path drawing, rather than in rendering code? What is the impact on other uses, like SVG and canvas?
> 
> It might be better to make RoundedFloatRect, then have a utility method on it that does the radius scaling, so we can call it from anywhere.

I think, the code is just for fixing border-radius only when the radius is invalid. However, I reverted these codes and modified the renderer to fix this issue.

> 
> > LayoutTests/fast/borders/border-radius-larger-than-rect.html:12
> > +    background-color: red;
> 
> Please don't use red in a passing test. Also, make the divs bigger so the issue is more apparent.

I see. However I found that this test is not good for testing this issue. I recreated a new test from attached repro html.

Best regards,
Takashi Sakamoto

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list