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: Make "assign slottables for a tree" fast when there are no slots #3345

Merged
merged 3 commits into from
Jan 23, 2025

Conversation

awesomekling
Copy link
Member

We achieve this by keeping track of the number of HTMLSlotElements inside each ShadowRoot (do via ad-hoc insertion and removal steps.)

This allows slottables assignment to skip over entire shadow roots when we know they have no slots anyway.

Massive speedup on https://wpt.fyi/ which no longer takes minutes/hours to load, but instead a "mere" 19 seconds. :^)

@awesomekling awesomekling marked this pull request as draft January 23, 2025 15:52
This will allow nodes to access the root they've just been removed from.
We achieve this by keeping track of the number of HTMLSlotElements
inside each ShadowRoot (do via ad-hoc insertion and removal steps.)

This allows slottables assignment to skip over entire shadow roots when
we know they have no slots anyway.

Massive speedup on https://wpt.fyi/ which no longer takes minutes/hours
to load, but instead a "mere" 19 seconds. :^)
@awesomekling awesomekling marked this pull request as ready for review January 23, 2025 17:18
@awesomekling awesomekling merged commit adc25af into LadybirdBrowser:master Jan 23, 2025
7 checks passed
@awesomekling awesomekling deleted the wpt-fyi-slotcount branch January 23, 2025 20:38
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