Bug 1203190 - Don't intersect with the visible rect for fixed background images. r=mattwoodrow

--HG--
rename : layout/reftests/async-scrolling/bg-fixed-child-clip.html => layout/reftests/async-scrolling/bg-fixed-child-clip-1.html
rename : layout/reftests/async-scrolling/bg-fixed-child-clip.html => layout/reftests/async-scrolling/bg-fixed-child-clip-2.html
extra : commitid : 4qr8EJSuYrt
This commit is contained in:
Markus Stange 2015-09-25 14:40:52 +02:00
Родитель b1713a8478
Коммит b42b780ed9
4 изменённых файлов: 34 добавлений и 6 удалений

Просмотреть файл

@ -3962,11 +3962,18 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList)
bounds = fixedToViewportClip.ApplyNonRoundedIntersection(bounds);
((nsRect&)mAccumulatedChildBounds).UnionRect(mAccumulatedChildBounds, bounds);
#endif
// We haven't computed visibility at this point, so item->GetVisibleRect()
// is just the dirty rect that item was initialized with. We intersect it
// with the clipped item bounds to get a tighter visible rect.
nsIntRect itemVisibleRect = itemDrawRect.Intersect(
ScaleToOutsidePixels(item->GetVisibleRect(), false));
nsIntRect itemVisibleRect = itemDrawRect;
if (!shouldFixToViewport) {
// We haven't computed visibility at this point, so item->GetVisibleRect()
// is just the dirty rect that item was initialized with. We intersect it
// with the clipped item bounds to get a tighter visible rect.
// However, we don't do this for fixed background images, because their
// clips can move asynchronously so we want the layer to contain the
// whole bounds of the display item.
itemVisibleRect = itemVisibleRect.Intersect(
ScaleToOutsidePixels(item->GetVisibleRect(), false));
}
if (maxLayers != -1 && layerCount >= maxLayers) {
forceInactive = true;

Просмотреть файл

@ -0,0 +1,20 @@
<!DOCTYPE HTML>
<html reftest-async-scroll
reftest-displayport-x="0" reftest-displayport-y="0"
reftest-displayport-w="800" reftest-displayport-h="2000"
reftest-async-scroll-x="0" reftest-async-scroll-y="50">
<body style="overflow:hidden; height:3000px; margin:0;">
<div style="margin-top: 100px; height: 100px;
position: relative;">
<div style="position: absolute;
top: 0; right: 0; bottom: 0; left: 0;
background-image:url(repeatable-diagonal-gradient.png);
background-attachment:fixed;
background-repeat:no-repeat;
background-position:top left;">
</div>
</div>
<!-- test that the clip of a background-attachment:fixed background of a
child element moves correctly during async scrolling -->
</body>
</html>

Просмотреть файл

@ -3,7 +3,8 @@ skip-if(!asyncPan) == bg-fixed-cover-1.html bg-fixed-cover-1-ref.html
skip-if(!asyncPan) == bg-fixed-cover-2.html bg-fixed-cover-2-ref.html
skip-if(!asyncPan) == bg-fixed-cover-3.html bg-fixed-cover-3-ref.html
skip-if(!asyncPan) == bg-fixed-child.html bg-fixed-child-ref.html
skip-if(!asyncPan) == bg-fixed-child-clip.html bg-fixed-child-clip-ref.html
skip-if(!asyncPan) == bg-fixed-child-clip-1.html bg-fixed-child-clip-ref.html
skip-if(!asyncPan) == bg-fixed-child-clip-2.html bg-fixed-child-clip-ref.html
skip-if(!asyncPan) == bg-fixed-child-mask.html bg-fixed-child-mask-ref.html
skip-if(!asyncPan) == element-1.html element-1-ref.html
pref(layers.force-active,true) skip-if(!asyncPan) == iframe-1.html iframe-1-ref.html