summaryrefslogtreecommitdiffstats
path: root/layout/base/nsDisplayList.cpp
diff options
context:
space:
mode:
authoryami <34216515+kn-yami@users.noreply.github.com>2018-12-16 16:17:20 +0100
committeryami <34216515+kn-yami@users.noreply.github.com>2019-02-02 18:06:10 +0100
commitb241a84d884293e1ce49a79c75e362c02c0899f9 (patch)
tree4d1df04790cc8c785141e8dd8ffea9e6da5a0c02 /layout/base/nsDisplayList.cpp
parentfa311a4cae5ea526e848adc4f49c6aa0b700702c (diff)
downloadUXP-b241a84d884293e1ce49a79c75e362c02c0899f9.tar
UXP-b241a84d884293e1ce49a79c75e362c02c0899f9.tar.gz
UXP-b241a84d884293e1ce49a79c75e362c02c0899f9.tar.lz
UXP-b241a84d884293e1ce49a79c75e362c02c0899f9.tar.xz
UXP-b241a84d884293e1ce49a79c75e362c02c0899f9.zip
issue #908 - implement missing parts of CSS mask
Diffstat (limited to 'layout/base/nsDisplayList.cpp')
-rw-r--r--layout/base/nsDisplayList.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp
index 2b9ad7ff8..d619576ba 100644
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -3014,7 +3014,7 @@ nsDisplayBackgroundImage::ComputeVisibility(nsDisplayListBuilder* aBuilder,
/* static */ nsRegion
nsDisplayBackgroundImage::GetInsideClipRegion(nsDisplayItem* aItem,
- uint8_t aClip,
+ StyleGeometryBox aClip,
const nsRect& aRect,
const nsRect& aBackgroundRect)
{
@@ -3028,10 +3028,10 @@ nsDisplayBackgroundImage::GetInsideClipRegion(nsDisplayItem* aItem,
if (frame->GetType() == nsGkAtoms::canvasFrame) {
nsCanvasFrame* canvasFrame = static_cast<nsCanvasFrame*>(frame);
clipRect = canvasFrame->CanvasArea() + aItem->ToReferenceFrame();
- } else if (aClip == NS_STYLE_IMAGELAYER_CLIP_PADDING ||
- aClip == NS_STYLE_IMAGELAYER_CLIP_CONTENT) {
+ } else if (aClip == StyleGeometryBox::Padding ||
+ aClip == StyleGeometryBox::Content) {
nsMargin border = frame->GetUsedBorder();
- if (aClip == NS_STYLE_IMAGELAYER_CLIP_CONTENT) {
+ if (aClip == StyleGeometryBox::Content) {
border += frame->GetUsedPadding();
}
border.ApplySkipSides(frame->GetSkipSides());
@@ -3064,7 +3064,7 @@ nsDisplayBackgroundImage::GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
if (layer.mImage.IsOpaque() && layer.mBlendMode == NS_STYLE_BLEND_NORMAL &&
layer.mRepeat.mXRepeat != NS_STYLE_IMAGELAYER_REPEAT_SPACE &&
layer.mRepeat.mYRepeat != NS_STYLE_IMAGELAYER_REPEAT_SPACE &&
- layer.mClip != NS_STYLE_IMAGELAYER_CLIP_TEXT) {
+ layer.mClip != StyleGeometryBox::Text) {
result = GetInsideClipRegion(this, layer.mClip, mBounds, mBackgroundRect);
}
}
@@ -3143,9 +3143,9 @@ nsDisplayBackgroundImage::PaintInternal(nsDisplayListBuilder* aBuilder,
CheckForBorderItem(this, flags);
gfxContext* ctx = aCtx->ThebesContext();
- uint8_t clip = mBackgroundStyle->mImage.mLayers[mLayer].mClip;
+ StyleGeometryBox clip = mBackgroundStyle->mImage.mLayers[mLayer].mClip;
- if (clip == NS_STYLE_IMAGELAYER_CLIP_TEXT) {
+ if (clip == StyleGeometryBox::Text) {
if (!GenerateAndPushTextMask(mFrame, aCtx, mBackgroundRect, aBuilder)) {
return;
}
@@ -3161,7 +3161,7 @@ nsDisplayBackgroundImage::PaintInternal(nsDisplayListBuilder* aBuilder,
image::DrawResult result =
nsCSSRendering::PaintBackground(params);
- if (clip == NS_STYLE_IMAGELAYER_CLIP_TEXT) {
+ if (clip == StyleGeometryBox::Text) {
ctx->PopGroupAndBlend();
}
@@ -3583,8 +3583,8 @@ nsDisplayBackgroundColor::Paint(nsDisplayListBuilder* aBuilder,
nsLayoutUtils::RectToGfxRect(mBackgroundRect,
mFrame->PresContext()->AppUnitsPerDevPixel());
- uint8_t clip = mBackgroundStyle->mImage.mLayers[0].mClip;
- if (clip == NS_STYLE_IMAGELAYER_CLIP_TEXT) {
+ StyleGeometryBox clip = mBackgroundStyle->mImage.mLayers[0].mClip;
+ if (clip == StyleGeometryBox::Text) {
if (!GenerateAndPushTextMask(mFrame, aCtx, mBackgroundRect, aBuilder)) {
return;
}
@@ -3618,7 +3618,7 @@ nsDisplayBackgroundColor::GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
const nsStyleImageLayers::Layer& bottomLayer = mBackgroundStyle->BottomLayer();
- if (bottomLayer.mClip == NS_STYLE_IMAGELAYER_CLIP_TEXT) {
+ if (bottomLayer.mClip == StyleGeometryBox::Text) {
return nsRegion();
}