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

LibWeb: Improve handling of stacking contexts with pointer-events and continuation chains #3367

Conversation

gmta
Copy link
Collaborator

@gmta gmta commented Jan 25, 2025

Fixes all the clickable elements on https://null.com and https://discord.com/login.

CC @kalenikaliaksandr

gmta added 2 commits January 26, 2025 00:39
If a block element with its own stacking context has `pointer-events:
none` set, it should be ignored as far as hit-testing goes.

Fixes LadybirdBrowser#3357.
My previous attempt at resolving the continuation chain tried to deal
with `pointer-events: none` by repeatedly falling back to the parent
paintable until one was found that _would_ want to handle pointer
events. But since we were no longer performing hit-tests on those
paintables, false positives could pop up. This could happen for
out-of-flow block elements that did not overlap with their parent rects,
for example.

This approach works much better since it only handles the continuation
case that's relevant (the "middle" anonymous box) and it does so during
hit-testing instead of after, allowing all the other relevant logic to
come into play.
@gmta gmta force-pushed the libweb-pointer-events-and-stacking-contexts branch from d56f7d2 to c80253e Compare January 25, 2025 23:42
@kalenikaliaksandr kalenikaliaksandr merged commit 84c4702 into LadybirdBrowser:master Jan 26, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants