haikuwebkit/LayoutTests/tiled-drawing/fixed-layout-size-fixed-att...

23 lines
367 B
HTML
Raw Permalink Normal View History

REGRESSION (r172417, r184065): Multiple rendering issues with fixed attached background-image https://bugs.webkit.org/show_bug.cgi?id=147049 <rdar://problem/21110936> Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2015-07-21 Reviewed by Simon Fraser. Source/WebCore: The fixed-attached background-image rendering is special. In general, to display it, the destinationSize should be set to visibleContentSize. The destinationLocation should be set such that the background-image does not move with scrolling. The topContentInset should be subtracted from the destinationLocation such that background-image can be rendered blurred in the topContentArea. However there are cases in which these rules have to be changed. -- destinationSize: In the case of fixed layout size, the fixedLayoutSize is bigger than the visibleContentSize. In this case, if the background-image belongs to the root element, the destinationSize has to be set to fixedLayoutSize. Otherwise it has to be set to the borderBoxSize unless the overflow is hidden. -- destinationLocation: If the background-image belongs to the root element, no scroll offset to added to destinationLocation. For non-root element case, FrameView::documentScrollOffsetRelativeToViewOrigin() should be used if no page scaling is applied. Otherwise FrameView::scrollOffsetForFixedPosition() should be used instead. Tests: platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-cover.html platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-local.html * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry): Ensure the geometry for the fixed-attached background-image is calculated correctly. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateGeometry): Ensure the background layer gets the correct size for the fixedLayoutSize mode. LayoutTests: fixedLayoutSize background-image rendering for root and non-root elements. * platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-cover-expected.html: Added. * platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-cover.html: Added. * platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-local-expected.html: Added. * platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-local.html: Added. Canonical link: https://commits.webkit.org/165196@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@187116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-07-21 19:56:24 +00:00
<html>
<head>
<style>
body {
margin: 0;
}
.container {
height: 2000px;
overflow: hidden;
width: 50%;
height: 50%;
background-image: url('resources/green-blue.png');
background-attachment: fixed;
background-repeat: no-repeat;
background-size: 300px;
}
</style>
</head>
<body>
<div class="container"></div>
</body>
</html>