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

Should isolation be added conditionally? #181

Open
khushalsagar opened this issue Aug 16, 2022 · 2 comments
Open

Should isolation be added conditionally? #181

khushalsagar opened this issue Aug 16, 2022 · 2 comments
Labels
open-spec-issue Unaddressed issue in the spec

Comments

@khushalsagar
Copy link
Collaborator

Currently we only add the isolation: isolate property if the ::page-transition-container has both images. Since it's only needed to blend both and unnecessarily adding it is perf overhead. Is that ok or should we always add it.

For resolving issue

@khushalsagar khushalsagar added the open-spec-issue Unaddressed issue in the spec label Aug 16, 2022
@jakearchibald
Copy link
Collaborator

jakearchibald commented Aug 18, 2022

It seems like a fairly straight forward UA optimisation, unless I'm missing something:

  1. If the element has isolation: isolate:
    1. If the element contains 0 renderable children: No need to isolate.
    2. Else, if the element contain no renderable descendants with a non-normal mix-blend-mode (ignoring descendant isolated elements), then create a stacking context, but there's no need to apply isolation.
    3. Else, if the element contains 1 child, and none of its descendants have non-normal mix-blend-mode (ignoring descendant isolated elements, then create a stacking context, but there's no need to apply isolation.

@khushalsagar
Copy link
Collaborator Author

Yeah I'm going to see if we can optimize this internally. We need to detect whether isolation and mix-blend-mode are a no-op. The paint stack assumes that mix-blend-mode on any element implies that an offscreen render pass is needed, likely coz its rare that a node with a non-default mix-blend-mode is already a texture/single image. But we should be able to detect this case and optimize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-spec-issue Unaddressed issue in the spec
Projects
None yet
Development

No branches or pull requests

2 participants