Backed out 5 changesets (bug 1318266) for clipboard leaks a=backout

Backed out changeset a6d9ee58afd9 (bug 1318266)
Backed out changeset 47b22189955a (bug 1318266)
Backed out changeset 936cc01602c4 (bug 1318266)
Backed out changeset 95d7547ad1c3 (bug 1318266)
Backed out changeset a4c80aed15d8 (bug 1318266)
This commit is contained in:
Wes Kocher 2016-12-20 11:30:26 -08:00
parent 7c9afce020
commit aaaaf4e40c
8 changed files with 15 additions and 107 deletions

View File

@ -3885,15 +3885,6 @@ ContainerState::SetupMaskLayerForCSSMask(Layer* aLayer,
bool snap;
nsRect bounds = aMaskItem->GetBounds(mBuilder, &snap);
nsIntRect itemRect = ScaleToOutsidePixels(bounds, snap);
// Setup mask layer offset.
// We do not repaint mask for mask position change, so update base transform
// each time is required.
Matrix4x4 matrix;
matrix.PreTranslate(itemRect.x, itemRect.y, 0);
matrix.PreTranslate(mParameters.mOffset.x, mParameters.mOffset.y, 0);
maskLayer->SetBaseTransform(matrix);
CSSMaskLayerUserData newUserData(aMaskItem->Frame(), itemRect.Size());
nsRect dirtyRect;
if (!aMaskItem->IsInvalid(dirtyRect) && *oldUserData == newUserData) {
@ -3925,6 +3916,13 @@ ContainerState::SetupMaskLayerForCSSMask(Layer* aLayer,
return;
}
// Setup mask layer offset.
Matrix4x4 matrix;
matrix.PreTranslate(itemRect.x, itemRect.y, 0);
matrix.PreTranslate(mParameters.mOffset.x, mParameters.mOffset.y, 0);
maskLayer->SetBaseTransform(matrix);
RefPtr<ImageContainer> imgContainer =
imageData.CreateImageAndImageContainer();
if (!imgContainer) {
@ -4316,6 +4314,7 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList)
"If we have rounded rects, we must have a clip rect");
// It has its own layer. Update that layer's clip and visible rects.
ownLayer->SetClipRect(Nothing());
ownLayer->SetScrolledClip(Nothing());
if (layerClip.HasClip()) {
@ -4338,20 +4337,9 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList)
SetupMaskLayer(ownLayer, layerClip);
}
}
}
if (item->GetType() == nsDisplayItem::TYPE_MASK) {
MOZ_ASSERT(layerClip.GetRoundedRectCount() == 0);
} else if (item->GetType() == nsDisplayItem::TYPE_MASK) {
nsDisplayMask* maskItem = static_cast<nsDisplayMask*>(item);
SetupMaskLayerForCSSMask(ownLayer, maskItem);
nsDisplayItem* next = aList->GetBottom();
if (next && next->GetType() == nsDisplayItem::TYPE_SCROLL_INFO_LAYER) {
// Since we do build a layer for mask, there is no need for this
// scroll info layer anymore.
aList->RemoveBottom();
}
}
// Convert the visible rect to a region and give the item

View File

@ -7353,12 +7353,13 @@ bool nsDisplayMask::ShouldPaintOnMaskLayer(LayerManager* aManager)
nsSVGUtils::MaskUsage maskUsage;
nsSVGUtils::DetermineMaskUsage(mFrame, mHandleOpacity, maskUsage);
if (!maskUsage.shouldGenerateMaskLayer && !maskUsage.shouldApplyClipPath &&
if (!maskUsage.shouldGenerateMaskLayer &&
!maskUsage.shouldGenerateClipMaskLayer) {
return false;
}
if (maskUsage.opacity != 1.0 || maskUsage.shouldApplyBasicShape) {
if (maskUsage.opacity != 1.0 || maskUsage.shouldApplyClipPath ||
maskUsage.shouldApplyBasicShape) {
return false;
}

View File

@ -1,11 +0,0 @@
<!DOCTYPE html>
<html>
<style type="text/css">
div {
background: blue;
width: 100px;
height: 100px;
}
</style>
<div></div>
</html>

View File

@ -1,34 +0,0 @@
<!DOCTYPE html>
<html>
<title>Paint clip-path onto mask layer</title>
<style type="text/css">
#inner {
width: 200px;
height: 200px;
box-sizing:border-box;
background: blue;
/* make clip-path pained on mask layer */
border: 1px solid transparent;
will-change: transform;
}
#outer {
width: 200px;
height: 200px;
clip-path: url(#path);
/* make it fixed so that inner div has different AGR with outter div */
position: fixed;
}
</style>
<div id="outer">
<div id="inner"></div>
</div>
<svg height="0">
<defs>
<clipPath id="path">
<rect x="0" y="0" width="100" height="100"/>
</clipPath>
</defs>
</svg>
</html>

View File

@ -1,34 +0,0 @@
<!DOCTYPE html>
<html>
<title>Paint positioned mask onto mask layer</title>
<style type="text/css">
#inner {
width: 200px;
height: 200px;
box-sizing:border-box;
background: blue;
/* make mask pained on mask layer */
border: 1px solid transparent;
will-change: transform;
}
#outer {
width: 200px;
height: 200px;
mask-image: url(#mymask);
/* make it fixed so that inner div has different AGR with outter div */
position: fixed;
}
</style>
<div id="outer">
<div id="inner"></div>
</div>
<svg height="0">
<defs>
<mask id="mymask" x="0" y="0" width="1" height="1">
<rect x="0" y="0" width="100" height="100" fill="white"/>
</mask>
</defs>
</svg>
</html>

View File

@ -461,6 +461,3 @@ default-preferences
!= nested-mask-mode.svg about:blank
== mask-empty-size.svg about:blank
== paint-on-maskLayer-1a.html paint-on-maskLayer-1-ref.html
== paint-on-maskLayer-1b.html paint-on-maskLayer-1-ref.html

View File

@ -272,6 +272,8 @@ nsSVGClipPathFrame::GetClipMask(gfxContext& aReferenceContext,
SourceSurface* aExtraMask,
const Matrix& aExtraMasksTransform)
{
MOZ_ASSERT(!IsTrivial(), "Caller needs to use ApplyClipPath");
IntPoint offset;
RefPtr<DrawTarget> maskDT = CreateClipMask(aReferenceContext, offset);
if (!maskDT) {

View File

@ -756,7 +756,6 @@ nsSVGIntegrationUtils::PaintMask(const PaintFramesParams& aParams)
nsSVGUtils::DetermineMaskUsage(aParams.frame, aParams.handleOpacity,
maskUsage);
MOZ_ASSERT(maskUsage.shouldGenerateMaskLayer ||
maskUsage.shouldApplyClipPath ||
maskUsage.shouldGenerateClipMaskLayer);
nsIFrame* frame = aParams.frame;
@ -810,7 +809,7 @@ nsSVGIntegrationUtils::PaintMask(const PaintFramesParams& aParams)
}
// Paint clip-path onto ctx.
if (maskUsage.shouldGenerateClipMaskLayer || maskUsage.shouldApplyClipPath) {
if (maskUsage.shouldGenerateClipMaskLayer) {
matSR.Restore();
matSR.SetContext(&ctx);