зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1459890 - Do not clip mask for clip path to bbox of clipped content. r=mstange
MozReview-Commit-ID: 9yZ1ziiDAKa --HG-- extra : rebase_source : 945b2048b31843c27cd21c19374cb7f61ea62be5
This commit is contained in:
Родитель
08c017397c
Коммит
d3215239ec
|
@ -2710,7 +2710,8 @@ ComputeClipForMaskItem(nsDisplayListBuilder* aBuilder, nsIFrame* aMaskedFrame,
|
|||
nsSVGUtils::eBBoxIncludeClipped |
|
||||
nsSVGUtils::eBBoxIncludeFill |
|
||||
nsSVGUtils::eBBoxIncludeMarkers |
|
||||
nsSVGUtils::eBBoxIncludeStroke);
|
||||
nsSVGUtils::eBBoxIncludeStroke |
|
||||
nsSVGUtils::eDoNotClipToBBoxOfContentInsideClipPath);
|
||||
combinedClip = Some(cssToDevMatrix.TransformBounds(result));
|
||||
} else {
|
||||
// The code for this case is adapted from ComputeMaskGeometry().
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="786" viewBox="0,0,512,512">
|
||||
<defs>
|
||||
<filter id="filter-wVmTgUOU" filterUnits="objectBoundingBox" x="-30%" y="-30%" width="160%" height="170%" color-interpolation-filters="sRGB">
|
||||
<feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0" in="SourceGraphic"/>
|
||||
<feOffset dy="28"/>
|
||||
<feGaussianBlur stdDeviation="18.67" result="blur1"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<g filter="url(#filter-wVmTgUOU)">
|
||||
<rect x="58.88" y="58.88" width="394.24" height="394.24" color="#07773e" fill="red"/>
|
||||
</g>
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 627 B |
|
@ -0,0 +1,17 @@
|
|||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="786" viewBox="0,0,512,512">
|
||||
<defs>
|
||||
<clipPath id="clip-vXP8Ybe5">
|
||||
<path d="M0,512v-512h512v512z"/>
|
||||
</clipPath>
|
||||
<filter id="filter-wVmTgUOU" filterUnits="objectBoundingBox" x="-30%" y="-30%" width="160%" height="170%" color-interpolation-filters="sRGB">
|
||||
<feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0" in="SourceGraphic"/>
|
||||
<feOffset dy="28"/>
|
||||
<feGaussianBlur stdDeviation="18.67" result="blur1"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<g clip-path="url(#clip-vXP8Ybe5)">
|
||||
<g filter="url(#filter-wVmTgUOU)">
|
||||
<rect x="58.88" y="58.88" width="394.24" height="394.24" color="#07773e" fill="red"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 762 B |
|
@ -55,6 +55,8 @@ pref(layout.css.mix-blend-mode.enabled,true) == blend-normal.svg blend-normal-re
|
|||
#skip-if(Android) pref(layout.css.mix-blend-mode.enabled,true) == blend-soft-light.svg blend-soft-light-ref.svg
|
||||
skip-if(Android) pref(layout.css.mix-blend-mode.enabled,true) fails-if(webrender) == blend-difference-stacking.html blend-difference-stacking-ref.html
|
||||
|
||||
fuzzy(11,7155) == blur-inside-clipPath.svg blur-inside-clipPath-ref.svg
|
||||
|
||||
== border-radius-01.html pass.svg
|
||||
|
||||
== clip-01.svg pass.svg
|
||||
|
|
|
@ -475,7 +475,8 @@ nsSVGClipPathFrame::GetClipPathTransform(nsIFrame* aClippedFrame)
|
|||
|
||||
SVGBBox
|
||||
nsSVGClipPathFrame::GetBBoxForClipPathFrame(const SVGBBox &aBBox,
|
||||
const gfxMatrix &aMatrix)
|
||||
const gfxMatrix &aMatrix,
|
||||
uint32_t aFlags)
|
||||
{
|
||||
nsIContent* node = GetContent()->GetFirstChild();
|
||||
SVGBBox unionBBox, tmpBBox;
|
||||
|
@ -494,10 +495,12 @@ nsSVGClipPathFrame::GetBBoxForClipPathFrame(const SVGBBox &aBBox,
|
|||
nsSVGClipPathFrame *clipPathFrame =
|
||||
effectProperties.GetClipPathFrame();
|
||||
if (clipPathFrame) {
|
||||
tmpBBox = clipPathFrame->GetBBoxForClipPathFrame(tmpBBox, aMatrix);
|
||||
tmpBBox = clipPathFrame->GetBBoxForClipPathFrame(tmpBBox, aMatrix, aFlags);
|
||||
}
|
||||
}
|
||||
tmpBBox.Intersect(aBBox);
|
||||
if (!(aFlags & nsSVGUtils::eDoNotClipToBBoxOfContentInsideClipPath)) {
|
||||
tmpBBox.Intersect(aBBox);
|
||||
}
|
||||
unionBBox.UnionEdges(tmpBBox);
|
||||
}
|
||||
}
|
||||
|
@ -511,7 +514,7 @@ nsSVGClipPathFrame::GetBBoxForClipPathFrame(const SVGBBox &aBBox,
|
|||
} else {
|
||||
nsSVGClipPathFrame *clipPathFrame = props.GetClipPathFrame();
|
||||
if (clipPathFrame) {
|
||||
tmpBBox = clipPathFrame->GetBBoxForClipPathFrame(aBBox, aMatrix);
|
||||
tmpBBox = clipPathFrame->GetBBoxForClipPathFrame(aBBox, aMatrix, aFlags);
|
||||
unionBBox.Intersect(tmpBBox);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -132,7 +132,8 @@ public:
|
|||
#endif
|
||||
|
||||
SVGBBox GetBBoxForClipPathFrame(const SVGBBox& aBBox,
|
||||
const gfxMatrix& aMatrix);
|
||||
const gfxMatrix& aMatrix,
|
||||
uint32_t aFlags);
|
||||
|
||||
/**
|
||||
* If the clipPath element transforms its children due to
|
||||
|
|
|
@ -1181,7 +1181,7 @@ nsSVGUtils::GetBBox(nsIFrame* aFrame, uint32_t aFlags,
|
|||
}
|
||||
matrix = clipContent->PrependLocalTransformsTo(matrix, eUserSpaceToParent);
|
||||
bbox =
|
||||
clipPathFrame->GetBBoxForClipPathFrame(bbox, matrix).ToThebesRect();
|
||||
clipPathFrame->GetBBoxForClipPathFrame(bbox, matrix, aFlags).ToThebesRect();
|
||||
}
|
||||
|
||||
if (hasClip) {
|
||||
|
|
|
@ -412,6 +412,9 @@ public:
|
|||
// this flag is set; Otherwise, getBBox returns the union bounds in
|
||||
// the coordinate system formed by the <use> element.
|
||||
eUseUserSpaceOfUseElement = 1 << 9,
|
||||
// For a frame with a clip-path, if this flag is set then the result
|
||||
// will not be clipped to the bbox of the content inside the clip-path.
|
||||
eDoNotClipToBBoxOfContentInsideClipPath = 1 << 10,
|
||||
};
|
||||
/**
|
||||
* This function in primarily for implementing the SVG DOM function getBBox()
|
||||
|
|
Загрузка…
Ссылка в новой задаче