haikuwebkit/LayoutTests/svg/as-background-image/svg-as-background-body.html

14 lines
433 B
HTML
Raw Permalink Normal View History

Fix body background image geometry calculation https://bugs.webkit.org/show_bug.cgi?id=112226 Reviewed by Stephen Chenney. Source/WebCore: Images that depend on a container size require a call to set the container size before rendering, and a call to look up the correct image during painting. The body's renderer is special in that it may not be the renderer that actually paints its background. This patch fixes a bug where the correct RenderObject was used for looking up the image, but not for setting the container size. This fixes SVG background images on body. Test: svg/as-background-image/svg-as-background-body.html * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::paintFillLayerExtended): (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry): This change introduces clientForBackgroundImage in the background geometry calculation. This is very similar to how the client is looked up in paintFillLayerExtended. * rendering/RenderBoxModelObject.h: The new signature for calculateBackgroundImageGeometry now mirrors paintFillLayerExtended, containing a parameter for the correct background renderer. (RenderBoxModelObject): LayoutTests: This test is required to have a repeating background, as we optimize non-repeating backgrounds so the bug is not hit. A light green color is used so the text is still readable, and gridlines are present to prove the correct container size is being used. * svg/as-background-image/svg-as-background-body-expected.html: Added. * svg/as-background-image/svg-as-background-body.html: Added. Canonical link: https://commits.webkit.org/130579@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@145726 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-03-13 17:01:55 +00:00
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='100px' height='100px'><rect width='100px' height='100px' fill='lightgreen' stroke='green' stroke-width='1px'/></svg>");
background-repeat: repeat;
}
</style>
</head>
<body>
Test for WK112226: This test passes if the body's background is light green with a green gridlines.
</body>
</html>