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

perf(ripple): avoid page layouts from ripple elements #17253

Merged
merged 1 commit into from
Jan 29, 2020

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Oct 1, 2019

A while ago we removed the transform from the .mat-ripple element in order to avoid creating extra layers for elements that the user isn't interacting with. As a result the ripple elements can cause layouts to be triggered on the entire page, which is noticeable on larger pages (see #17252).

These changes are a hybrid solution where we add the transform, but only if the .mat-ripple element has content. This isn't bulletproof since the :empty selector can be invalidated by whitespace. For now this is our best solution that works across browsers, until the contain property gets better support.

Fixes #17252.

A while ago we removed the `transform` from the `.mat-ripple` element in order to avoid creating extra layers for elements that the user isn't interacting with. As a result the ripple elements can cause layouts to be triggered on the entire page, which is noticeable on larger pages (see angular#17252).

These changes are a hybrid solution where we add the `transform`, but only if the `.mat-ripple` element has content. This isn't bulletproof since the `:empty` selector can be invalidated by whitespace. For now this is our best solution that works across browsers, until the `contain` property gets better support.

Fixes angular#17252.
@crisbeto crisbeto added P2 The issue is important to a large percentage of users, with a workaround perf This issue is related to performance target: patch This PR is targeted for the next patch release labels Oct 1, 2019
@crisbeto crisbeto requested a review from devversion as a code owner October 1, 2019 16:55
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 1, 2019
Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too deep into the issue, but it sounds reasonable to me. Especially since we don't always elevate the ripple container (which would cause another performance/memory issue: #12647)

@crisbeto
Copy link
Member Author

@jelbourn @devversion this is still an issue. Should we keep this PR moving?

@jelbourn
Copy link
Member

jelbourn commented Dec 2, 2019

Yeah, there's not a presubmit result for it in the history, so I'll try to make sure one gets run tonight

Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. I think the hybrid solution makes sense. Also :empty seems okay since most of the time we control the ripple containers as part of the Material components.

@devversion devversion added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Dec 2, 2019
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn jelbourn merged commit 79330b7 into angular:master Jan 29, 2020
yifange pushed a commit to yifange/components that referenced this pull request Jan 30, 2020
A while ago we removed the `transform` from the `.mat-ripple` element in order to avoid creating extra layers for elements that the user isn't interacting with. As a result the ripple elements can cause layouts to be triggered on the entire page, which is noticeable on larger pages (see angular#17252).

These changes are a hybrid solution where we add the `transform`, but only if the `.mat-ripple` element has content. This isn't bulletproof since the `:empty` selector can be invalidated by whitespace. For now this is our best solution that works across browsers, until the `contain` property gets better support.

Fixes angular#17252.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement P2 The issue is important to a large percentage of users, with a workaround perf This issue is related to performance target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance issue when using many mat-button-toggle-group components
4 participants