Compare commits

...
1 Commits
Author SHA1 Message Date
CodemodService Bot 8e2592b5fb Fix CQS signal modernize-use-designated-initializers in xplat/js/react-native-github/packages [A]
Reviewed By: javache

Differential Revision: D83622069
2025-10-01 02:15:01 -07:00
6 changed files with 37 additions and 34 deletions
@@ -164,7 +164,8 @@ class StackingContextTest : public ::testing::Test {
node->getFamily(), [&](const ShadowNode& oldShadowNode) {
auto viewProps = std::make_shared<ViewShadowNodeProps>();
callback(*viewProps);
return oldShadowNode.clone(ShadowNodeFragment{viewProps});
return oldShadowNode.clone(
ShadowNodeFragment{.props = viewProps});
}));
}
@@ -260,7 +261,7 @@ TEST_F(StackingContextTest, mostPropsDoNotForceViewsToMaterialize) {
yogaStyle.setMargin(yoga::Edge::All, yoga::StyleLength::points(42));
yogaStyle.setPositionType(yoga::PositionType::Absolute);
props.shadowRadius = 42;
props.shadowOffset = Size{42, 42};
props.shadowOffset = Size{.width = 42, .height = 42};
props.backgroundColor = clearColor();
});
@@ -128,7 +128,9 @@ EventTag EventPerformanceLogger::onEventStart(
{
std::lock_guard lock(eventsInFlightMutex_);
eventsInFlight_.emplace(
eventTag, EventEntry{reportedName, target, timeStamp});
eventTag,
EventEntry{
.name = reportedName, .target = target, .startTime = timeStamp});
}
return eventTag;
}
@@ -65,8 +65,8 @@ static Rect getRootNodeBoundingRect(const RootShadowNode& rootShadowNode) {
static Rect getBoundingRect(const ShadowNodeFamily::AncestorList& ancestors) {
auto layoutMetrics = LayoutableShadowNode::computeRelativeLayoutMetrics(
ancestors,
{/* .includeTransform = */ true,
/* .includeViewportOffset = */ true});
{/* .includeTransform = */ .includeTransform = true,
/* .includeViewportOffset = */ .includeViewportOffset = true});
return layoutMetrics == EmptyLayoutMetrics ? Rect{} : layoutMetrics.frame;
}
@@ -74,9 +74,9 @@ static Rect getClippedTargetBoundingRect(
const ShadowNodeFamily::AncestorList& targetAncestors) {
auto layoutMetrics = LayoutableShadowNode::computeRelativeLayoutMetrics(
targetAncestors,
{/* .includeTransform = */ true,
/* .includeViewportOffset = */ true,
/* .applyParentClipping = */ true});
{/* .includeTransform = */ .includeTransform = true,
/* .includeViewportOffset = */ .includeViewportOffset = true,
/* .applyParentClipping = */ .enableOverflowClipping = true});
return layoutMetrics == EmptyLayoutMetrics ? Rect{} : layoutMetrics.frame;
}
@@ -110,8 +110,8 @@ static Rect computeIntersection(
getClippedTargetBoundingRect(targetToRootAncestors);
auto clippedTargetBoundingRect = hasCustomRoot ? Rect{
rootBoundingRect.origin + clippedTargetFromRoot.origin,
clippedTargetFromRoot.size}
.origin=rootBoundingRect.origin + clippedTargetFromRoot.origin,
.size=clippedTargetFromRoot.size}
: clippedTargetFromRoot;
return Rect::intersect(rootBoundingRect, clippedTargetBoundingRect);
@@ -231,13 +231,13 @@ IntersectionObserver::setIntersectingState(
if (state_ != newState) {
state_ = newState;
IntersectionObserverEntry entry{
intersectionObserverId_,
targetShadowNodeFamily_,
targetBoundingRect,
rootBoundingRect,
intersectionRect,
true,
time,
.intersectionObserverId = intersectionObserverId_,
.shadowNodeFamily = targetShadowNodeFamily_,
.targetRect = targetBoundingRect,
.rootRect = rootBoundingRect,
.intersectionRect = intersectionRect,
.isIntersectingAboveThresholds = true,
.time = time,
};
return std::optional<IntersectionObserverEntry>{std::move(entry)};
}
@@ -254,13 +254,13 @@ IntersectionObserver::setNotIntersectingState(
if (state_ != IntersectionObserverState::NotIntersecting()) {
state_ = IntersectionObserverState::NotIntersecting();
IntersectionObserverEntry entry{
intersectionObserverId_,
targetShadowNodeFamily_,
targetBoundingRect,
rootBoundingRect,
intersectionRect,
false,
time,
.intersectionObserverId = intersectionObserverId_,
.shadowNodeFamily = targetShadowNodeFamily_,
.targetRect = targetBoundingRect,
.rootRect = rootBoundingRect,
.intersectionRect = intersectionRect,
.isIntersectingAboveThresholds = false,
.time = time,
};
return std::optional<IntersectionObserverEntry>(std::move(entry));
}
@@ -176,10 +176,10 @@ void MutationObserver::recordMutationsInSubtrees(
if (!addedNodes.empty() || !removedNodes.empty()) {
recordedMutations.emplace_back(MutationRecord{
mutationObserverId_,
oldNode,
std::move(addedNodes),
std::move(removedNodes)});
.mutationObserverId = mutationObserverId_,
.targetShadowNode = oldNode,
.addedShadowNodes = std::move(addedNodes),
.removedShadowNodes = std::move(removedNodes)});
}
}
@@ -215,7 +215,7 @@ Size SurfaceHandler::measure(
std::shared_lock lock(linkMutex_);
if (link_.status != Status::Running) {
return layoutConstraints.clamp({0, 0});
return layoutConstraints.clamp({.width = 0, .height = 0});
}
react_native_assert(
@@ -95,11 +95,11 @@ std::optional<SurfaceManager::SurfaceProps> SurfaceManager::getSurfaceProps(
visit(surfaceId, [&](const SurfaceHandler& surfaceHandler) {
surfaceProps = SurfaceManager::SurfaceProps{
surfaceId,
surfaceHandler.getModuleName(),
surfaceHandler.getProps(),
surfaceHandler.getLayoutConstraints(),
surfaceHandler.getLayoutContext()};
.surfaceId = surfaceId,
.moduleName = surfaceHandler.getModuleName(),
.props = surfaceHandler.getProps(),
.layoutConstraints = surfaceHandler.getLayoutConstraints(),
.layoutContext = surfaceHandler.getLayoutContext()};
});
return surfaceProps;