Skip to content

perf(ripple): contain layout, paint and style calculations to ripple container #13175

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

Closed
wants to merge 1 commit into from

Conversation

crisbeto
Copy link
Member

Uses CSS containment to contain the various layout and style calculations to the ripple container since they're independent of the rest of the page.

For reference, here are a couple of examples with and without containment. The top example is without.

demo
demo2

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Sep 17, 2018
@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Sep 17, 2018
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 added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Sep 17, 2018
@@ -10,12 +10,18 @@ $mat-ripple-color-opacity: 0.1;
.mat-ripple {
overflow: hidden;

// Limit style recalculations to the ripple container, as much as possible.
contain: strict;
Copy link
Member

Choose a reason for hiding this comment

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

I would consider this a breaking change because people could have changed the overflow or might do something else with the ripple container.

Since matRipple is a directive that can be applied on any element, and is not necessarily applied to an additional element, this might break some people.

Copy link
Member Author

Choose a reason for hiding this comment

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

I see what you mean, but I think that it would be a very narrow (if any) slice of users since they'd also have to have overridden the overflow: hidden at which point the ripple isn't super usable.

Copy link
Member

Choose a reason for hiding this comment

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

That's true. I don't mind seeing how it goes because technically the ripples are not even documented yet. Though if we fully follow the semver concept, this would be breaking.

Copy link
Member

Choose a reason for hiding this comment

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

http://www.hyrumslaw.com/

In reality, any change is a breaking change-- we're always making a judgement call to some extent.

Copy link
Member

@devversion devversion Sep 17, 2018

Choose a reason for hiding this comment

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

Kind of true 😅 , that's why I agreed that it's more unlikely that people might run into issues with that particular change.

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.

Code-wise LGTM. I'm a bit worried about the side-effects that contain might cause, but we'll see.

@jelbourn
Copy link
Member

We'll see if there are any issue reports during beta/rc

@crisbeto crisbeto force-pushed the ripple-css-containment branch from 7fa0e91 to 31f0483 Compare December 13, 2018 17:44
@mmalerba mmalerba added aaa and removed aaa labels Apr 25, 2019
…container

Uses [CSS containment](https://developer.mozilla.org/en-US/docs/Web/CSS/contain) to contain the various layout and style calculations to the ripple container since they're independent of the rest of the page.
@crisbeto crisbeto added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label Jun 30, 2019
@crisbeto crisbeto force-pushed the ripple-css-containment branch from 31f0483 to eb29bd7 Compare June 30, 2019 09:15
@crisbeto
Copy link
Member Author

crisbeto commented Oct 1, 2019

Closing in favor of #17253 since contain isn't supported very well.

@crisbeto crisbeto closed this Oct 1, 2019
@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 Nov 1, 2019
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 P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants