-
Notifications
You must be signed in to change notification settings - Fork 24.9k
IntersectionObserver: Switch from ShadowNode to ShadowNodeFamily
#51089
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
Conversation
|
This pull request was exported from Phabricator. Differential Revision: D74130479 |
ac252b3 to
92a68aa
Compare
|
This pull request was exported from Phabricator. Differential Revision: D74130479 |
…acebook#51089) Summary: Currently, `IntersectionObserver#observe` retains a reference to the `ShadowNode` of the view that is supplied as an argument, which is used to compute intersection whenever a shadow tree is committed. However, the `shadowNode` includes all of child nodes and state at the time that `IntersectionObserver#observe` is called. This means that an active `IntersectionObserverEntry` will retain references to memory that would otherwise be deallocated (e.g. if children of the observed view are unmounted after `IntersectionObserver#observe` is called). This diff refactors `IntersectionObserver` to instead retain a reference to the `ShadowNodeFamily`, which does not retain references to child nodes and still eanbles `IntersectionObserver` to compute intersections. Changelog: [General][Changed] - Fixed `IntersectionObserver#observe` to avoid retaining memory for unmounted child nodes of observed views. Differential Revision: D74130479
92a68aa to
761107c
Compare
|
This pull request was exported from Phabricator. Differential Revision: D74130479 |
761107c to
e21a559
Compare
…acebook#51089) Summary: Currently, `IntersectionObserver#observe` retains a reference to the `ShadowNode` of the view that is supplied as an argument, which is used to compute intersection whenever a shadow tree is committed. However, the `shadowNode` includes all of child nodes and state at the time that `IntersectionObserver#observe` is called. This means that an active `IntersectionObserverEntry` will retain references to memory that would otherwise be deallocated (e.g. if children of the observed view are unmounted after `IntersectionObserver#observe` is called). This diff refactors `IntersectionObserver` to instead retain a reference to the `ShadowNodeFamily`, which does not retain references to child nodes and still eanbles `IntersectionObserver` to compute intersections. Changelog: [General][Changed] - Fixed `IntersectionObserver#observe` to avoid retaining memory for unmounted child nodes of observed views. Differential Revision: D74130479
…acebook#51089) Summary: Currently, `IntersectionObserver#observe` retains a reference to the `ShadowNode` of the view that is supplied as an argument, which is used to compute intersection whenever a shadow tree is committed. However, the `shadowNode` includes all of child nodes and state at the time that `IntersectionObserver#observe` is called. This means that an active `IntersectionObserverEntry` will retain references to memory that would otherwise be deallocated (e.g. if children of the observed view are unmounted after `IntersectionObserver#observe` is called). This diff refactors `IntersectionObserver` to instead retain a reference to the `ShadowNodeFamily`, which does not retain references to child nodes and still eanbles `IntersectionObserver` to compute intersections. Changelog: [General][Changed] - Fixed `IntersectionObserver#observe` to avoid retaining memory for unmounted child nodes of observed views. Differential Revision: D74130479
e21a559 to
e9bb16d
Compare
|
This pull request was exported from Phabricator. Differential Revision: D74130479 |
…acebook#51089) Summary: Pull Request resolved: facebook#51089 Currently, `IntersectionObserver#observe` retains a reference to the `ShadowNode` of the view that is supplied as an argument, which is used to compute intersection whenever a shadow tree is committed. However, the `shadowNode` includes all of child nodes and state at the time that `IntersectionObserver#observe` is called. This means that an active `IntersectionObserverEntry` will retain references to memory that would otherwise be deallocated (e.g. if children of the observed view are unmounted after `IntersectionObserver#observe` is called). This diff refactors `IntersectionObserver` to instead retain a reference to the `ShadowNodeFamily`, which does not retain references to child nodes and still eanbles `IntersectionObserver` to compute intersections. Changelog: [General][Changed] - Fixed `IntersectionObserver#observe` to avoid retaining memory for unmounted child nodes of observed views. Differential Revision: D74130479
e9bb16d to
10f6aff
Compare
…acebook#51089) Summary: Pull Request resolved: facebook#51089 Currently, `IntersectionObserver#observe` retains a reference to the `ShadowNode` of the view that is supplied as an argument, which is used to compute intersection whenever a shadow tree is committed. However, the `shadowNode` includes all of child nodes and state at the time that `IntersectionObserver#observe` is called. This means that an active `IntersectionObserverEntry` will retain references to memory that would otherwise be deallocated (e.g. if children of the observed view are unmounted after `IntersectionObserver#observe` is called). This diff refactors `IntersectionObserver` to instead retain a reference to the `ShadowNodeFamily`, which does not retain references to child nodes and still eanbles `IntersectionObserver` to compute intersections. Changelog: [General][Changed] - Fixed `IntersectionObserver#observe` to avoid retaining memory for unmounted child nodes of observed views. Differential Revision: D74130479
|
This pull request was exported from Phabricator. Differential Revision: D74130479 |
10f6aff to
c6bfab1
Compare
|
This pull request has been merged in d945c58. |
|
This pull request was successfully merged by @yungsters in d945c58 When will my fix make it into a release? | How to file a pick request? |
Summary:
Currently,
IntersectionObserver#observeretains a reference to theShadowNodeof the view that is supplied as an argument, which is used to compute intersection whenever a shadow tree is committed.However, the
shadowNodeincludes all of child nodes and state at the time thatIntersectionObserver#observeis called. This means that an activeIntersectionObserverEntrywill retain references to memory that would otherwise be deallocated (e.g. if children of the observed view are unmounted afterIntersectionObserver#observeis called).This diff refactors
IntersectionObserverto instead retain a reference to theShadowNodeFamily, which does not retain references to child nodes and still eanblesIntersectionObserverto compute intersections.Changelog:
[General][Changed] - Fixed
IntersectionObserver#observeto avoid retaining memory for unmounted child nodes of an observed view.Differential Revision: D74130479