mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 07:18:39 +09:00
issue #908 - implement missing parts of CSS mask
This commit is contained in:
parent
7b5e5f85de
commit
b5376e63c5
28 changed files with 574 additions and 449 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue