From 98786970152bbefc8192e652525087296f35783f Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Fri, 16 Oct 2026 05:25:26 -0700 Subject: [PATCH 1/2] Fix `Style::operator==` ignoring `boxSizing` (#2029) Summary: `Style::operator==` compares every style field except `boxSizing_`, so two styles that only differ in box sizing compare equal. `YGNodeCopyStyle` then skips the copy and leaves the destination node with the old box sizing, and callers that compare styles to decide whether a node needs relayout miss the change. Compare `boxSizing_` together with the other enum fields. Reviewed By: cortinico Differential Revision: D125427467 --- packages/react-native/ReactCommon/yoga/yoga/style/Style.h | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-native/ReactCommon/yoga/yoga/style/Style.h b/packages/react-native/ReactCommon/yoga/yoga/style/Style.h index 00af38c692b4..a25d3a28ebe9 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/style/Style.h +++ b/packages/react-native/ReactCommon/yoga/yoga/style/Style.h @@ -653,6 +653,7 @@ class YG_EXPORT Style { alignItems_ == other.alignItems_ && alignSelf_ == other.alignSelf_ && positionType_ == other.positionType_ && flexWrap_ == other.flexWrap_ && overflow_ == other.overflow_ && display_ == other.display_ && + boxSizing_ == other.boxSizing_ && numbersEqual(flex_, pool_, other.flex_, other.pool_) && numbersEqual(flexGrow_, pool_, other.flexGrow_, other.pool_) && numbersEqual(flexShrink_, pool_, other.flexShrink_, other.pool_) && From 83b6678d419b583567d45cc5e4f316ca3e988812 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Fri, 16 Oct 2026 05:25:26 -0700 Subject: [PATCH 2/2] Update box-sizing invalidation regression coverage Summary: Update the Fantom regression test to reflect Yoga style equality including `boxSizing`. Assert that native content-box updates invalidate layout on the first rerender, and remove the stale follow-up rerender. Changelog: [Internal] Differential Revision: D125660351 --- .../__tests__/View-flexBasisFitContent-itest.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/packages/react-native/Libraries/Components/View/__tests__/View-flexBasisFitContent-itest.js b/packages/react-native/Libraries/Components/View/__tests__/View-flexBasisFitContent-itest.js index e9f1f5fa786b..0b03d544f783 100644 --- a/packages/react-native/Libraries/Components/View/__tests__/View-flexBasisFitContent-itest.js +++ b/packages/react-native/Libraries/Components/View/__tests__/View-flexBasisFitContent-itest.js @@ -342,7 +342,7 @@ test('percentage padding tracks an updated owner width', () => { ); }); -test('gates native box sizing cache invalidation', () => { +test('invalidates layout immediately when native box sizing changes', () => { const root = Fantom.createRoot({ viewportHeight: 280, viewportWidth: 240, @@ -399,17 +399,6 @@ test('gates native box sizing cache invalidation', () => { }); render(40); - const layoutAfterFirstRerender = { - leafWidth: nullthrows(leafRef.current).getBoundingClientRect().width, - scrollWidth: nullthrows(scrollRef.current).getBoundingClientRect().width, - }; - expect(layoutAfterFirstRerender).toEqual({ - leafWidth: 83, - scrollWidth: 83, - }); - - render(53); - expect({ leafWidth: nullthrows(leafRef.current).getBoundingClientRect().width, scrollWidth: nullthrows(scrollRef.current).getBoundingClientRect().width,