-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for nodes with display: contents
not being cleaned in some cases
#47194
Closed
+4
−3
Conversation
This file contains 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
Summary: Fixes a case where a node with `display: contents` would not be cleaned up in some cases. This was caused by it being called after some early returns handling different quick paths. This PR moves the call to `cleanupContentsNodesRecursively` earlier so that it's always called. Changelog: [General][Fixed] - Fix for nodes with `display: contents` not being cleaned in some cases X-link: facebook/yoga#1729 Differential Revision: D64910099 Pulled By: NickGerleman
facebook-github-bot
added
the
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
label
Oct 24, 2024
This pull request was exported from Phabricator. Differential Revision: D64910099 |
facebook-github-bot
pushed a commit
to facebook/yoga
that referenced
this pull request
Oct 26, 2024
#1729) Summary: X-link: facebook/react-native#47194 Fixes a case where a node with `display: contents` would not be cleaned up in some cases. This was caused by it being called after some early returns handling different quick paths. This PR moves the call to `cleanupContentsNodesRecursively` earlier so that it's always called. The problem here wasn't mutating before cloning, but leaving a node marked as dirty after the layout has finished. The exact case in which I found this was a node with a single `display: contents` child which needs to be a leaf. Then in the parent node [this](https://github.com/facebook/yoga/blob/b0b842d5e75d041e3af7e0ac55abfb8929fbbf21/yoga/algorithm/CalculateLayout.cpp#L1339) condition is true, so `cleanupContentsNodesRecursively` doesn't get called and the child node is never visited and cleaned. I assume the same will happen in the other paths with an early return here. Changelog: [General][Fixed] - Fix for nodes with `display: contents` not being cleaned in some cases Pull Request resolved: #1729 Reviewed By: rozele Differential Revision: D64910099 Pulled By: NickGerleman fbshipit-source-id: 6d56f8fbf687b7ee5af889c0b868406213c9cee8
facebook-github-bot
pushed a commit
to facebook/litho
that referenced
this pull request
Oct 26, 2024
Summary: X-link: facebook/react-native#47194 Fixes a case where a node with `display: contents` would not be cleaned up in some cases. This was caused by it being called after some early returns handling different quick paths. This PR moves the call to `cleanupContentsNodesRecursively` earlier so that it's always called. The problem here wasn't mutating before cloning, but leaving a node marked as dirty after the layout has finished. The exact case in which I found this was a node with a single `display: contents` child which needs to be a leaf. Then in the parent node [this](https://github.com/facebook/yoga/blob/b0b842d5e75d041e3af7e0ac55abfb8929fbbf21/yoga/algorithm/CalculateLayout.cpp#L1339) condition is true, so `cleanupContentsNodesRecursively` doesn't get called and the child node is never visited and cleaned. I assume the same will happen in the other paths with an early return here. Changelog: [General][Fixed] - Fix for nodes with `display: contents` not being cleaned in some cases X-link: facebook/yoga#1729 Reviewed By: rozele Differential Revision: D64910099 Pulled By: NickGerleman fbshipit-source-id: 6d56f8fbf687b7ee5af889c0b868406213c9cee8
@NickGerleman merged this pull request in a88ddce. |
This pull request was successfully merged by @j-piasecki in a88ddce When will my fix make it into a release? | How to file a pick request? |
facebook-github-bot
pushed a commit
that referenced
this pull request
Oct 31, 2024
Summary: Adds a page dedicated to `display: contents` to RNTester APIs section. Those can be used to verify that it's working correctly visually. Needs #47194 ## Changelog: [INTERNAL] [ADDED] - Added `display: contents` examples to RNTester Pull Request resolved: #47201 Test Plan: Row styles are ignored in new arch and TextInputs as leaf are hidden https://www.internalfb.com/compare-screenshots-from-diff/D65248256 Reviewed By: javache Differential Revision: D65248256 Pulled By: NickGerleman fbshipit-source-id: 90410e1380e4cdb22cb4cac5c8c21e08a088ce69
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
fb-exported
Merged
This PR has been merged.
p: Facebook
Partner: Facebook
Partner
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:
Fixes a case where a node with
display: contents
would not be cleaned up in some cases. This was caused by it being called after some early returns handling different quick paths. This PR moves the call tocleanupContentsNodesRecursively
earlier so that it's always called.Changelog:
[General][Fixed] - Fix for nodes with
display: contents
not being cleaned in some casesX-link: facebook/yoga#1729
Differential Revision: D64910099
Pulled By: NickGerleman