Created attachment 371919 [details] test case [cairo][SVG] If clipPath has multiple elements, clip-path coordinate system is wrongly scaled in high DPI This test case is created by doubling a rect element in clipPath element of svg/foreignObject/clip.html.
Created attachment 371920 [details] [Screenshot] WinCairo port in 150% DPI display
Created attachment 371925 [details] WIP patch
Comment on attachment 371925 [details] WIP patch View in context: https://bugs.webkit.org/attachment.cgi?id=371925&action=review > Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp:88 > + // Reset the current matrix because the mask surface doesn't have a matrix. > + cairo_matrix_t matrix; > + cairo_get_matrix(m_cr.get(), &matrix); > + cairo_identity_matrix(m_cr.get()); > cairo_mask_surface(m_cr.get(), maskInformation.maskSurface(), maskRect.x(), maskRect.y()); > + cairo_set_matrix(m_cr.get(), &matrix); This works for svg, but not for other users of GraphicsContext::clipToImageBuffer() like shadow blur, for example. It seems that svg is the only one using absolute coordinates. Removing: AffineTransform absoluteTransform = SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem(renderer); from RenderSVGResourceClipper::applyClippingToContext and using the identity fixes the test case too. Or keeping the absolute transform but setting the device scale factor in the image buffer cairo surface.
You can try with fast/box-shadow/box-shadow-transformed.html for example
*** This bug has been marked as a duplicate of bug 198746 ***