Repository navigation
Pass the source revision to shouldNewRevisionDirtyMeasurement - #60581
Open
YevheniiKotyrlo wants to merge 1 commit into
Open
YevheniiKotyrlo wants to merge 1 commit into
YevheniiKotyrlo wants to merge 1 commit into
Conversation
YevheniiKotyrlo
force-pushed
the
fix/complete-clone-source-revision
branch
from
December 4, 2026 22:50
2627616 to
07e9679
Compare
`YogaLayoutableShadowNode::completeClone()` passed the clone itself as the `sourceShadowNode` argument, so an override comparing the new revision with its source compared the clone with itself and found no difference. Signed-off-by: YevheniiKotyrlo <44449990+YevheniiKotyrlo@users.noreply.github.com>
YevheniiKotyrlo
force-pushed
the
fix/complete-clone-source-revision
branch
from
December 4, 2026 22:50
07e9679 to
5d433c0
Compare
YevheniiKotyrlo
marked this pull request as ready for review
December 5, 2026 00:28
This was referenced Dec 5, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
YogaLayoutableShadowNode::completeClone()callsshouldNewRevisionDirtyMeasurement(*this, fragment), so the virtual'ssourceShadowNodeparameter receives the new revision rather than the node it was cloned from (YogaLayoutableShadowNode.cpp#L160-L169). An override that compares the new revision with its source compares the clone with itself, so it finds no difference. react-native-plain-text's override originally did, and changing the font size left every label at its old size until it moved the comparison into its clone constructor (performance.md#L608-L616).This passes
completeClone()'s ownsourceShadowNode.ParagraphShadowNode's override ignores the parameter, andFontScaledShadowNode's inViewTestforwards it to the base implementation, which ignores it, so neither changes.Related: #60583 changes the condition beside this call in
completeClone(); #60571 addsenableBaseline(), #60572 addsgetLayoutMargins()and #60578 correctsenableMeasurement()'s comment, all inYogaLayoutableShadowNode; #59048 and #59139 add tests toViewTest.cpp. This change applies onto each of them without conflict.Changelog:
[GENERAL] [FIXED] - Pass the source revision, not the clone, to
YogaLayoutableShadowNode::shouldNewRevisionDirtyMeasurement()Test Plan:
Added
ViewTest.completeCloneAsksWhetherToDirtyAgainstTheSourceRevision: a measurable leaf whose override dirties when the source's props differ from the clone's. Once laid out, a clone with the source's props stays clean, and a clone with new non-layout props, which leave the Yoga style unchanged, is dirty. Without the fix the second clone stays clean and the case fails.In
reactnativecommunity/react-native-android:latest, with clang 18 astest_react_common_cxxbuilds:CC=clang-18 CXX=clang++-18 ./gradlew :private:react-native-fantom:configureFantomTester,cmake --build private/react-native-fantom/build/tester --target react_renderer_components_view_tests, thenctest --test-dir private/react-native-fantom/build/tester/react-common-tests -R '^react/renderer/components/view/tests/':100% tests passed, 0 tests failed out of 113mainwith only the test applied,-Rnaming the new case: it fails at its last assertion:clang-format --dry-run --Werror23.1.4 on both files: no changesNot run here: the full
test_react_common_cxxjob,formatwith its pinned clang-format,validate_cxx_api_snapshots(no header changes), and the Android, iOS and Fantom builds.