haikuwebkit/LayoutTests/svg/clip-path/clip-path-on-overflowing-ex...

13 lines
430 B
HTML
Raw Permalink Normal View History

Hovering over countries at https://covidinc.io/ shows bizarre rendering artifacts https://bugs.webkit.org/show_bug.cgi?id=209635 <rdar://problem/60935010> Reviewed by Said Abou-Hallawa. Source/WebCore: RenderSVGResourceClipper::applyClippingToContext() cached an ImageBuffer per RenderObject when using a image buffer mask. However, the function created and rendered into this image buffer using repaintRect, which can change between invocations. Painting with different repaintRects is very common when rendering into page tiles. The buffer can only be re-used if the inputs used to create the buffer (objectBoundingBox, absoluteTransform) are the same, so store those and compare them when determining when to use the cached buffer, and don't use repaintRect when setting up the buffer. This revealed another problem where renderers with visual overflow could be truncated by the clipping, tested by imported/mozilla/svg/svg-integration/clipPath-html-03.xhtml, which occurred because RenderLayer::setupClipPath() used the 'svgReferenceBox' for the clipping bounds, which is the content box of the renderer excluding overflow. Fix this by using the bounds of the layer, which includes the bounds of descendants. Tests: svg/clip-path/clip-path-on-overflowing.html svg/clip-path/resource-clipper-multiple-repaints.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::setupClipPath): * rendering/svg/RenderSVGResourceClipper.cpp: (WebCore::RenderSVGResourceClipper::removeAllClientsFromCache): (WebCore::RenderSVGResourceClipper::applyClippingToContext): (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage): (WebCore::RenderSVGResourceClipper::addRendererToClipper): (WebCore::RenderSVGResourceClipper::resourceBoundingBox): * rendering/svg/RenderSVGResourceClipper.h: LayoutTests: Ref test that exercises the code path by painting into a tiled compositing layer. * svg/clip-path/clip-path-on-overflowing-expected.html: Added. * svg/clip-path/clip-path-on-overflowing.html: Added. * svg/clip-path/mask-nested-clip-path-010-expected.svg: * svg/clip-path/mask-nested-clip-path-010.svg: Copied from imported/mozilla/svg/svg-integration/clipPath-html-03.xhtml, and modified to have a non-zero offset for better testing of the clipping bounds computation. * svg/clip-path/resource-clipper-multiple-repaints-expected.html: Added. * svg/clip-path/resource-clipper-multiple-repaints.html: Added. Canonical link: https://commits.webkit.org/222604@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259137 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-27 20:57:41 +00:00
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div style="margin: 123px; position: relative">
<div style="width:200px; height:150px; background:lime;"></div>
<div style="position: absolute; left: 100px; top: 150px; width:100px; height:100px; background:lime;"></div>
<div style="position: absolute; left: 100px; top: 200px; width:100px; height:100px; background:blue;"></div>
</div>
</body>
</html>