Bug 1311270 - Part 8. Compute background-clip:text clip region as no-clip.
MozReview-Commit-ID: HAytNoLaM2D
--- a/layout/painting/nsCSSRendering.cpp
+++ b/layout/painting/nsCSSRendering.cpp
@@ -1863,17 +1863,20 @@ nsCSSRendering::GetImageLayerClip(const
nsRect(aBorderArea.TopLeft() + toStrokeBoxOffset, clipArea.Size());
SetupDirtyRects(aClipState->mBGClipArea, aCallerDirtyRect,
aAppUnitsPerPixel, &aClipState->mDirtyRect,
&aClipState->mDirtyRectGfx);
return;
}
- if (layerClip == StyleGeometryBox::NoClip) {
+ // To prevent text-shape-mask been clipped out by border-box, we compute clip
+ // region of background-clip:text as no-clip.
+ if (layerClip == StyleGeometryBox::NoClip ||
+ layerClip == StyleGeometryBox::Text) {
aClipState->mBGClipArea = aCallerDirtyRect;
aClipState->mHasAdditionalBGClipArea = false;
aClipState->mCustomClip = false;
SetupDirtyRects(aClipState->mBGClipArea, aCallerDirtyRect,
aAppUnitsPerPixel, &aClipState->mDirtyRect,
&aClipState->mDirtyRectGfx);
return;
@@ -1932,18 +1935,17 @@ nsCSSRendering::GetImageLayerClip(const
aClipState->mAdditionalBGClipArea.Deflate(padding);
}
// Also clip at a non-scrolling, rounded-corner 'padding-box',
// same as the scrolled content because of the 'overflow' property.
layerClip = StyleGeometryBox::Padding;
}
- if (layerClip != StyleGeometryBox::Border &&
- layerClip != StyleGeometryBox::Text) {
+ if (layerClip != StyleGeometryBox::Border) {
nsMargin border = aForFrame->GetUsedBorder();
if (layerClip == StyleGeometryBox::MozAlmostPadding) {
// Reduce |border| by 1px (device pixels) on all sides, if
// possible, so that we don't get antialiasing seams between the
// {background|mask} and border.
border.top = std::max(0, border.top - aAppUnitsPerPixel);
border.right = std::max(0, border.right - aAppUnitsPerPixel);
border.bottom = std::max(0, border.bottom - aAppUnitsPerPixel);