WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-229915-20210904095328.patch (text/plain), 32.62 KB, created by
Simon Fraser (smfr)
on 2021-09-04 09:53:28 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2021-09-04 09:53:28 PDT
Size:
32.62 KB
patch
obsolete
>Subversion Revision: 281996 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 3991b5f0669d43d807c3334fac3bc52808bef4ac..d7894cdef6dabf4292347e7ea7e040b7abf7d7ba 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,64 @@ >+2021-09-04 Simon Fraser <simon.fraser@apple.com> >+ >+ Add a temporarily prefixed property for mask-mode, aliased to -webkit-mask-source-type >+ https://bugs.webkit.org/show_bug.cgi?id=229915 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ In preparation for unprefixing the "mask" property, add -webkit-mask-mode. This is >+ almost an alias to the existing -webkit-mask-source-type, but takes a "match-source" >+ value rather than "auto". >+ >+ To make it easier to have aliases with different parsing requirements, add support >+ in CSSProperties.json for "synonyms"; these are like aliases but they get their >+ own CSSPropertyID to allow for customized parsing. They share style builder code >+ with the related property. >+ >+ FillLayer now uses MaskMode rather than MaskSourceType. >+ >+ Test: fast/masking/parsing-mask-mode.html >+ >+ * css/CSSComputedStyleDeclaration.cpp: >+ (WebCore::maskSourceTypeToCSSValue): >+ (WebCore::maskModeToCSSValue): >+ (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): >+ (WebCore::fillSourceTypeToCSSValue): Deleted. >+ * css/CSSProperties.json: >+ * css/CSSToStyleMap.cpp: >+ (WebCore::CSSToStyleMap::mapFillMaskMode): >+ (WebCore::CSSToStyleMap::mapFillMaskSourceType): Deleted. >+ * css/CSSToStyleMap.h: >+ * css/CSSValueKeywords.in: >+ * css/makeprop.pl: >+ (addProperty): >+ (generateFillLayerPropertyValueSetter): >+ (generateValueSetter): >+ * css/parser/CSSPropertyParser.cpp: >+ (WebCore::consumeWebkitMaskMode): >+ (WebCore::consumeBackgroundComponent): >+ (WebCore::CSSPropertyParser::parseSingleValue): >+ * rendering/RenderBoxModelObject.cpp: >+ (WebCore::RenderBoxModelObject::paintFillLayerExtended): >+ * rendering/style/FillLayer.cpp: >+ (WebCore::FillLayer::FillLayer): >+ (WebCore::FillLayer::operator=): >+ (WebCore::FillLayer::operator== const): >+ (WebCore::operator<<): >+ * rendering/style/FillLayer.h: >+ (WebCore::FillLayer::maskMode const): >+ (WebCore::FillLayer::isMaskModeSet const): >+ (WebCore::FillLayer::setMaskMode): >+ (WebCore::FillLayer::clearMaskMode): >+ (WebCore::FillLayer::initialFillMaskMode): >+ (WebCore::FillLayer::maskSourceType const): Deleted. >+ (WebCore::FillLayer::isMaskSourceTypeSet const): Deleted. >+ (WebCore::FillLayer::setMaskSourceType): Deleted. >+ (WebCore::FillLayer::clearMaskSourceType): Deleted. >+ (WebCore::FillLayer::initialFillMaskSourceType): Deleted. >+ * rendering/style/RenderStyleConstants.cpp: >+ (WebCore::operator<<): >+ * rendering/style/RenderStyleConstants.h: >+ > 2021-09-03 Peng Liu <peng.liu6@apple.com> > > [iOS] Media playback continues after backgrounding Safari >diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >index 62bb144eec79f2a4c540dcd53f17c9005eb8db95..8f4b71d913326a700d81ac69d380cfcb5cdaa9a0 100644 >--- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >@@ -1700,15 +1700,34 @@ static Ref<CSSValue> fillRepeatToCSSValue(FillRepeat xRepeat, FillRepeat yRepeat > return list; > } > >-static Ref<CSSValue> fillSourceTypeToCSSValue(MaskSourceType type) >+static Ref<CSSValue> maskSourceTypeToCSSValue(MaskMode type) > { > switch (type) { >- case MaskSourceType::Alpha: >+ case MaskMode::Alpha: > return CSSValuePool::singleton().createValue(CSSValueAlpha); >- default: >- ASSERT(type == MaskSourceType::Luminance); >+ case MaskMode::Luminance: >+ ASSERT(type == MaskMode::Luminance); > return CSSValuePool::singleton().createValue(CSSValueLuminance); >+ case MaskMode::MatchSource: >+ // MatchSource is only available in the mask-mode property. >+ return CSSValuePool::singleton().createValue(CSSValueAlpha); > } >+ ASSERT_NOT_REACHED(); >+ return CSSValuePool::singleton().createValue(CSSValueAlpha); >+} >+ >+static Ref<CSSValue> maskModeToCSSValue(MaskMode type) >+{ >+ switch (type) { >+ case MaskMode::Alpha: >+ return CSSValuePool::singleton().createValue(CSSValueAlpha); >+ case MaskMode::Luminance: >+ return CSSValuePool::singleton().createValue(CSSValueLuminance); >+ case MaskMode::MatchSource: >+ return CSSValuePool::singleton().createValue(CSSValueMatchSource); >+ } >+ ASSERT_NOT_REACHED(); >+ return CSSValuePool::singleton().createValue(CSSValueMatchSource); > } > > static Ref<CSSValue> fillSizeToCSSValue(const FillSize& fillSize, const RenderStyle& style) >@@ -2616,10 +2635,19 @@ RefPtr<CSSValue> ComputedStyleExtractor::valueForPropertyInStyle(const RenderSty > case CSSPropertyWebkitMaskSourceType: { > auto& layers = style.maskLayers(); > if (!layers.next()) >- return fillSourceTypeToCSSValue(layers.maskSourceType()); >+ return maskSourceTypeToCSSValue(layers.maskMode()); >+ auto list = CSSValueList::createCommaSeparated(); >+ for (auto* currLayer = &layers; currLayer; currLayer = currLayer->next()) >+ list->append(maskSourceTypeToCSSValue(currLayer->maskMode())); >+ return list; >+ } >+ case CSSPropertyWebkitMaskMode: { >+ auto& layers = style.maskLayers(); >+ if (!layers.next()) >+ return maskModeToCSSValue(layers.maskMode()); > auto list = CSSValueList::createCommaSeparated(); > for (auto* currLayer = &layers; currLayer; currLayer = currLayer->next()) >- list->append(fillSourceTypeToCSSValue(currLayer->maskSourceType())); >+ list->append(maskModeToCSSValue(currLayer->maskMode())); > return list; > } > case CSSPropertyWebkitBackgroundComposite: >diff --git a/Source/WebCore/css/CSSProperties.json b/Source/WebCore/css/CSSProperties.json >index 72d716d9c0e5f9d253d114869b7d8884c4497451..04186e5853ca11a9bfd0ee4116a6f9899c4886dd 100644 >--- a/Source/WebCore/css/CSSProperties.json >+++ b/Source/WebCore/css/CSSProperties.json >@@ -149,7 +149,13 @@ > "as seen when one is seen. This could enforce the 'last-one-wins' rule.", > "", > "* aliases:", >- "An array of the alternative names for this property.", >+ "An array of the alternative names for this property. Aliases are folded at", >+ "parse time and don't have their own CSSPropertyID.", >+ "", >+ "* synonym:", >+ "An alternative name for this property that gets its own CSSPropertyID.", >+ "This allows parsing code to handle differences in allowed values.", >+ "Style builder code is shared with the original property.", > "", > "* enable-if:", > "Indicates that code should only be generated for this property/value if the", >@@ -6327,6 +6333,16 @@ > "url": "https://www.w3.org/TR/css-masking-1/#propdef-mask-image" > } > }, >+ "-webkit-mask-mode": { >+ "codegen-properties": { >+ "name-for-methods": "MaskMode", >+ "fill-layer-property": true >+ }, >+ "specification": { >+ "category": "css-masking", >+ "url": "https://www.w3.org/TR/css-masking-1/#propdef-mask-mode" >+ } >+ }, > "-webkit-mask-origin": { > "codegen-properties": { > "name-for-methods": "Origin", >@@ -6425,8 +6441,8 @@ > }, > "-webkit-mask-source-type": { > "codegen-properties": { >- "name-for-methods": "MaskSourceType", >- "fill-layer-property": true >+ "synonym": "-webkit-mask-mode", >+ "comment": "Deprecated alias for mask-mode, supports an 'auto' value, does not support 'match-source'" > }, > "status": "non-standard" > , >diff --git a/Source/WebCore/css/CSSToStyleMap.cpp b/Source/WebCore/css/CSSToStyleMap.cpp >index bfd1affab4c54b6e5a871331296a682310347caa..bcfda052ea79307e14fd5478a0ca9cf9cfd00e65 100644 >--- a/Source/WebCore/css/CSSToStyleMap.cpp >+++ b/Source/WebCore/css/CSSToStyleMap.cpp >@@ -264,11 +264,11 @@ void CSSToStyleMap::mapFillYPosition(CSSPropertyID propertyID, FillLayer& layer, > layer.setBackgroundYOrigin(*pair->first()); > } > >-void CSSToStyleMap::mapFillMaskSourceType(CSSPropertyID propertyID, FillLayer& layer, const CSSValue& value) >+void CSSToStyleMap::mapFillMaskMode(CSSPropertyID propertyID, FillLayer& layer, const CSSValue& value) > { >- MaskSourceType type = FillLayer::initialFillMaskSourceType(layer.type()); >+ MaskMode maskMode = FillLayer::initialFillMaskMode(layer.type()); > if (value.treatAsInitialValue(propertyID)) { >- layer.setMaskSourceType(type); >+ layer.setMaskMode(maskMode); > return; > } > >@@ -277,18 +277,23 @@ void CSSToStyleMap::mapFillMaskSourceType(CSSPropertyID propertyID, FillLayer& l > > switch (downcast<CSSPrimitiveValue>(value).valueID()) { > case CSSValueAlpha: >- type = MaskSourceType::Alpha; >+ maskMode = MaskMode::Alpha; > break; > case CSSValueLuminance: >- type = MaskSourceType::Luminance; >+ maskMode = MaskMode::Luminance; >+ break; >+ case CSSValueMatchSource: >+ ASSERT(propertyID == CSSPropertyWebkitMaskMode); >+ maskMode = MaskMode::MatchSource; > break; > case CSSValueAuto: >+ ASSERT(propertyID == CSSPropertyWebkitMaskSourceType); > break; > default: > ASSERT_NOT_REACHED(); > } > >- layer.setMaskSourceType(type); >+ layer.setMaskMode(maskMode); > } > > void CSSToStyleMap::mapAnimationDelay(Animation& animation, const CSSValue& value) >diff --git a/Source/WebCore/css/CSSToStyleMap.h b/Source/WebCore/css/CSSToStyleMap.h >index a1c4421bab4c39aa27d12c454905b7b551b40e49..51e481a78009758c5be5da1cae810538de5e8ee6 100644 >--- a/Source/WebCore/css/CSSToStyleMap.h >+++ b/Source/WebCore/css/CSSToStyleMap.h >@@ -57,7 +57,7 @@ public: > void mapFillSize(CSSPropertyID, FillLayer&, const CSSValue&); > void mapFillXPosition(CSSPropertyID, FillLayer&, const CSSValue&); > void mapFillYPosition(CSSPropertyID, FillLayer&, const CSSValue&); >- void mapFillMaskSourceType(CSSPropertyID, FillLayer&, const CSSValue&); >+ void mapFillMaskMode(CSSPropertyID, FillLayer&, const CSSValue&); > > void mapAnimationDelay(Animation&, const CSSValue&); > void mapAnimationDirection(Animation&, const CSSValue&); >diff --git a/Source/WebCore/css/CSSValueKeywords.in b/Source/WebCore/css/CSSValueKeywords.in >index 6cbaeba97ff5ad145124d0b579efd68b30fd199f..d221c9089bda6c795e64bbe0e21f6635fe0bb44c 100644 >--- a/Source/WebCore/css/CSSValueKeywords.in >+++ b/Source/WebCore/css/CSSValueKeywords.in >@@ -1544,6 +1544,11 @@ selector > // normal > compact > >+// mask-type, mask-mode >+// alpha >+// luminance >+match-source >+ > // rotate > x > y >diff --git a/Source/WebCore/css/makeprop.pl b/Source/WebCore/css/makeprop.pl >index 565e3dc72487e810c67dadb36e68857ca4c45277..311528ab809db514c19566210cf694be7d40b3fb 100755 >--- a/Source/WebCore/css/makeprop.pl >+++ b/Source/WebCore/css/makeprop.pl >@@ -117,6 +117,8 @@ my %styleBuilderOptions = ( > ); > my %nameToId; > my %nameToAliases; >+my %synonyms; >+my %namesToSynonyms; > my %relatedProperty; > > for my $name (@allNames) { >@@ -298,6 +300,9 @@ sub addProperty($$) > $relatedProperty{$name} = $codegenProperties->{"related-property"} > } elsif ($codegenOptionName eq "aliases") { > $nameToAliases{$name} = $codegenProperties->{"aliases"}; >+ } elsif ($codegenOptionName eq "synonym") { >+ $synonyms{$name} = 1; >+ push @{$namesToSynonyms{$codegenProperties->{"synonym"}}}, $name; > } elsif ($styleBuilderOptions{$codegenOptionName}) { > $propertiesWithStyleBuilderOptions{$name}{$codegenOptionName} = $codegenProperties->{$codegenOptionName}; > } elsif ($codegenOptionName eq "internal-only") { >@@ -1179,8 +1184,6 @@ sub generateFillLayerPropertyValueSetter { > my $name = shift; > my $indent = shift; > >- my $CSSPropertyId = "CSSProperty" . $nameToId{$name}; >- > my $setterContent = ""; > $setterContent .= $indent . "auto* child = &builderState.style()." . getLayersAccessorFunction($name) . "();\n"; > $setterContent .= $indent . "FillLayer* previousChild = nullptr;\n"; >@@ -1191,12 +1194,12 @@ sub generateFillLayerPropertyValueSetter { > $setterContent .= $indent . " previousChild->setNext(FillLayer::create(" . getFillLayerType($name) . "));\n"; > $setterContent .= $indent . " child = previousChild->next();\n"; > $setterContent .= $indent . " }\n"; >- $setterContent .= $indent . " builderState.styleMap()." . getFillLayerMapfunction($name) . "(" . $CSSPropertyId . ", *child, item);\n"; >+ $setterContent .= $indent . " builderState.styleMap()." . getFillLayerMapfunction($name) . "(property, *child, item);\n"; > $setterContent .= $indent . " previousChild = child;\n"; > $setterContent .= $indent . " child = child->next();\n"; > $setterContent .= $indent . " }\n"; > $setterContent .= $indent . "} else {\n"; >- $setterContent .= $indent . " builderState.styleMap()." . getFillLayerMapfunction($name) . "(" . $CSSPropertyId . ", *child, value);\n"; >+ $setterContent .= $indent . " builderState.styleMap()." . getFillLayerMapfunction($name) . "(property, *child, value);\n"; > $setterContent .= $indent . " child = child->next();\n"; > $setterContent .= $indent . "}\n"; > $setterContent .= $indent . "for (; child; child = child->next())\n"; >@@ -1296,8 +1299,13 @@ sub generateValueSetter { > my $indent = shift; > > my $setterContent = ""; >- $setterContent .= $indent . "static void applyValue" . $nameToId{$name} . "(BuilderState& builderState, CSSValue& value)\n"; >+ $setterContent .= $indent . "static void applyValue" . $nameToId{$name} . "(CSSPropertyID property, BuilderState& builderState, CSSValue& value)\n"; > $setterContent .= $indent . "{\n"; >+ >+ if (!exists $propertiesWithStyleBuilderOptions{$name}{"fill-layer-property"}) { >+ $setterContent .= $indent . " UNUSED_PARAM(property);\n"; >+ } >+ > my $convertedValue; > if (exists($propertiesWithStyleBuilderOptions{$name}{"converter"})) { > $convertedValue = "BuilderConverter::convert" . $propertiesWithStyleBuilderOptions{$name}{"converter"} . "(builderState, value)"; >@@ -1374,6 +1382,7 @@ foreach my $name (@names) { > # Skip Shorthand properties and properties that do not use the StyleBuilder. > next if (exists $propertiesWithStyleBuilderOptions{$name}{"longhands"}); > next if (exists $propertiesWithStyleBuilderOptions{$name}{"skip-builder"}); >+ next if (exists $synonyms{$name}); > > my $indent = " "; > if (!$propertiesWithStyleBuilderOptions{$name}{"custom"}{"Initial"}) { >@@ -1408,7 +1417,14 @@ void BuilderGenerated::applyProperty(CSSPropertyID property, BuilderState& build > EOF > > foreach my $name (@names) { >+ next if (exists $synonyms{$name}); >+ > print STYLEBUILDER " case CSSProperty" . $nameToId{$name} . ":\n"; >+ >+ foreach my $synonym (@{$namesToSynonyms{$name}}) { >+ print STYLEBUILDER " case CSSProperty" . $nameToId{$synonym} . ":\n"; >+ } >+ > if (exists $propertiesWithStyleBuilderOptions{$name}{"longhands"}) { > print STYLEBUILDER " ASSERT(isShorthandCSSProperty(property));\n"; > print STYLEBUILDER " ASSERT_NOT_REACHED();\n"; >@@ -1418,7 +1434,13 @@ foreach my $name (@names) { > print STYLEBUILDER " else if (isInherit)\n"; > print STYLEBUILDER " " . getScopeForFunction($name, "Inherit") . "::applyInherit" . $nameToId{$name} . "(builderState);\n"; > print STYLEBUILDER " else\n"; >- print STYLEBUILDER " " . getScopeForFunction($name, "Value") . "::applyValue" . $nameToId{$name} . "(builderState, value);\n"; >+ >+ my $scope = getScopeForFunction($name, "Value"); >+ if ($scope eq "BuilderFunctions") { >+ print STYLEBUILDER " " . $scope . "::applyValue" . $nameToId{$name} . "(property, builderState, value);\n"; >+ } else { >+ print STYLEBUILDER " " . $scope . "::applyValue" . $nameToId{$name} . "(builderState, value);\n"; >+ } > } > print STYLEBUILDER " break;\n"; > } >diff --git a/Source/WebCore/css/parser/CSSPropertyParser.cpp b/Source/WebCore/css/parser/CSSPropertyParser.cpp >index 5c41c3676ea6d992ab79ea3a969d68b128213120..da093d5632b2d601fb26f1cbffeb054488f1f025 100644 >--- a/Source/WebCore/css/parser/CSSPropertyParser.cpp >+++ b/Source/WebCore/css/parser/CSSPropertyParser.cpp >@@ -3072,6 +3072,11 @@ static RefPtr<CSSPrimitiveValue> consumeWebkitMaskSourceType(CSSParserTokenRange > return consumeIdent<CSSValueAuto, CSSValueAlpha, CSSValueLuminance>(range); > } > >+static RefPtr<CSSPrimitiveValue> consumeWebkitMaskMode(CSSParserTokenRange& range) >+{ >+ return consumeIdent<CSSValueAlpha, CSSValueLuminance, CSSValueMatchSource>(range); >+} >+ > static RefPtr<CSSPrimitiveValue> consumePrefixedBackgroundBox(CSSPropertyID property, CSSParserTokenRange& range, const CSSParserContext& /*context*/) > { > // The values 'border', 'padding' and 'content' are deprecated and do not apply to the version of the property that has the -webkit- prefix removed. >@@ -3147,6 +3152,8 @@ static RefPtr<CSSValue> consumeBackgroundComponent(CSSPropertyID property, CSSPa > case CSSPropertyBackgroundImage: > case CSSPropertyWebkitMaskImage: > return consumeImageOrNone(range, context); >+ case CSSPropertyWebkitMaskMode: >+ return consumeWebkitMaskMode(range); > case CSSPropertyWebkitMaskSourceType: > return consumeWebkitMaskSourceType(range); > case CSSPropertyBackgroundPositionX: >@@ -4408,6 +4415,7 @@ RefPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID property, CSS > case CSSPropertyWebkitMaskPositionX: > case CSSPropertyWebkitMaskPositionY: > case CSSPropertyWebkitMaskSize: >+ case CSSPropertyWebkitMaskMode: > case CSSPropertyWebkitMaskSourceType: > return consumeCommaSeparatedBackgroundComponent(property, m_range, m_context); > case CSSPropertyWebkitMaskRepeatX: >diff --git a/Source/WebCore/rendering/RenderBoxModelObject.cpp b/Source/WebCore/rendering/RenderBoxModelObject.cpp >index 3f90b6bf8e194649552d52f1373f4cd7ce1f85f5..5f12e21d3ccae8a4e737caa3a5d0a810ba7ccef8 100644 >--- a/Source/WebCore/rendering/RenderBoxModelObject.cpp >+++ b/Source/WebCore/rendering/RenderBoxModelObject.cpp >@@ -973,7 +973,7 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co > geometry.clip(LayoutRect(pixelSnappedRect)); > RefPtr<Image> image; > if (!geometry.destRect().isEmpty() && (image = bgImage->image(backgroundObject ? backgroundObject : this, geometry.tileSize()))) { >- context.setDrawLuminanceMask(bgLayer.maskSourceType() == MaskSourceType::Luminance); >+ context.setDrawLuminanceMask(bgLayer.maskMode() == MaskMode::Luminance); > > if (is<BitmapImage>(image)) > downcast<BitmapImage>(*image).updateFromSettings(settings()); >diff --git a/Source/WebCore/rendering/style/FillLayer.cpp b/Source/WebCore/rendering/style/FillLayer.cpp >index 46e3e8a4cf9f9eaf65edeba010114aa5c8e23724..0486f2231a4ce6839a723fce81ea30d41050a4b3 100644 >--- a/Source/WebCore/rendering/style/FillLayer.cpp >+++ b/Source/WebCore/rendering/style/FillLayer.cpp >@@ -65,7 +65,7 @@ FillLayer::FillLayer(FillLayerType type) > , m_composite(static_cast<unsigned>(FillLayer::initialFillComposite(type))) > , m_sizeType(static_cast<unsigned>(FillSizeType::None)) > , m_blendMode(static_cast<unsigned>(FillLayer::initialFillBlendMode(type))) >- , m_maskSourceType(static_cast<unsigned>(FillLayer::initialFillMaskSourceType(type))) >+ , m_maskMode(static_cast<unsigned>(FillLayer::initialFillMaskMode(type))) > , m_imageSet(false) > , m_attachmentSet(false) > , m_clipSet(false) >@@ -80,7 +80,7 @@ FillLayer::FillLayer(FillLayerType type) > , m_backgroundYOrigin(static_cast<unsigned>(Edge::Top)) > , m_compositeSet(type == FillLayerType::Mask) > , m_blendModeSet(false) >- , m_maskSourceTypeSet(false) >+ , m_maskModeSet(false) > , m_type(static_cast<unsigned>(type)) > { > } >@@ -98,7 +98,7 @@ FillLayer::FillLayer(const FillLayer& o) > , m_composite(o.m_composite) > , m_sizeType(o.m_sizeType) > , m_blendMode(o.m_blendMode) >- , m_maskSourceType(o.m_maskSourceType) >+ , m_maskMode(o.m_maskMode) > , m_imageSet(o.m_imageSet) > , m_attachmentSet(o.m_attachmentSet) > , m_clipSet(o.m_clipSet) >@@ -113,7 +113,7 @@ FillLayer::FillLayer(const FillLayer& o) > , m_backgroundYOrigin(o.m_backgroundYOrigin) > , m_compositeSet(o.m_compositeSet) > , m_blendModeSet(o.m_blendModeSet) >- , m_maskSourceTypeSet(o.m_maskSourceTypeSet) >+ , m_maskModeSet(o.m_maskModeSet) > , m_type(o.m_type) > { > if (o.m_next) >@@ -148,7 +148,7 @@ FillLayer& FillLayer::operator=(const FillLayer& o) > m_repeatX = o.m_repeatX; > m_repeatY = o.m_repeatY; > m_sizeType = o.m_sizeType; >- m_maskSourceType = o.m_maskSourceType; >+ m_maskMode = o.m_maskMode; > > m_imageSet = o.m_imageSet; > m_attachmentSet = o.m_attachmentSet; >@@ -160,7 +160,7 @@ FillLayer& FillLayer::operator=(const FillLayer& o) > m_repeatYSet = o.m_repeatYSet; > m_xPosSet = o.m_xPosSet; > m_yPosSet = o.m_yPosSet; >- m_maskSourceTypeSet = o.m_maskSourceTypeSet; >+ m_maskModeSet = o.m_maskModeSet; > > m_type = o.m_type; > >@@ -175,7 +175,7 @@ bool FillLayer::operator==(const FillLayer& o) const > && m_backgroundXOrigin == o.m_backgroundXOrigin && m_backgroundYOrigin == o.m_backgroundYOrigin > && m_attachment == o.m_attachment && m_clip == o.m_clip && m_composite == o.m_composite > && m_blendMode == o.m_blendMode && m_origin == o.m_origin && m_repeatX == o.m_repeatX >- && m_repeatY == o.m_repeatY && m_sizeType == o.m_sizeType && m_maskSourceType == o.m_maskSourceType >+ && m_repeatY == o.m_repeatY && m_sizeType == o.m_sizeType && m_maskMode == o.m_maskMode > && m_sizeLength == o.m_sizeLength && m_type == o.m_type > && ((m_next && o.m_next) ? *m_next == *o.m_next : m_next == o.m_next); > } >@@ -425,7 +425,7 @@ TextStream& operator<<(TextStream& ts, const FillLayer& layer) > > ts.dumpProperty("composite", layer.composite()); > ts.dumpProperty("blend-mode", layer.blendMode()); >- ts.dumpProperty("mask-type", layer.maskSourceType()); >+ ts.dumpProperty("mask-mode", layer.maskMode()); > > if (layer.next()) > ts << *layer.next(); >diff --git a/Source/WebCore/rendering/style/FillLayer.h b/Source/WebCore/rendering/style/FillLayer.h >index 8d75d58e58334684c880c53813c71c159a211bcd..bc540f201e4f70a2ea2cfa4e39d2066a8a033ec3 100644 >--- a/Source/WebCore/rendering/style/FillLayer.h >+++ b/Source/WebCore/rendering/style/FillLayer.h >@@ -85,7 +85,7 @@ public: > const LengthSize& sizeLength() const { return m_sizeLength; } > FillSizeType sizeType() const { return static_cast<FillSizeType>(m_sizeType); } > FillSize size() const { return FillSize(static_cast<FillSizeType>(m_sizeType), m_sizeLength); } >- MaskSourceType maskSourceType() const { return static_cast<MaskSourceType>(m_maskSourceType); } >+ MaskMode maskMode() const { return static_cast<MaskMode>(m_maskMode); } > > const FillLayer* next() const { return m_next.get(); } > FillLayer* next() { return m_next.get(); } >@@ -103,7 +103,7 @@ public: > bool isCompositeSet() const { return m_compositeSet; } > bool isBlendModeSet() const { return m_blendModeSet; } > bool isSizeSet() const { return static_cast<FillSizeType>(m_sizeType) != FillSizeType::None; } >- bool isMaskSourceTypeSet() const { return m_maskSourceTypeSet; } >+ bool isMaskModeSet() const { return m_maskModeSet; } > > bool isEmpty() const { return (sizeType() == FillSizeType::Size && m_sizeLength.isEmpty()) || sizeType() == FillSizeType::None; } > >@@ -122,7 +122,7 @@ public: > void setSizeType(FillSizeType b) { m_sizeType = static_cast<unsigned>(b); } > void setSizeLength(LengthSize l) { m_sizeLength = l; } > void setSize(FillSize f) { m_sizeType = static_cast<unsigned>(f.type); m_sizeLength = f.size; } >- void setMaskSourceType(MaskSourceType m) { m_maskSourceType = static_cast<unsigned>(m); m_maskSourceTypeSet = true; } >+ void setMaskMode(MaskMode m) { m_maskMode = static_cast<unsigned>(m); m_maskModeSet = true; } > > void clearImage() { m_image = nullptr; m_imageSet = false; } > >@@ -137,7 +137,7 @@ public: > void clearComposite() { m_compositeSet = false; } > void clearBlendMode() { m_blendModeSet = false; } > void clearSize() { m_sizeType = static_cast<unsigned>(FillSizeType::None); } >- void clearMaskSourceType() { m_maskSourceTypeSet = false; } >+ void clearMaskMode() { m_maskModeSet = false; } > > void setNext(RefPtr<FillLayer>&& next) { m_next = WTFMove(next); } > >@@ -170,7 +170,7 @@ public: > static Length initialFillXPosition(FillLayerType) { return Length(0.0f, LengthType::Percent); } > static Length initialFillYPosition(FillLayerType) { return Length(0.0f, LengthType::Percent); } > static StyleImage* initialFillImage(FillLayerType) { return nullptr; } >- static MaskSourceType initialFillMaskSourceType(FillLayerType) { return MaskSourceType::Alpha; } >+ static MaskMode initialFillMaskMode(FillLayerType) { return MaskMode::MatchSource; } > > private: > friend class RenderStyle; >@@ -199,7 +199,7 @@ private: > unsigned m_composite : 4; // CompositeOperator > unsigned m_sizeType : 2; // FillSizeType > unsigned m_blendMode : 5; // BlendMode >- unsigned m_maskSourceType : 1; // MaskSourceType >+ unsigned m_maskMode : 2; // MaskMode > > unsigned m_imageSet : 1; > unsigned m_attachmentSet : 1; >@@ -215,7 +215,7 @@ private: > unsigned m_backgroundYOrigin : 2; // Edge > unsigned m_compositeSet : 1; > unsigned m_blendModeSet : 1; >- unsigned m_maskSourceTypeSet : 1; >+ unsigned m_maskModeSet : 1; > > unsigned m_type : 1; // FillLayerType > >diff --git a/Source/WebCore/rendering/style/RenderStyleConstants.cpp b/Source/WebCore/rendering/style/RenderStyleConstants.cpp >index 633054be691eb0f1035cc2129435c5ca91508130..f343e88da71c1061102da905ea287a4a237a5ed5 100644 >--- a/Source/WebCore/rendering/style/RenderStyleConstants.cpp >+++ b/Source/WebCore/rendering/style/RenderStyleConstants.cpp >@@ -753,11 +753,12 @@ TextStream& operator<<(TextStream& ts, MarqueeDirection marqueeDirection) > return ts; > } > >-TextStream& operator<<(TextStream& ts, MaskSourceType maskSource) >+TextStream& operator<<(TextStream& ts, MaskMode maskMode) > { >- switch (maskSource) { >- case MaskSourceType::Alpha: ts << "alpha"; break; >- case MaskSourceType::Luminance: ts << "luminance"; break; >+ switch (maskMode) { >+ case MaskMode::Alpha: ts << "alpha"; break; >+ case MaskMode::Luminance: ts << "luminance"; break; >+ case MaskMode::MatchSource: ts << "match-source"; break; > } > > return ts; >diff --git a/Source/WebCore/rendering/style/RenderStyleConstants.h b/Source/WebCore/rendering/style/RenderStyleConstants.h >index 363c01ac75d20f28e6a59508206732d1d66f5762..ed64b695b453b38a3efbfdbabe865241ff204c51 100644 >--- a/Source/WebCore/rendering/style/RenderStyleConstants.h >+++ b/Source/WebCore/rendering/style/RenderStyleConstants.h >@@ -363,11 +363,12 @@ enum class Edge : uint8_t { > Left > }; > >-// CSS3 Mask Source Types >+// CSS3 Mask Mode > >-enum class MaskSourceType : uint8_t { >+enum class MaskMode : uint8_t { > Alpha, >- Luminance >+ Luminance, >+ MatchSource, > }; > > // CSS3 Marquee Properties >@@ -1313,7 +1314,7 @@ WTF::TextStream& operator<<(WTF::TextStream&, ListStyleType); > WTF::TextStream& operator<<(WTF::TextStream&, MarginCollapse); > WTF::TextStream& operator<<(WTF::TextStream&, MarqueeBehavior); > WTF::TextStream& operator<<(WTF::TextStream&, MarqueeDirection); >-WTF::TextStream& operator<<(WTF::TextStream&, MaskSourceType); >+WTF::TextStream& operator<<(WTF::TextStream&, MaskMode); > WTF::TextStream& operator<<(WTF::TextStream&, NBSPMode); > WTF::TextStream& operator<<(WTF::TextStream&, ObjectFit); > WTF::TextStream& operator<<(WTF::TextStream&, Order); >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index d95eaf4402ae3ddc56775c8957028ee21bcdb47c..39e972d2aff6a4daa25120f14a761056d41b95bb 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,15 @@ >+2021-09-04 Simon Fraser <simon.fraser@apple.com> >+ >+ Add a temporarily prefixed property for mask-mode, aliased to -webkit-mask-source-type >+ https://bugs.webkit.org/show_bug.cgi?id=229915 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Allow the "synonym" key in CSSProperties.json. >+ >+ * Scripts/webkitpy/style/checkers/jsonchecker.py: >+ (JSONCSSPropertiesChecker.check_codegen_properties): >+ > 2021-09-03 Chris Dumez <cdumez@apple.com> > > Unreviewed iOS build fix after r281990. >diff --git a/Tools/Scripts/webkitpy/style/checkers/jsonchecker.py b/Tools/Scripts/webkitpy/style/checkers/jsonchecker.py >index 47c7f91e5562ad8d09e93050a42c321c81575f1c..3730321e6e897405dc5dfb06e4d1ba1851246b7e 100644 >--- a/Tools/Scripts/webkitpy/style/checkers/jsonchecker.py >+++ b/Tools/Scripts/webkitpy/style/checkers/jsonchecker.py >@@ -307,6 +307,7 @@ class JSONCSSPropertiesChecker(JSONChecker): > 'sink-priority': self.validate_boolean, > 'skip-builder': self.validate_boolean, > 'skip-codegen': self.validate_boolean, >+ 'synonym': self.validate_string, > 'svg': self.validate_boolean, > 'visited-link-color-support': self.validate_boolean, > } >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index b6d1ab68305f3575f33f1cba62fe5339517127fc..2045c1481e87cea43c317f46fc24324f132da85c 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2021-09-04 Simon Fraser <simon.fraser@apple.com> >+ >+ Add a temporarily prefixed property for mask-mode, aliased to -webkit-mask-source-type >+ https://bugs.webkit.org/show_bug.cgi?id=229915 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/masking/parsing-mask-mode-expected.txt: Added. >+ * fast/masking/parsing-mask-mode.html: Added. >+ > 2021-08-18 Sergio Villar Senin <svillar@igalia.com> > > [css-writing-modes] Fix absolutely positioning with orthogonal writing modes >diff --git a/LayoutTests/fast/masking/parsing-mask-mode-expected.txt b/LayoutTests/fast/masking/parsing-mask-mode-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..52bd61f6a7714fef7878ab781ed5a6363cc95067 >--- /dev/null >+++ b/LayoutTests/fast/masking/parsing-mask-mode-expected.txt >@@ -0,0 +1,8 @@ >+PASS setProperty("alpha, alpha, alpha, alpha") is "alpha, alpha, alpha, alpha" >+PASS setProperty("luminance, alpha") is "luminance, alpha, match-source, match-source" >+PASS setProperty("luminance, luminance, luminance, luminance") is "luminance, luminance, luminance, luminance" >+PASS setProperty("match-source, alpha, luminance, luminance") is "match-source, alpha, luminance, luminance" >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/fast/masking/parsing-mask-mode.html b/LayoutTests/fast/masking/parsing-mask-mode.html >new file mode 100644 >index 0000000000000000000000000000000000000000..c00bb33eb5ab5d9ccd9adf11074ca19b1d435ee3 >--- /dev/null >+++ b/LayoutTests/fast/masking/parsing-mask-mode.html >@@ -0,0 +1,33 @@ >+<!DOCTYPE html> >+<html> >+ <style> >+ * { font-size: 16px; } >+ div { font-size: 8px; } >+ </style> >+ <body> >+ <script src="../../resources/js-test-pre.js"></script> >+ <script> >+ function setProperty(value) { >+ var div = document.createElement('div'); >+ document.body.appendChild(div); >+ div.style.setProperty("-webkit-mask-image", "none, none, none, none"); >+ div.style.setProperty("-webkit-mask-mode", value); >+ >+ var computedValue = getComputedStyle(div).getPropertyValue("-webkit-mask-mode"); >+ document.body.removeChild(div); >+ >+ return computedValue; >+ } >+ >+ function test(value, expected) { >+ shouldBeEqualToString('setProperty("' + value + '")', expected); >+ } >+ >+ test("alpha, alpha, alpha, alpha", "alpha, alpha, alpha, alpha"); >+ test("luminance, alpha", "luminance, alpha, match-source, match-source"); >+ test("luminance, luminance, luminance, luminance", "luminance, luminance, luminance, luminance"); >+ test("match-source, alpha, luminance, luminance", "match-source, alpha, luminance, luminance"); >+ </script> >+ <script src="../../resources/js-test-post.js"></script> >+ </body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 229915
:
437344
|
437364
|
437367
|
437447
|
437509