Skip to content

[css-contain-2] Stop monkey-patching the HTML spec. #12105

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

emilio
Copy link
Collaborator

@emilio emilio commented Apr 21, 2025

This exports an "update content relevancy for a document" algorithm that HTML can call at the right time.

@emilio emilio force-pushed the no-monkey-patch branch from 620b6f1 to ec07976 Compare May 10, 2025 11:11
@vmpstr
Copy link
Member

vmpstr commented May 15, 2025

The new text looks good to me. One unfortunate consequence is that we always run the style&layout steps even if we know we have pending relevance changes which as far as I can tell pretty much guarantee that we'll have to run style&layout again.

Perhaps this is in the realm of browsers being able to optimize this, but it's unclear if there's interactions with other features that do require the initial style&layout before relevant state changes

@emilio emilio changed the title [css-contain-2] WIP: Stop monkey-patching the HTML spec. [css-contain-2] Stop monkey-patching the HTML spec. May 15, 2025
@emilio
Copy link
Collaborator Author

emilio commented May 17, 2025

The new text looks good to me. One unfortunate consequence is that we always run the style&layout steps even if we know we have pending relevance changes which as far as I can tell pretty much guarantee that we'll have to run style&layout again.

I think that's necessary tho, right? Otherwise whether you see the effect of something like:

el.focus();
el.style.contentVisibility = "auto";

On this frame or the next depends on whether something has updated style and layout in the interim, right?

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