-
Notifications
You must be signed in to change notification settings - Fork 29.2k
Fix a [_ViewportElement] RenderObjectChild update bug #96377
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
} | ||
} | ||
|
||
// `moveRenderObjectChild` only happens during [update] stage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems an invalid comment that's indicating the wrong method and didn't start with ///
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just comment that why not override moveRenderObjectChild
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it say it? It wasn't immediately clear for me either
For example
// We don't override `moveRenderObjectChild` here, because it only happens
// during [update] stage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or: Do override moveRenderObjectChild, which just calls super and has an assert that _doingMountOrUpdate is true to show & proof that the comment is true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or: Do override moveRenderObjectChild, which just calls super and has an assert that _doingMountOrUpdate is true to show & proof that the comment is true.
Done and add a test to test it.
} | ||
} | ||
|
||
// `moveRenderObjectChild` only happens during [update] stage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or: Do override moveRenderObjectChild, which just calls super and has an assert that _doingMountOrUpdate is true to show & proof that the comment is true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #96024
Fixes #55170
Fixes #25861
The
RenderViewport
keep a child RO by 'center', it will be updated in [_ViewportElement.mount] or [Update].But sometimes the child RO will be changed without [_ViewportElement] change when only the subtree of
Viewport
is dirty.In that case, we should also update the center RO.
Similar to the root cause of this issue, it has a similar solution.