Bug 1232939 - Ensure the opaque region of a fixed background layer is correctly clipped. r=mstange

This commit is contained in:
Botond Ballo 2016-01-06 13:48:37 -05:00
Родитель 4c4a4a430a
Коммит 06cab0812a
4 изменённых файлов: 55 добавлений и 0 удалений

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

@ -3196,6 +3196,18 @@ void ContainerState::FinishPaintedLayerData(PaintedLayerData& aData, FindOpaqueB
FLB_LOG_PAINTED_LAYER_DECISION(data, " Selected painted layer=%p\n", layer.get());
}
// If the layer is a fixed background layer, the clip on the fixed background
// display item was not applied to the opaque region in
// ContainerState::ComputeOpaqueRect(), but was saved in data->mItemClip.
// Apply it to the opaque region now. Note that it's important to do this
// before the opaque region is propagated to the NewLayerEntry below.
if (data->mSingleItemFixedToViewport && data->mItemClip.HasClip()) {
nsRect clipRect = data->mItemClip.GetClipRect();
nsRect insideRoundedCorners = data->mItemClip.ApproximateIntersectInward(clipRect);
nsIntRect insideRoundedCornersScaled = ScaleToInsidePixels(insideRoundedCorners);
data->mOpaqueRegion.AndWith(insideRoundedCornersScaled);
}
if (mLayerBuilder->IsBuildingRetainedLayers()) {
newLayerEntry->mVisibleRegion = data->mVisibleRegion;
newLayerEntry->mOpaqueRegion = data->mOpaqueRegion;

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

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<style>
body {
height: 100%;
width: 100%;
background: red url('../bugs/repeatable-diagonal-gradient.png') no-repeat;
margin: 0px;
overflow: hidden;
}
div {
height:200px;
width: 1020px;
background: url('../bugs/repeatable-diagonal-gradient.png') no-repeat;
border-radius: 25px;
}
</style>
<body>
<div >
</div>
</body></html>

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

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<style>
body {
height: 100%;
width: 100%;
background: red url('../bugs/repeatable-diagonal-gradient.png') no-repeat fixed;
margin: 0px;
overflow: hidden;
}
div {
height:200px;
width: 1020px;
background: url('../bugs/repeatable-diagonal-gradient.png') no-repeat fixed;
border-radius: 25px;
}
</style>
<body>
<div >
</div>
</body></html>

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

@ -122,6 +122,7 @@ fails == background-size-zoom-repeat.html background-size-zoom-repeat-ref.html
== background-moz-default-background-color.html background-moz-default-background-color-ref.html
random-if(B2G||Mulet) == fixed-bg-with-transform-outside-viewport-1.html fixed-bg-with-transform-outside-viewport-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
fuzzy(2,83) == fixed-bg-border-radius.html fixed-bg-border-radius-ref.html
HTTP == root-background-1.html root-background-ref.html
HTTP != root-background-1.html about:blank