From b1c920605196f6e3fab07b150fec84a2fa25cb49 Mon Sep 17 00:00:00 2001 From: FranklinDM Date: Tue, 20 Jun 2023 20:01:52 +0800 Subject: [PATCH] Issue #2112 - Part 4: Remove Stylo support for mask-image --- layout/style/ServoBindings.cpp | 10 ------- layout/style/nsRuleNode.cpp | 52 +++------------------------------- layout/style/nsRuleNode.h | 3 -- 3 files changed, 4 insertions(+), 61 deletions(-) diff --git a/layout/style/ServoBindings.cpp b/layout/style/ServoBindings.cpp index ed21093ba3..e0aeba4135 100644 --- a/layout/style/ServoBindings.cpp +++ b/layout/style/ServoBindings.cpp @@ -244,16 +244,6 @@ Gecko_GetServoDeclarationBlock(RawGeckoElementBorrowed aElement) return nullptr; } -void -Gecko_FillAllBackgroundLists(nsStyleImageLayers* aLayers, uint32_t aMaxLen) -{ -} - -void -Gecko_FillAllMaskLists(nsStyleImageLayers* aLayers, uint32_t aMaxLen) -{ -} - template static nsIAtom* AtomAttrValue(Implementor* aElement, nsIAtom* aName) diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index 1fa6166f27..8540726079 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -7404,8 +7404,8 @@ FillImageLayerPositionCoordList( /* static */ void -nsRuleNode::FillAllBackgroundLists(nsStyleImageLayers& aImage, - uint32_t aMaxItemCount) +nsRuleNode::FillAllMaskLists(nsStyleImageLayers& aImage, + uint32_t aMaxItemCount) { // Delete any extra items. We need to keep layers in which any // property was specified. @@ -7560,7 +7560,7 @@ nsRuleNode::ComputeBackgroundData(void* aStartStruct, conditions); if (rebuild) { - FillAllBackgroundLists(bg->mImage, maxItemCount); + FillAllMaskLists(bg->mImage, maxItemCount); } COMPUTE_END_RESET(Background, bg) @@ -9479,50 +9479,6 @@ SetSVGOpacity(const nsCSSValue& aValue, } } -/* static */ -void -nsRuleNode::FillAllMaskLists(nsStyleImageLayers& aMask, - uint32_t aMaxItemCount) -{ - - // Delete any extra items. We need to keep layers in which any - // property was specified. - aMask.mLayers.TruncateLengthNonZero(aMaxItemCount); - - uint32_t fillCount = aMask.mImageCount; - - FillImageLayerList(aMask.mLayers, - &nsStyleImageLayers::Layer::mImage, - aMask.mImageCount, fillCount); - FillImageLayerList(aMask.mLayers, - &nsStyleImageLayers::Layer::mSourceURI, - aMask.mImageCount, fillCount); - FillImageLayerList(aMask.mLayers, - &nsStyleImageLayers::Layer::mRepeat, - aMask.mRepeatCount, fillCount); - FillImageLayerList(aMask.mLayers, - &nsStyleImageLayers::Layer::mClip, - aMask.mClipCount, fillCount); - FillImageLayerList(aMask.mLayers, - &nsStyleImageLayers::Layer::mOrigin, - aMask.mOriginCount, fillCount); - FillImageLayerPositionCoordList(aMask.mLayers, - &Position::mXPosition, - aMask.mPositionXCount, fillCount); - FillImageLayerPositionCoordList(aMask.mLayers, - &Position::mYPosition, - aMask.mPositionYCount, fillCount); - FillImageLayerList(aMask.mLayers, - &nsStyleImageLayers::Layer::mSize, - aMask.mSizeCount, fillCount); - FillImageLayerList(aMask.mLayers, - &nsStyleImageLayers::Layer::mMaskMode, - aMask.mMaskModeCount, fillCount); - FillImageLayerList(aMask.mLayers, - &nsStyleImageLayers::Layer::mComposite, - aMask.mCompositeCount, fillCount); -} - const void* nsRuleNode::ComputeSVGData(void* aStartStruct, const nsRuleData* aRuleData, @@ -10257,7 +10213,7 @@ nsRuleNode::ComputeSVGResetData(void* aStartStruct, svgReset->mMask.mCompositeCount, maxItemCount, rebuild, conditions); if (rebuild) { - FillAllBackgroundLists(svgReset->mMask, maxItemCount); + FillAllMaskLists(svgReset->mMask, maxItemCount); } COMPUTE_END_RESET(SVGReset, svgReset) diff --git a/layout/style/nsRuleNode.h b/layout/style/nsRuleNode.h index f9e71618b0..49fa8a027b 100644 --- a/layout/style/nsRuleNode.h +++ b/layout/style/nsRuleNode.h @@ -1067,9 +1067,6 @@ public: // Fill unspecified layers by cycling through their values // till they all are of length aMaxItemCount - static void FillAllBackgroundLists(nsStyleImageLayers& aLayers, - uint32_t aMaxItemCount); - static void FillAllMaskLists(nsStyleImageLayers& aLayers, uint32_t aMaxItemCount);