From 13a2077967de05049d8accb84aae59601f4ca4ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Fri, 27 Nov 2026 07:57:29 -0800 Subject: [PATCH] Resolve IntersectionObserver percentage margins against width (#60332) Summary: ## Context The [Intersection Observer specification](https://w3c.github.io/IntersectionObserver/#root-intersection-rectangle) resolves percentage margins on all four edges against the width of the undilated root or scrollport rectangle. For both `rootMargin` and `scrollMargin`, it states: > Percentages are resolved relative to the width of the undilated rectangle. React Native instead resolved top and bottom percentages against height, producing incorrect intersection bounds on non-square rectangles. ## Changes Make `resolveEdgeMargins` take an explicit `referenceLength` instead of a rectangle size, and pass the undilated width at each IntersectionObserver call site. Resolve all percentage edges against that reference while leaving absolute margins and per-scrollport resolution unchanged. Regenerate the C++ API snapshots for the signature change. Clarify the API documentation and extend existing integration coverage for non-square roots, positive and negative margins, scaled and nested scrollports, and combined root and scroll margins. Changelog: [General][Fixed] - Resolve `IntersectionObserver` percentage `rootMargin` and `scrollMargin` values against rectangle width on all sides Differential Revision: D134823780 --- .../renderer/core/LayoutableShadowNode.cpp | 2 +- .../react/renderer/graphics/RectangleEdges.h | 18 +-- .../intersection/IntersectionObserver.cpp | 5 +- .../IntersectionObserver.js | 8 +- .../__tests__/IntersectionObserver-itest.js | 128 ++++++++++++++---- .../api-snapshots/ReactAndroidDebugCxx.api | 2 +- .../ReactAndroidFrameworksCxx.api | 2 +- .../api-snapshots/ReactAndroidNewarchCxx.api | 2 +- .../api-snapshots/ReactAndroidReleaseCxx.api | 2 +- .../api-snapshots/ReactAppleDebugCxx.api | 2 +- .../api-snapshots/ReactAppleFrameworksCxx.api | 2 +- .../api-snapshots/ReactAppleNewarchCxx.api | 2 +- .../api-snapshots/ReactAppleReleaseCxx.api | 2 +- .../api-snapshots/ReactCommonDebugCxx.api | 2 +- .../ReactCommonFrameworksCxx.api | 2 +- .../api-snapshots/ReactCommonNewarchCxx.api | 2 +- .../api-snapshots/ReactCommonReleaseCxx.api | 2 +- 17 files changed, 127 insertions(+), 58 deletions(-) diff --git a/packages/react-native/ReactCommon/react/renderer/core/LayoutableShadowNode.cpp b/packages/react-native/ReactCommon/react/renderer/core/LayoutableShadowNode.cpp index ba54f2840bd1..3da09169173c 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/LayoutableShadowNode.cpp +++ b/packages/react-native/ReactCommon/react/renderer/core/LayoutableShadowNode.cpp @@ -196,7 +196,7 @@ LayoutMetrics LayoutableShadowNode::computeRelativeLayoutMetrics( ShadowNodeTraits::Trait::FormsScrollContainer)) { overflowRect = outsetBy( overflowRect, - resolveEdgeMargins(*policy.clipMargin, currentFrame.size)); + resolveEdgeMargins(*policy.clipMargin, currentFrame.size.width)); } overflowRect = currentShadowNode->getTransform().applyWithCenter( overflowRect, currentFrame.getCenter()); diff --git a/packages/react-native/ReactCommon/react/renderer/graphics/RectangleEdges.h b/packages/react-native/ReactCommon/react/renderer/graphics/RectangleEdges.h index e555a3a1f262..c96b80c0ef32 100644 --- a/packages/react-native/ReactCommon/react/renderer/graphics/RectangleEdges.h +++ b/packages/react-native/ReactCommon/react/renderer/graphics/RectangleEdges.h @@ -84,7 +84,7 @@ inline Rect outsetBy(const Rect &rect, const EdgeInsets &outsets) noexcept /* * A margin value that is either an absolute length in points or a percentage - * of the size it is resolved against. + * of the reference length it is resolved against. */ struct MarginValue { Float value{}; @@ -99,21 +99,15 @@ struct MarginValue { using EdgeMargins = RectangleEdges; /* - * Resolves margins into absolute insets against the given size. - * Percentages on the vertical edges resolve against the height, and those on - * the horizontal edges resolve against the width. + * Resolves percentage margins on all edges against the given reference length. */ -inline EdgeInsets resolveEdgeMargins(const EdgeMargins &margins, const Size &size) noexcept +inline EdgeInsets resolveEdgeMargins(const EdgeMargins &margins, Float referenceLength) noexcept { - const auto resolve = [](const MarginValue &margin, Float basis) { - return margin.isPercentage ? margin.value / 100.0f * basis : margin.value; + const auto resolve = [referenceLength](const MarginValue &margin) { + return margin.isPercentage ? margin.value / 100.0f * referenceLength : margin.value; }; - return EdgeInsets{ - resolve(margins.left, size.width), - resolve(margins.top, size.height), - resolve(margins.right, size.width), - resolve(margins.bottom, size.height)}; + return EdgeInsets{resolve(margins.left), resolve(margins.top), resolve(margins.right), resolve(margins.bottom)}; } } // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserver.cpp b/packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserver.cpp index 921fe8a388e8..e22186e217f0 100644 --- a/packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserver.cpp +++ b/packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserver.cpp @@ -249,7 +249,8 @@ IntersectionObserver::updateIntersectionObservation( if (rootMargins_.has_value()) { // Calculate the actual insets based on current root dimensions // (converts percentages to pixels) - auto insets = resolveEdgeMargins(*rootMargins_, rootBoundingRect.size); + auto insets = + resolveEdgeMargins(*rootMargins_, rootBoundingRect.size.width); // Use outsetBy to expand the root rect (positive values expand, negative // contract) rootMarginBoundingRect = outsetBy(rootBoundingRect, insets); @@ -266,7 +267,7 @@ IntersectionObserver::updateIntersectionObservation( ShadowNodeTraits::Trait::FormsScrollContainer)) { rootClipRect = outsetBy( rootClipRect, - resolveEdgeMargins(*scrollMargins_, rootBoundingRect.size)); + resolveEdgeMargins(*scrollMargins_, rootBoundingRect.size.width)); } } diff --git a/packages/react-native/src/private/webapis/intersectionobserver/IntersectionObserver.js b/packages/react-native/src/private/webapis/intersectionobserver/IntersectionObserver.js index f8659739610b..22819321a16d 100644 --- a/packages/react-native/src/private/webapis/intersectionobserver/IntersectionObserver.js +++ b/packages/react-native/src/private/webapis/intersectionobserver/IntersectionObserver.js @@ -141,6 +141,7 @@ export default class IntersectionObserver { * Each side of the rectangle represented by `rootMargin` is added to the * corresponding side in the root element's bounding box before the * intersection test is performed. + * Percentages on all sides are relative to the width of the root's undilated box. */ // $FlowFixMe[unsafe-getters-setters] get rootMargin(): string { @@ -189,10 +190,11 @@ export default class IntersectionObserver { * String with syntax similar to that of the CSS `margin` property. * Each side of the rectangle represented by `scrollMargin` is added to the * corresponding side of the clipping box of every scroll container between - * the root and the target, before the intersection test is performed. + * the root and the target, including the root if it is scrollable, before the + * intersection test is performed. Percentages on all sides are relative to + * the width of each scrollport's undilated clipping box. * - * Unlike `rootMargin`, this does not affect the root itself, and so it does - * not affect the reported `rootBounds`. + * Unlike `rootMargin`, this does not affect the reported `rootBounds`. */ // $FlowFixMe[unsafe-getters-setters] get scrollMargin(): string { diff --git a/packages/react-native/src/private/webapis/intersectionobserver/__tests__/IntersectionObserver-itest.js b/packages/react-native/src/private/webapis/intersectionobserver/__tests__/IntersectionObserver-itest.js index 5ad0daa26e4f..73ca46621474 100644 --- a/packages/react-native/src/private/webapis/intersectionobserver/__tests__/IntersectionObserver-itest.js +++ b/packages/react-native/src/private/webapis/intersectionobserver/__tests__/IntersectionObserver-itest.js @@ -2803,7 +2803,7 @@ describe('IntersectionObserver', () => { const root = Fantom.createRoot({ viewportWidth: 1000, - viewportHeight: 1000, + viewportHeight: 500, }); Fantom.runTask(() => { @@ -2840,7 +2840,7 @@ describe('IntersectionObserver', () => { x: -50, y: -50, width: 1100, - height: 1100, + height: 600, }); expectRectEquals(entries[0].intersectionRect, { x: -50, @@ -2849,7 +2849,7 @@ describe('IntersectionObserver', () => { height: 100, }); }); - it('should calculate percentage rootMargin relative to root dimensions with custom root', () => { + it('should calculate percentage rootMargin relative to the undilated custom root width', () => { const nodeRef = createRef(); const rootNodeRef = createRef(); @@ -2860,7 +2860,7 @@ describe('IntersectionObserver', () => { Fantom.runTask(() => { root.render( - + { x: 50, y: 50, width: 100, - height: 100, + height: 300, }); expectRectEquals(entries[0].intersectionRect, { x: 50, @@ -2913,7 +2913,7 @@ describe('IntersectionObserver', () => { const root = Fantom.createRoot({ viewportWidth: 1000, - viewportHeight: 1000, + viewportHeight: 500, }); Fantom.runTask(() => { @@ -2949,7 +2949,7 @@ describe('IntersectionObserver', () => { x: 0, y: -100, width: 1000, - height: 1100, + height: 600, }); expectRectEquals(entries[0].intersectionRect, { x: 0, @@ -4139,6 +4139,7 @@ describe('IntersectionObserver', () => { function renderTargetBelowTheFoldOfAScrollView( marginTop: number = 150, scale: number = 1, + width: number = 100, ) { const nodeRef = React.createRef(); @@ -4150,7 +4151,7 @@ describe('IntersectionObserver', () => { root.render( { marginTop: 150, expectedRatio: 0.5, }, - {scrollMargin: '0% 0% 75% 0%', marginTop: 150, expectedRatio: 0.5}, + {scrollMargin: '0% 0% 37.5% 0%', marginTop: 150, expectedRatio: 0.5}, { scrollMargin: '0px 0px -20px 0px', marginTop: 60, expectedRatio: 0.4, }, - {scrollMargin: '0% 0% -20% 0%', marginTop: 60, expectedRatio: 0.4}, + {scrollMargin: '0% 0% -10% 0%', marginTop: 60, expectedRatio: 0.4}, ]) { it(`should apply ${scrollMargin} in scrollport coordinates at scale ${scale}`, () => { const node = renderTargetBelowTheFoldOfAScrollView( marginTop, scale, + 200, ); const entry = observeAndGetEntry(node, {scrollMargin}); @@ -4270,17 +4272,17 @@ describe('IntersectionObserver', () => { expect(entries[0].intersectionRatio).toBe(0); }); - it('should resolve percentages against the scrollport, not the root', () => { - const node = renderTargetBelowTheFoldOfAScrollView(); + it('should resolve percentages against the undilated scrollport width, not the root', () => { + const node = renderTargetBelowTheFoldOfAScrollView(150, 1, 200); const intersectionObserverCallback = jest.fn(); Fantom.runTask(() => { observer = new IntersectionObserver(intersectionObserverCallback, { - // 60% of the 100px scrollport is 60px, expanding its clip to + // 30% of the 200px scrollport width is 60px, expanding its clip to // 0..160 and revealing 10px of the target. Were this resolved // against the 1000px viewport it would reveal the target entirely. - scrollMargin: '0% 0% 60% 0%', + scrollMargin: '0% 0% 30% 0%', threshold: [0.01], }); observer.observe(node); @@ -4297,6 +4299,77 @@ describe('IntersectionObserver', () => { }); }); + for (const {scrollMargin, scrollY} of [ + {scrollMargin: '10% 0px 0px 0px', scrollY: 30}, + {scrollMargin: '-10% 0px 0px 0px', scrollY: -10}, + ]) { + it(`should resolve top ${scrollMargin} against scrollport width`, () => { + const nodeRef = createRef(); + const scrollNodeRef = createRef(); + const root = Fantom.createRoot({ + viewportWidth: 1000, + viewportHeight: 1000, + }); + Fantom.runTask(() => { + root.render( + + + , + ); + }); + Fantom.scrollTo(nullthrows(scrollNodeRef.current), { + x: 0, + y: scrollY, + }); + + const entry = observeAndGetEntry(nullthrows(nodeRef.current), { + scrollMargin, + }); + expect(entry.isIntersecting).toBe(true); + expect(entry.intersectionRatio).toBe(0.8); + expectRectEquals(entry.intersectionRect, { + x: 0, + y: scrollY > 0 ? 80 : 120, + width: 50, + height: 40, + }); + }); + } + + it('should resolve percentages independently against each nested scrollport width', () => { + const nodeRef = createRef(); + const root = Fantom.createRoot({ + viewportWidth: 1000, + viewportHeight: 1000, + }); + Fantom.runTask(() => { + root.render( + + + + + , + ); + }); + + const entry = observeAndGetEntry(nullthrows(nodeRef.current), { + scrollMargin: '0px 0px 10% 0px', + }); + expect(entry.isIntersecting).toBe(true); + expect(entry.intersectionRatio).toBe(0.1); + expectRectEquals(entry.intersectionRect, { + x: 0, + y: 115, + width: 50, + height: 5, + }); + }); + it('should contract the scrollport clip with negative values', () => { // Target spans 60..110, so the unmodified scrollport clips it to // 60..100 (80% visible). @@ -4566,7 +4639,9 @@ describe('IntersectionObserver', () => { }); describe('explicit root', () => { - function renderTargetBelowTheFoldOfAScrollViewRoot(): { + function renderTargetBelowTheFoldOfAScrollViewRoot( + width: number = 100, + ): { scrollNode: HostInstance, node: HostInstance, } { @@ -4580,7 +4655,7 @@ describe('IntersectionObserver', () => { Fantom.runTask(() => { root.render( { }); }); - it('should combine with rootMargin on a scrollable root, resolving both against the undilated root', () => { + it('should combine with rootMargin on a scrollable root, resolving both against the undilated root width', () => { const {scrollNode, node} = - renderTargetBelowTheFoldOfAScrollViewRoot(); + renderTargetBelowTheFoldOfAScrollViewRoot(200); - // rootMargin adds 40px and scrollMargin 25% of the undilated 100px - // root (25px), so the clip is 0..165. Resolving the percentage - // against the rootMargin-dilated root (140px) would give 0..175. const entry = observeAndGetEntry(node, { root: scrollNode, - rootMargin: '0px 0px 40px 0px', + rootMargin: '10% 50px 40px 50px', scrollMargin: '0% 0% 25% 0%', }); expect(entry.isIntersecting).toBe(true); - expect(entry.intersectionRatio).toBe(0.3); + expect(entry.intersectionRatio).toBe(0.8); expectRectEquals(entry.intersectionRect, { x: 0, y: 150, width: 50, - height: 15, + height: 40, }); expectRectEquals(nullthrows(entry.rootBounds), { - x: 0, - y: 0, - width: 100, - height: 140, + x: -50, + y: -20, + width: 300, + height: 160, }); }); diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api index f214d60a07cd..111de25d6015 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api @@ -503,7 +503,7 @@ facebook::react::ColorComponents facebook::react::colorComponentsFromColor(faceb facebook::react::ColorComponents facebook::react::colorComponentsFromHostPlatformColor(facebook::react::Color color); facebook::react::ColorSpace facebook::react::getDefaultColorSpace(); facebook::react::DisplayType facebook::react::displayTypeFromYGDisplay(YGDisplay display); -facebook::react::EdgeInsets facebook::react::resolveEdgeMargins(const facebook::react::EdgeMargins& margins, const facebook::react::Size& size) noexcept; +facebook::react::EdgeInsets facebook::react::resolveEdgeMargins(const facebook::react::EdgeMargins& margins, facebook::react::Float referenceLength) noexcept; facebook::react::Float facebook::react::floatFromYogaFloat(float value); facebook::react::Float facebook::react::floatFromYogaOptionalFloat(facebook::yoga::FloatOptional value); facebook::react::LayoutMetrics facebook::react::layoutMetricsFromYogaNode(facebook::yoga::Node& yogaNode); diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api index f1811b25c34a..4a9df8b636ad 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api @@ -724,7 +724,7 @@ facebook::react::ColorComponents facebook::react::colorComponentsFromHostPlatfor facebook::react::ColorSpace facebook::react::getDefaultColorSpace(); facebook::react::ComponentRegistryFactory facebook::react::getDefaultComponentRegistryFactory(); facebook::react::DisplayType facebook::react::displayTypeFromYGDisplay(YGDisplay display); -facebook::react::EdgeInsets facebook::react::resolveEdgeMargins(const facebook::react::EdgeMargins& margins, const facebook::react::Size& size) noexcept; +facebook::react::EdgeInsets facebook::react::resolveEdgeMargins(const facebook::react::EdgeMargins& margins, facebook::react::Float referenceLength) noexcept; facebook::react::Float facebook::react::floatFromYogaFloat(float value); facebook::react::Float facebook::react::floatFromYogaOptionalFloat(facebook::yoga::FloatOptional value); facebook::react::LayoutMetrics facebook::react::layoutMetricsFromYogaNode(facebook::yoga::Node& yogaNode); diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api index 2ef1680b9010..671fa399cbd1 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api @@ -503,7 +503,7 @@ facebook::react::ColorComponents facebook::react::colorComponentsFromColor(faceb facebook::react::ColorComponents facebook::react::colorComponentsFromHostPlatformColor(facebook::react::Color color); facebook::react::ColorSpace facebook::react::getDefaultColorSpace(); facebook::react::DisplayType facebook::react::displayTypeFromYGDisplay(YGDisplay display); -facebook::react::EdgeInsets facebook::react::resolveEdgeMargins(const facebook::react::EdgeMargins& margins, const facebook::react::Size& size) noexcept; +facebook::react::EdgeInsets facebook::react::resolveEdgeMargins(const facebook::react::EdgeMargins& margins, facebook::react::Float referenceLength) noexcept; facebook::react::Float facebook::react::floatFromYogaFloat(float value); facebook::react::Float facebook::react::floatFromYogaOptionalFloat(facebook::yoga::FloatOptional value); facebook::react::LayoutMetrics facebook::react::layoutMetricsFromYogaNode(facebook::yoga::Node& yogaNode); diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api index 2ef1680b9010..671fa399cbd1 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api @@ -503,7 +503,7 @@ facebook::react::ColorComponents facebook::react::colorComponentsFromColor(faceb facebook::react::ColorComponents facebook::react::colorComponentsFromHostPlatformColor(facebook::react::Color color); facebook::react::ColorSpace facebook::react::getDefaultColorSpace(); facebook::react::DisplayType facebook::react::displayTypeFromYGDisplay(YGDisplay display); -facebook::react::EdgeInsets facebook::react::resolveEdgeMargins(const facebook::react::EdgeMargins& margins, const facebook::react::Size& size) noexcept; +facebook::react::EdgeInsets facebook::react::resolveEdgeMargins(const facebook::react::EdgeMargins& margins, facebook::react::Float referenceLength) noexcept; facebook::react::Float facebook::react::floatFromYogaFloat(float value); facebook::react::Float facebook::react::floatFromYogaOptionalFloat(facebook::yoga::FloatOptional value); facebook::react::LayoutMetrics facebook::react::layoutMetricsFromYogaNode(facebook::yoga::Node& yogaNode); diff --git a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api index 5fb34f123790..5220c0ceb048 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api @@ -3236,7 +3236,7 @@ facebook::react::ColorComponents facebook::react::colorComponentsFromColor(faceb facebook::react::ColorComponents facebook::react::colorComponentsFromHostPlatformColor(facebook::react::Color color); facebook::react::ColorSpace facebook::react::getDefaultColorSpace(); facebook::react::DisplayType facebook::react::displayTypeFromYGDisplay(YGDisplay display); -facebook::react::EdgeInsets facebook::react::resolveEdgeMargins(const facebook::react::EdgeMargins& margins, const facebook::react::Size& size) noexcept; +facebook::react::EdgeInsets facebook::react::resolveEdgeMargins(const facebook::react::EdgeMargins& margins, facebook::react::Float referenceLength) noexcept; facebook::react::Float facebook::react::floatFromYogaFloat(float value); facebook::react::Float facebook::react::floatFromYogaOptionalFloat(facebook::yoga::FloatOptional value); facebook::react::LayoutMetrics facebook::react::layoutMetricsFromYogaNode(facebook::yoga::Node& yogaNode); diff --git a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api index c191f3f7f57e..8e6f4acaf926 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api @@ -3498,7 +3498,7 @@ facebook::react::ColorComponents facebook::react::colorComponentsFromHostPlatfor facebook::react::ColorSpace facebook::react::getDefaultColorSpace(); facebook::react::ComponentRegistryFactory facebook::react::getDefaultComponentRegistryFactory(); facebook::react::DisplayType facebook::react::displayTypeFromYGDisplay(YGDisplay display); -facebook::react::EdgeInsets facebook::react::resolveEdgeMargins(const facebook::react::EdgeMargins& margins, const facebook::react::Size& size) noexcept; +facebook::react::EdgeInsets facebook::react::resolveEdgeMargins(const facebook::react::EdgeMargins& margins, facebook::react::Float referenceLength) noexcept; facebook::react::Float facebook::react::floatFromYogaFloat(float value); facebook::react::Float facebook::react::floatFromYogaOptionalFloat(facebook::yoga::FloatOptional value); facebook::react::LayoutMetrics facebook::react::layoutMetricsFromYogaNode(facebook::yoga::Node& yogaNode); diff --git a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api index 9f2987431905..246dcedcf942 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api @@ -3229,7 +3229,7 @@ facebook::react::ColorComponents facebook::react::colorComponentsFromColor(faceb facebook::react::ColorComponents facebook::react::colorComponentsFromHostPlatformColor(facebook::react::Color color); facebook::react::ColorSpace facebook::react::getDefaultColorSpace(); facebook::react::DisplayType facebook::react::displayTypeFromYGDisplay(YGDisplay display); -facebook::react::EdgeInsets facebook::react::resolveEdgeMargins(const facebook::react::EdgeMargins& margins, const facebook::react::Size& size) noexcept; +facebook::react::EdgeInsets facebook::react::resolveEdgeMargins(const facebook::react::EdgeMargins& margins, facebook::react::Float referenceLength) noexcept; facebook::react::Float facebook::react::floatFromYogaFloat(float value); facebook::react::Float facebook::react::floatFromYogaOptionalFloat(facebook::yoga::FloatOptional value); facebook::react::LayoutMetrics facebook::react::layoutMetricsFromYogaNode(facebook::yoga::Node& yogaNode); diff --git a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api index 1bfb2638d899..ab1b6ca0e18f 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api @@ -3236,7 +3236,7 @@ facebook::react::ColorComponents facebook::react::colorComponentsFromColor(faceb facebook::react::ColorComponents facebook::react::colorComponentsFromHostPlatformColor(facebook::react::Color color); facebook::react::ColorSpace facebook::react::getDefaultColorSpace(); facebook::react::DisplayType facebook::react::displayTypeFromYGDisplay(YGDisplay display); -facebook::react::EdgeInsets facebook::react::resolveEdgeMargins(const facebook::react::EdgeMargins& margins, const facebook::react::Size& size) noexcept; +facebook::react::EdgeInsets facebook::react::resolveEdgeMargins(const facebook::react::EdgeMargins& margins, facebook::react::Float referenceLength) noexcept; facebook::react::Float facebook::react::floatFromYogaFloat(float value); facebook::react::Float facebook::react::floatFromYogaOptionalFloat(facebook::yoga::FloatOptional value); facebook::react::LayoutMetrics facebook::react::layoutMetricsFromYogaNode(facebook::yoga::Node& yogaNode); diff --git a/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api index b4dfb20bf2f7..2482b3ae04dd 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api @@ -165,7 +165,7 @@ facebook::jsi::Value facebook::react::createPromiseAsJSIValue(facebook::jsi::Run facebook::react::ColorComponents facebook::react::colorComponentsFromColor(facebook::react::SharedColor color); facebook::react::ColorSpace facebook::react::getDefaultColorSpace(); facebook::react::DisplayType facebook::react::displayTypeFromYGDisplay(YGDisplay display); -facebook::react::EdgeInsets facebook::react::resolveEdgeMargins(const facebook::react::EdgeMargins& margins, const facebook::react::Size& size) noexcept; +facebook::react::EdgeInsets facebook::react::resolveEdgeMargins(const facebook::react::EdgeMargins& margins, Float referenceLength) noexcept; facebook::react::LayoutMetrics facebook::react::layoutMetricsFromYogaNode(facebook::yoga::Node& yogaNode); facebook::react::Rect facebook::react::insetBy(const facebook::react::Rect& rect, const facebook::react::EdgeInsets& insets) noexcept; facebook::react::Rect facebook::react::outsetBy(const facebook::react::Rect& rect, const facebook::react::EdgeInsets& outsets) noexcept; diff --git a/scripts/cxx-api/api-snapshots/ReactCommonFrameworksCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonFrameworksCxx.api index e51e5f696060..9852f8d2d3ae 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonFrameworksCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonFrameworksCxx.api @@ -325,7 +325,7 @@ facebook::react::ColorComponents facebook::react::colorComponentsFromColor(faceb facebook::react::ColorSpace facebook::react::getDefaultColorSpace(); facebook::react::ComponentRegistryFactory facebook::react::getDefaultComponentRegistryFactory(); facebook::react::DisplayType facebook::react::displayTypeFromYGDisplay(YGDisplay display); -facebook::react::EdgeInsets facebook::react::resolveEdgeMargins(const facebook::react::EdgeMargins& margins, const facebook::react::Size& size) noexcept; +facebook::react::EdgeInsets facebook::react::resolveEdgeMargins(const facebook::react::EdgeMargins& margins, Float referenceLength) noexcept; facebook::react::LayoutMetrics facebook::react::layoutMetricsFromYogaNode(facebook::yoga::Node& yogaNode); facebook::react::ParagraphAttributes facebook::react::convertRawProp(const facebook::react::PropsParserContext& context, const facebook::react::RawProps& rawProps, const facebook::react::ParagraphAttributes& sourceParagraphAttributes, const facebook::react::ParagraphAttributes& defaultParagraphAttributes); facebook::react::Rect facebook::react::insetBy(const facebook::react::Rect& rect, const facebook::react::EdgeInsets& insets) noexcept; diff --git a/scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api index 2359eef6f8c1..e882519bc956 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api @@ -165,7 +165,7 @@ facebook::jsi::Value facebook::react::createPromiseAsJSIValue(facebook::jsi::Run facebook::react::ColorComponents facebook::react::colorComponentsFromColor(facebook::react::SharedColor color); facebook::react::ColorSpace facebook::react::getDefaultColorSpace(); facebook::react::DisplayType facebook::react::displayTypeFromYGDisplay(YGDisplay display); -facebook::react::EdgeInsets facebook::react::resolveEdgeMargins(const facebook::react::EdgeMargins& margins, const facebook::react::Size& size) noexcept; +facebook::react::EdgeInsets facebook::react::resolveEdgeMargins(const facebook::react::EdgeMargins& margins, Float referenceLength) noexcept; facebook::react::LayoutMetrics facebook::react::layoutMetricsFromYogaNode(facebook::yoga::Node& yogaNode); facebook::react::Rect facebook::react::insetBy(const facebook::react::Rect& rect, const facebook::react::EdgeInsets& insets) noexcept; facebook::react::Rect facebook::react::outsetBy(const facebook::react::Rect& rect, const facebook::react::EdgeInsets& outsets) noexcept; diff --git a/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api index 2359eef6f8c1..e882519bc956 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api @@ -165,7 +165,7 @@ facebook::jsi::Value facebook::react::createPromiseAsJSIValue(facebook::jsi::Run facebook::react::ColorComponents facebook::react::colorComponentsFromColor(facebook::react::SharedColor color); facebook::react::ColorSpace facebook::react::getDefaultColorSpace(); facebook::react::DisplayType facebook::react::displayTypeFromYGDisplay(YGDisplay display); -facebook::react::EdgeInsets facebook::react::resolveEdgeMargins(const facebook::react::EdgeMargins& margins, const facebook::react::Size& size) noexcept; +facebook::react::EdgeInsets facebook::react::resolveEdgeMargins(const facebook::react::EdgeMargins& margins, Float referenceLength) noexcept; facebook::react::LayoutMetrics facebook::react::layoutMetricsFromYogaNode(facebook::yoga::Node& yogaNode); facebook::react::Rect facebook::react::insetBy(const facebook::react::Rect& rect, const facebook::react::EdgeInsets& insets) noexcept; facebook::react::Rect facebook::react::outsetBy(const facebook::react::Rect& rect, const facebook::react::EdgeInsets& outsets) noexcept;