Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Youssef1313
Copy link
Member

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:

Other information

Internal Issue (If applicable):

@github-actions github-actions bot added platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform area/skia ✏️ Categorizes an issue or PR as relevant to Skia labels Aug 16, 2024
@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-17961/index.html

@unodevops
Copy link
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-17961/index.html

@Youssef1313 Youssef1313 force-pushed the cleanup-hittest-coercion2 branch from de444e9 to 4420403 Compare August 16, 2024 18:53
@unodevops
Copy link
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-17961/index.html

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-17961/index.html

@Youssef1313 Youssef1313 force-pushed the cleanup-hittest-coercion2 branch from 4420403 to 4a9f084 Compare August 16, 2024 19:56
@unodevops
Copy link
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-17961/index.html

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-17961/index.html

@Youssef1313 Youssef1313 marked this pull request as ready for review August 17, 2024 03:20
return HitTestability.Collapsed;
}

element = GetParentUIElement(element);
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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,
Copy link
Member

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?

Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/skia ✏️ Categorizes an issue or PR as relevant to Skia platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants