After porting ContextShadow to Mac, I sees some combinations of border-radius and shadow blur that it mis-renders. Example coming.
Created attachment 77081 [details] Testcase
I think the top of ContextShadow::drawRectShadow() should read: float radiusTwice = m_blurDistance * 2; // Size of the tiling side. int sideTileWidth = 1; // Find the extra space needed from the curve of the corners. int extraWidthFromCornerRadii = radiusTwice + max(topLeftRadius.width(), bottomLeftRadius.width()) + radiusTwice + max(topRightRadius.width(), bottomRightRadius.width()); int extraHeightFromCornerRadii = radiusTwice + max(topLeftRadius.height(), topRightRadius.height()) + radiusTwice + max(bottomLeftRadius.height(), bottomRightRadius.height()); // The length of a side of the buffer is the enough space for four blur radii, // the radii of the corners, and then 1 pixel to draw the side tiles. IntSize shadowTemplateSize = IntSize(sideTileWidth + extraWidthFromCornerRadii, sideTileWidth + extraHeightFromCornerRadii); // drawShadowedRect still does not work with rotations. // https://bugs.webkit.org/show_bug.cgi?id=45042 CGContextRef cgContext = context->platformContext(); if ((!context->getCTM().isIdentityOrTranslationOrFlipped()) || (shadowTemplateSize.width() > rect.width()) || (shadowTemplateSize.height() > rect.height()) || (m_type != BlurShadow)) { drawRectShadowWithoutTiling(cgContext, rect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius, 1); return; }
(In reply to comment #1) > Created an attachment (id=77081) [details] > Testcase Yep, it fails for me also in webkitgtk, we had solved this issues I guess in some of the refactorings before applying the patch we did not check it correctly.
Created attachment 77099 [details] Proposed patch
(In reply to comment #2) > I think the top of ContextShadow::drawRectShadow() should read: > > [...] > > if ((!context->getCTM().isIdentityOrTranslationOrFlipped()) || (shadowTemplateSize.width() > rect.width()) > || (shadowTemplateSize.height() > rect.height()) || (m_type != BlurShadow)) { > drawRectShadowWithoutTiling(cgContext, rect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius, 1); > return; > } You are right, the problem is the calculation of the internal space required for the corner shadows, I've refactored the code with your proposal in the patch. Thanks.
Comment on attachment 77099 [details] Proposed patch Great, though we should definitely include the test case with pixel results to avoid this in the future.
Created attachment 77327 [details] Patch
Comment on attachment 77327 [details] Patch Thank you!
Landed http://trac.webkit.org/changeset/75237