-
Notifications
You must be signed in to change notification settings - Fork 742
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
refactor: Cleanup hit test coercion #17961
base: master
Are you sure you want to change the base?
refactor: Cleanup hit test coercion #17961
Conversation
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-17961/index.html |
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-17961/index.html |
de444e9
to
4420403
Compare
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-17961/index.html |
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-17961/index.html |
4420403
to
4a9f084
Compare
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-17961/index.html |
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-17961/index.html |
return HitTestability.Collapsed; | ||
} | ||
|
||
element = GetParentUIElement(element); |
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.
I don't see any interest to walk the tree up instead of relying on a pre-computed property (that is pushed to native elements on wasm for instance). This will be perform for each pointer so I would assume this change would have a negative perf impact.
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.
@dr1rrb It shouldn't happen for each pointer event, and will hopefully be rare (only when something that changes hit testability changes) and we previously propagated that down the tree, so I assume the parent chain is actually less of work?
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.
It should not: the down propagation is computed only when an element is being added into the tree or something that changes testability is updated...
Even if this approach is closer to winUI, we need to pre-compute the testability for native elements, so I don't see any interest to try to change the behavior.
@@ -116,7 +102,7 @@ public IAsyncOperation<DataPackageOperation> DropAsync(CoreDragInfo dragInfo) | |||
var target = VisualTreeHelper.HitTest( | |||
dragInfo.Position, | |||
xamlRoot, | |||
getTestability: GetDropHitTestability, | |||
isForDrop: 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.
This reduce the flexibilty of the HitTest
method, not sure about the gain?
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.
@dr1rrb I can try to refactor it back to gain a bit of flexibility back
GitHub Issue (If applicable): closes #
PR Type
What kind of change does this PR introduce?
What is the current behavior?
What is the new behavior?
PR Checklist
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Run
results.Other information
Internal Issue (If applicable):