Skip to content

Commit 0341300

Browse files
committed
Remove obsolete safer C++ suppressions
https://bugs.webkit.org/show_bug.cgi?id=327870 Reviewed by Geoffrey Garen. Remove a whole bunch of suppressions that are no longer needed after swift-DEVELOPMENT-SNAPSHOT-2026-10-06-a rollout. Also deploy more smart pointers and apply more targeted suppressions. No new tests since there should be no behavior changes. * Source/WTF/wtf/Compiler.h: * Source/WebCore/Modules/mediastream/ImageCapture.cpp: (WebCore::ImageCapture::takePhoto): * Source/WebCore/css/values/CSSValueTypes+DeprecatedCSSOMValueCreation.h: (WebCore::CSS::DeprecatedCSSOMValueCreation<CSSType>::operator()): * Source/WebCore/rendering/RenderBox.cpp: (WebCore::RenderBox::computeSizingKeywordLogicalContentHeightUsingGeneric const): (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing const): (WebCore::RenderBox::computeOutOfFlowPositionedLogicalWidthUsing const): * Source/WebCore/rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::computeReplacedLogicalWidthUsing const): (WebCore::RenderReplaced::computeReplacedLogicalHeightUsingGeneric const): * Source/WebCore/style/values/StyleValueTypes.h: (WebCore::Style::toCSSOnTupleLike): (WebCore::Style::toStyleOnTupleLike): (WebCore::Style::CSSValueCreation<StyleType>::operator()): (WebCore::Style::serializationForCSSOnTupleLike): (WebCore::Style::equalsForBlendingOnTupleLike): (WebCore::Style::canBlendOnTupleLike): (WebCore::Style::requiresInterpolationForAccumulativeIterationOnTupleLike): (WebCore::Style::blendOnTupleLike): * Source/WebCore/style/values/filter-effects/StyleFilterInterpolation.h: (WebCore::Style::blendFilterValue): (WebCore::Style::blendFilterValueFromOnly): (WebCore::Style::blendFilterValueToOnly): * Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::focusServiceWorkerClient): Canonical link: https://commits.webkit.org/324045@main
1 parent e6b7551 commit 0341300

8 files changed

Lines changed: 39 additions & 43 deletions

File tree

‎Source/WTF/wtf/Compiler.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -614,12 +614,6 @@
614614

615615
#endif
616616

617-
// FIXME: The static analyzer does not perform escape analysis inside function templates, so it
618-
// reports uncounted lambda captures even when the lambda is invoked immediately, passed to a
619-
// NOESCAPE parameter, or forwarded through WTF::makeVisitor. Replace every use of this macro
620-
// with nothing once rdar://187551637 is fixed.
621-
#define SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE
622-
623617
// To suppress webkit.RefCntblBaseVirtualDtor, use NoVirtualDestructorBase instead.
624618

625619
#define SUPPRESS_MEMORY_UNSAFE_CAST \

‎Source/WebCore/Modules/mediastream/ImageCapture.cpp‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ void ImageCapture::takePhoto(PhotoSettings&& settings, DOMPromiseDeferred<IDLInt
104104

105105
ALWAYS_LOG_WITH_THIS(&capture, identifier, "resolving promise");
106106

107-
// FIXME: This is a static analysis false positive (rdar://146889777).
108-
SUPPRESS_UNCOUNTED_ARG promise.resolve(Blob::create(capture.scriptExecutionContext(), WTF::move(get<0>(result.value())), WTF::move(get<1>(result.value()))));
107+
promise.resolve(Blob::create(protect(capture.scriptExecutionContext()), WTF::move(get<0>(result.value())), WTF::move(get<1>(result.value()))));
109108
});
110109
});
111110
}

‎Source/WebCore/css/values/CSSValueTypes+DeprecatedCSSOMValueCreation.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ template<> Ref<DeprecatedCSSOMValue> makeListDeprecatedCSSOMValue<SerializationS
4646
template<VariantLike CSSType> struct DeprecatedCSSOMValueCreation<CSSType> {
4747
template<typename... Rest> Ref<DeprecatedCSSOMValue> operator()(CSSValuePool& pool, CSSStyleDeclaration& owner, const CSSType& value, Rest&&... rest)
4848
{
49-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE return WTF::switchOn(value, [&](const auto& alternative) { return createDeprecatedCSSOMValue(pool, owner, alternative, std::forward<Rest>(rest)...); });
49+
return WTF::switchOn(value, [&](const auto& alternative) { return createDeprecatedCSSOMValue(pool, owner, alternative, std::forward<Rest>(rest)...); });
5050
}
5151
};
5252

@@ -64,7 +64,8 @@ template<TupleLike CSSType> struct DeprecatedCSSOMValueCreation<CSSType> {
6464
} else {
6565
DeprecatedCSSOMValueListBuilder list;
6666

67-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE auto caller = WTF::makeVisitor(
67+
// FIXME: WTF::visit(WTF::makeVisitor(~)) is not recognized by static analysis.
68+
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE auto caller = WTF::makeVisitor(
6869
[&]<OptionalLike T>(const T& element) {
6970
if (!element)
7071
return;

‎Source/WebCore/rendering/RenderBox.cpp‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3670,13 +3670,13 @@ LayoutUnit RenderBox::blockAxisMarginForStretch() const
36703670

36713671
template<typename SizeType> std::optional<LayoutUnit> RenderBox::computeSizingKeywordLogicalContentHeightUsingGeneric(const SizeType& logicalHeight, std::optional<LayoutUnit> intrinsicContentHeight, LayoutUnit borderAndPadding) const
36723672
{
3673-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE auto intrinsic = [&] -> std::optional<LayoutUnit> {
3673+
auto intrinsic = [&] -> std::optional<LayoutUnit> {
36743674
if (intrinsicContentHeight)
36753675
return adjustIntrinsicLogicalHeightForBoxSizing(*intrinsicContentHeight);
36763676
return { };
36773677
};
36783678

3679-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE auto minMaxContent = [&] -> std::optional<LayoutUnit> {
3679+
auto minMaxContent = [&] -> std::optional<LayoutUnit> {
36803680
// FIXME: The CSS sizing spec is considering changing what min-content/max-content should resolve to.
36813681
// If that happens, this code will have to change.
36823682
if (CheckedPtr renderImage = dynamicDowncast<RenderImage>(this)) {
@@ -3707,7 +3707,7 @@ template<typename SizeType> std::optional<LayoutUnit> RenderBox::computeSizingKe
37073707
return intrinsic();
37083708
};
37093709

3710-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE auto keywordLogicalHeight = logicalHeight.switchOnKeyword(
3710+
auto keywordLogicalHeight = logicalHeight.switchOnKeyword(
37113711
[&](const CSS::Keyword::MinContent&) -> std::optional<LayoutUnit> {
37123712
return minMaxContent();
37133713
},
@@ -3743,7 +3743,7 @@ template<typename SizeType> std::optional<LayoutUnit> RenderBox::computeSizingKe
37433743
}
37443744

37453745
if (!isOrthogonal(*this, containingBlock))
3746-
view().addPercentHeightDescendant(const_cast<RenderBox&>(*this));
3746+
SUPPRESS_MEMORY_UNSAFE_CAST view().addPercentHeightDescendant(const_cast<RenderBox&>(*this));
37473747
if (!isBlockSizeResolvableForStretch())
37483748
return { };
37493749
if (isOrthogonal(*this, containingBlock))
@@ -3812,13 +3812,13 @@ std::optional<LayoutUnit> RenderBox::computeSizingKeywordLogicalContentHeightUsi
38123812

38133813
template<typename SizeType> std::optional<LayoutUnit> RenderBox::computeContentAndScrollbarLogicalHeightUsing(const SizeType& logicalHeight, std::optional<LayoutUnit> intrinsicContentHeight) const
38143814
{
3815-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE auto keywordSize = [&] {
3815+
auto keywordSize = [&] {
38163816
// FIXME: The CSS sizing spec is considering changing what min-content/max-content should resolve to.
38173817
// If that happens, this code will have to change.
38183818
return computeSizingKeywordLogicalContentHeightUsing(logicalHeight, intrinsicContentHeight, borderAndPaddingLogicalHeight());
38193819
};
38203820

3821-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE return WTF::switchOn(logicalHeight,
3821+
return WTF::switchOn(logicalHeight,
38223822
[&](const typename SizeType::Fixed& fixedLogicalHeight) -> std::optional<LayoutUnit> {
38233823
return LayoutUnit { fixedLogicalHeight.resolveZoom(style().usedZoomForLength()) };
38243824
},
@@ -4418,7 +4418,7 @@ void RenderBox::computeOutOfFlowPositionedLogicalWidth(LogicalExtentComputedValu
44184418

44194419
template<typename SizeType> LayoutUnit RenderBox::computeOutOfFlowPositionedLogicalWidthUsing(const SizeType& logicalWidth, const PositionedLayoutConstraints& inlineConstraints) const
44204420
{
4421-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE auto fallback = [&] -> LayoutUnit {
4421+
auto fallback = [&] -> LayoutUnit {
44224422
bool shrinkToFit = inlineConstraints.insetFitsContent() || !inlineConstraints.alignmentAppliesStretch(ItemPosition::Stretch);
44234423
if (shrinkToFit) {
44244424
auto preferredWidth = maxContentLogicalWidthContribution() - inlineConstraints.bordersPlusPadding();
@@ -4428,15 +4428,15 @@ template<typename SizeType> LayoutUnit RenderBox::computeOutOfFlowPositionedLogi
44284428
return inlineConstraints.availableContentSpace();
44294429
};
44304430

4431-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE auto intrinsic = [&](const auto& keyword) -> LayoutUnit {
4431+
auto intrinsic = [&](const auto& keyword) -> LayoutUnit {
44324432
auto availableSpace = inlineConstraints.containingSize();
44334433
availableSpace -= inlineConstraints.insetBeforeValue();
44344434
availableSpace -= inlineConstraints.insetAfterValue();
44354435
auto intrinsicWidthComputationScope = IntrinsicLogicalWidthComputationScope { view().frameView().layoutContext(), *this };
44364436
return std::max(0_lu, computeSizingKeywordLogicalWidthUsing(keyword, availableSpace, inlineConstraints.bordersPlusPadding()) - inlineConstraints.bordersPlusPadding());
44374437
};
44384438

4439-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE auto keywordLogicalWidth = WTF::switchOn(logicalWidth,
4439+
auto keywordLogicalWidth = WTF::switchOn(logicalWidth,
44404440
[&](const typename SizeType::Fixed& fixedLogicalWidth) -> LayoutUnit {
44414441
return adjustContentBoxLogicalWidthForBoxSizing(fixedLogicalWidth);
44424442
},

‎Source/WebCore/rendering/RenderReplaced.cpp‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ LayoutUnit RenderReplaced::computeReplacedLogicalWidthRespectingMinMaxWidth(Layo
13051305
template<typename SizeType>
13061306
LayoutUnit RenderReplaced::computeReplacedLogicalWidthUsing(const SizeType& logicalWidth) const
13071307
{
1308-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE auto calculateContainerWidth = [&] {
1308+
auto calculateContainerWidth = [&] {
13091309
if (isOutOfFlowPositioned()) {
13101310
PositionedLayoutConstraints constraints(*this, LogicalBoxAxis::Inline);
13111311
return constraints.containingSize();
@@ -1315,7 +1315,7 @@ LayoutUnit RenderReplaced::computeReplacedLogicalWidthUsing(const SizeType& logi
13151315
return perpendicularContainingBlockLogicalHeight();
13161316
};
13171317

1318-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE auto percentageOrCalc = [&](Style::IsPercentageOrCalcOrCalcSize auto const& logicalWidth) {
1318+
auto percentageOrCalc = [&](Style::IsPercentageOrCalcOrCalcSize auto const& logicalWidth) {
13191319
// FIXME: Handle cases when containing block width is calculated or viewport percent.
13201320
// https://bugs.webkit.org/show_bug.cgi?id=91071
13211321
if (auto containerWidth = calculateContainerWidth(); containerWidth > 0 || (!containerWidth && (containingBlock()->style().logicalWidth().isSpecified()))) {
@@ -1327,7 +1327,7 @@ LayoutUnit RenderReplaced::computeReplacedLogicalWidthUsing(const SizeType& logi
13271327
return 0_lu;
13281328
};
13291329

1330-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE auto content = [&](const auto& keyword, const auto& availableLogicalWidth) {
1330+
auto content = [&](const auto& keyword, const auto& availableLogicalWidth) {
13311331
// FIXME: Handle cases when containing block width is calculated or viewport percent.
13321332
// https://bugs.webkit.org/show_bug.cgi?id=91071
13331333
auto borderAndPadding = borderAndPaddingLogicalWidth();
@@ -1336,7 +1336,7 @@ LayoutUnit RenderReplaced::computeReplacedLogicalWidthUsing(const SizeType& logi
13361336
return computeSizingKeywordLogicalWidthUsing(keyword, availableLogicalWidth, borderAndPadding) - borderAndPadding;
13371337
};
13381338

1339-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE return WTF::switchOn(logicalWidth,
1339+
return WTF::switchOn(logicalWidth,
13401340
[&](const typename SizeType::Fixed& fixedLogicalWidth) -> LayoutUnit {
13411341
return adjustContentBoxLogicalWidthForBoxSizing(fixedLogicalWidth);
13421342
},
@@ -1472,7 +1472,7 @@ LayoutUnit RenderReplaced::computeReplacedLogicalHeightUsingGeneric(const SizeTy
14721472
ASSERT(!replacedMaxLogicalHeightComputesAsNone());
14731473
#endif
14741474

1475-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE auto percentageOrCalculated = [&](Style::IsPercentageOrCalcOrCalcSize auto const& logicalHeight) {
1475+
auto percentageOrCalculated = [&](Style::IsPercentageOrCalcOrCalcSize auto const& logicalHeight) {
14761476
auto* container = isOutOfFlowPositioned() ? this->container() : containingBlock();
14771477
while (container && container->shouldSkipForPercentageResolution()) {
14781478
// Stop at rendering context root.
@@ -1483,7 +1483,7 @@ LayoutUnit RenderReplaced::computeReplacedLogicalHeightUsingGeneric(const SizeTy
14831483
bool hasPerpendicularContainingBlock = container->isHorizontalWritingMode() != isHorizontalWritingMode();
14841484
std::optional<LayoutUnit> stretchedHeight;
14851485
if (auto* block = dynamicDowncast<RenderBlock>(container)) {
1486-
block->addPercentHeightDescendant(*const_cast<RenderReplaced*>(this));
1486+
SUPPRESS_MEMORY_UNSAFE_CAST block->addPercentHeightDescendant(*const_cast<RenderReplaced*>(this));
14871487
if (auto usedFlexItemOverridingLogicalHeightForPercentageResolutionForFlex = (block->isFlexItem() ? downcast<RenderFlexibleBox>(block->parent())->usedFlexItemOverridingLogicalHeightForPercentageResolution(*block) : std::nullopt))
14881488
stretchedHeight = block->contentBoxLogicalHeight(*usedFlexItemOverridingLogicalHeightForPercentageResolutionForFlex);
14891489
else if (auto usedChildOverridingLogicalHeightForGrid = (block->isGridItem() && !hasPerpendicularContainingBlock ? block->overridingBorderBoxLogicalHeight() : std::nullopt))
@@ -1532,7 +1532,7 @@ LayoutUnit RenderReplaced::computeReplacedLogicalHeightUsingGeneric(const SizeTy
15321532
else
15331533
return Style::evaluate<LayoutUnit>(logicalHeight, availableHeight - borderAndPaddingLogicalHeight(), style().usedZoomForLength());
15341534
}
1535-
downcast<RenderBlock>(*container).addPercentHeightDescendant(const_cast<RenderReplaced&>(*this));
1535+
SUPPRESS_MEMORY_UNSAFE_CAST downcast<RenderBlock>(*container).addPercentHeightDescendant(const_cast<RenderReplaced&>(*this));
15361536
container = container->containingBlock();
15371537
}
15381538
}
@@ -1543,11 +1543,11 @@ LayoutUnit RenderReplaced::computeReplacedLogicalHeightUsingGeneric(const SizeTy
15431543
return adjustContentBoxLogicalHeightForBoxSizing(Style::evaluate<LayoutUnit>(logicalHeight, availableHeight, style().usedZoomForLength()));
15441544
};
15451545

1546-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE auto content = [&] {
1546+
auto content = [&] {
15471547
return adjustContentBoxLogicalHeightForBoxSizing(computeSizingKeywordLogicalContentHeightUsing(logicalHeight, intrinsicLogicalHeight(), borderAndPaddingLogicalHeight()));
15481548
};
15491549

1550-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE return WTF::switchOn(logicalHeight,
1550+
return WTF::switchOn(logicalHeight,
15511551
[&](const typename SizeType::Fixed& fixedLogicalHeight) -> LayoutUnit {
15521552
return adjustContentBoxLogicalHeightForBoxSizing(LayoutUnit { fixedLogicalHeight.resolveZoom(style().usedZoomForLength()) });
15531553
},

‎Source/WebCore/style/values/StyleValueTypes.h‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ template<typename StyleType> using CSSType = std::decay_t<decltype(toCSS(std::de
119119

120120
template<typename To, typename From, typename... Rest> auto toCSSOnTupleLike(const From& tupleLike, Rest&&... rest) -> To
121121
{
122-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE return WTF::apply([&](const auto& ...x) { return To { toCSS(x, rest...)... }; }, tupleLike);
122+
return WTF::apply([&](const auto& ...x) { return To { toCSS(x, rest...)... }; }, tupleLike);
123123
}
124124

125125
// Standard NonConverting type mappings (identity mappings):
@@ -256,7 +256,7 @@ inline constexpr ToStyleNoConversionDataRequiredInvoker toStyleNoConversionDataR
256256
// Conversion Utilities
257257
template<typename To, typename From, typename... Rest> auto toStyleOnTupleLike(const From& tupleLike, Rest&&... rest) -> To
258258
{
259-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE return WTF::apply([&](const auto& ...x) { return To { toStyle(x, rest...)... }; }, tupleLike);
259+
return WTF::apply([&](const auto& ...x) { return To { toStyle(x, rest...)... }; }, tupleLike);
260260
}
261261

262262
template<typename To, typename From, typename... Rest> auto toStyleNoConversionDataRequiredOnTupleLike(const From& tupleLike, Rest&&... rest) -> To
@@ -425,7 +425,8 @@ template<TupleLike StyleType> struct CSSValueCreation<StyleType> {
425425

426426
CSSValueListBuilder list;
427427

428-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE auto caller = WTF::makeVisitor(
428+
// FIXME: WTF::visit(WTF::makeVisitor(~)) is not recognized by static analysis.
429+
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE auto caller = WTF::makeVisitor(
429430
[&]<OptionalLike T>(const T& element) {
430431
if (!element)
431432
return;
@@ -617,7 +618,8 @@ template<typename StyleType, typename... Rest> void serializationForCSSOnOptiona
617618
template<typename StyleType, typename... Rest> void serializationForCSSOnTupleLike(StringBuilder& builder, const CSS::SerializationContext& context, const Style::ComputedStyle& style, const StyleType& value, ASCIILiteral separator, Rest&&... rest)
618619
{
619620
auto swappedSeparator = ""_s;
620-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE auto caller = WTF::makeVisitor(
621+
// FIXME: WTF::visit(WTF::makeVisitor(~)) is not recognized by static analysis.
622+
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE auto caller = WTF::makeVisitor(
621623
[&]<OptionalLike T>(const T& element) {
622624
if (!element)
623625
return;
@@ -1023,7 +1025,7 @@ template<typename StyleType> auto equalsForBlendingOnTupleLike(const StyleType&
10231025

10241026
template<typename StyleType> auto equalsForBlendingOnTupleLike(const StyleType& a, const StyleType& b, const Style::ComputedStyle& aStyle, const Style::ComputedStyle& bStyle) -> bool
10251027
{
1026-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE return WTF::apply([&](const auto& ...pair) {
1028+
return WTF::apply([&](const auto& ...pair) {
10271029
return (WebCore::Style::equalsForBlending(std::get<0>(pair), std::get<1>(pair), aStyle, bStyle) && ...);
10281030
}, WTF::tuple_zip(a, b));
10291031
}
@@ -1037,7 +1039,7 @@ template<typename StyleType> auto canBlendOnTupleLike(const StyleType& a, const
10371039

10381040
template<typename StyleType> auto canBlendOnTupleLike(const StyleType& a, const StyleType& b, const Style::ComputedStyle& aStyle, const Style::ComputedStyle& bStyle) -> bool
10391041
{
1040-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE return WTF::apply([&](const auto& ...pair) {
1042+
return WTF::apply([&](const auto& ...pair) {
10411043
return (WebCore::Style::canBlend(std::get<0>(pair), std::get<1>(pair), aStyle, bStyle) && ...);
10421044
}, WTF::tuple_zip(a, b));
10431045
}
@@ -1051,7 +1053,7 @@ template<typename StyleType> auto requiresInterpolationForAccumulativeIterationO
10511053

10521054
template<typename StyleType> auto requiresInterpolationForAccumulativeIterationOnTupleLike(const StyleType& a, const StyleType& b, const Style::ComputedStyle& aStyle, const Style::ComputedStyle& bStyle) -> bool
10531055
{
1054-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE return WTF::apply([&](const auto& ...pair) {
1056+
return WTF::apply([&](const auto& ...pair) {
10551057
return (WebCore::Style::requiresInterpolationForAccumulativeIteration(std::get<0>(pair), std::get<1>(pair), aStyle, bStyle) || ...);
10561058
}, WTF::tuple_zip(a, b));
10571059
}
@@ -1065,7 +1067,7 @@ template<typename StyleType> auto blendOnTupleLike(const StyleType& a, const Sty
10651067

10661068
template<typename StyleType> auto blendOnTupleLike(const StyleType& a, const StyleType& b, const Style::ComputedStyle& aStyle, const Style::ComputedStyle& bStyle, const auto& context) -> StyleType
10671069
{
1068-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE return WTF::apply([&](const auto& ...pair) {
1070+
return WTF::apply([&](const auto& ...pair) {
10691071
return StyleType { WebCore::Style::blend(std::get<0>(pair), std::get<1>(pair), aStyle, bStyle, context)... };
10701072
}, WTF::tuple_zip(a, b));
10711073
}

‎Source/WebCore/style/values/filter-effects/StyleFilterInterpolation.h‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ auto blendFilterValue(const FilterValue& from, const FilterValue& to, const Styl
4242
{
4343
ASSERT(from.index() == to.index());
4444

45-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE return WTF::visit(WTF::makeVisitor(
45+
// FIXME: WTF::visit(WTF::makeVisitor(~)) is not recognized by static analysis.
46+
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE return WTF::visit(WTF::makeVisitor(
4647
[&]<typename T>(const T& fromValue, const T& toValue) -> FilterValue {
4748
return Style::blend(fromValue, toValue, fromStyle, toStyle, context);
4849
},
@@ -55,27 +56,27 @@ auto blendFilterValue(const FilterValue& from, const FilterValue& to, const Styl
5556
template<typename FilterValue>
5657
auto blendFilterValueFromOnly(const FilterValue& from, const Style::ComputedStyle& fromStyle, const Style::ComputedStyle& toStyle, const BlendingContext& context) -> FilterValue
5758
{
58-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE return WTF::visit(WTF::makeVisitor(
59+
return WTF::switchOn(from.value,
5960
[&]<CSSValueID C, typename T>(const FunctionNotation<C, T>& fromValue) -> FilterValue {
6061
return Style::blend(fromValue, FunctionNotation<C, T> { T::passthroughForInterpolation() }, fromStyle, toStyle, context);
6162
},
6263
[](const auto&) -> FilterValue {
6364
RELEASE_ASSERT_NOT_REACHED();
6465
}
65-
), from.value);
66+
);
6667
}
6768

6869
template<typename FilterValue>
6970
auto blendFilterValueToOnly(const FilterValue& to, const Style::ComputedStyle& fromStyle, const Style::ComputedStyle& toStyle, const BlendingContext& context) -> FilterValue
7071
{
71-
SUPPRESS_UNCOUNTED_LAMBDA_CAPTURE_IN_FUNCTION_TEMPLATE return WTF::visit(WTF::makeVisitor(
72+
return WTF::switchOn(to.value,
7273
[&]<CSSValueID C, typename T>(const FunctionNotation<C, T>& toValue) -> FilterValue {
7374
return Style::blend(FunctionNotation<C, T> { T::passthroughForInterpolation() }, toValue, fromStyle, toStyle, context);
7475
},
7576
[](const auto&) -> FilterValue {
7677
RELEASE_ASSERT_NOT_REACHED();
7778
}
78-
), to.value);
79+
);
7980
}
8081

8182
template<typename FilterList>

0 commit comments

Comments
 (0)