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

Make ::marker pseudo-elements inspectable without crashing #3529

Merged
merged 3 commits into from
Feb 12, 2025

Conversation

AtkinsSJ
Copy link
Member

Fixes #2432.

Just to demonstrate, here's me inspecting a ::marker with color: orange set on it, and seeing that show up in the inspector. (It's hard to see the actual orange colour because of the highlight but it is there I promise. 😆 )

image

I believe ::marker is the only generated pseudo-element that did not already have its computed style cached, so this shouldn't affect any other pseudo-elements. However, to avoid such crashes, I've changed the inspection code to print a debug message instead of trying to deref a null ComputedProperties pointer.

We only cache pseudo-element computed style for ::before and ::after
currently, so avoid dereferencing a null ComputedProperties pointer.
This allows us to inspect its properties. To avoid wasted work, we only
compute and cache the properties if the originating element was, or is,
displaying as a list item.
We can't simply walk the element tree and pass in `pseudo_element` each
time. Instead, we want to look at:

1. Element's pseudo-element
2. Element
3. Element's parents
@AtkinsSJ
Copy link
Member Author

Aaand another commit because I noticed that the custom properties table for pseudo-elements was missing some entries.

@AtkinsSJ AtkinsSJ merged commit 7dbef8d into LadybirdBrowser:master Feb 12, 2025
7 checks passed
@AtkinsSJ AtkinsSJ deleted the inspector-marker-crash branch February 12, 2025 13:48
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.

Clicking on this ::marker in dev tools crashes the page
1 participant