-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/lib/core/ripple/_ripple.scss
Outdated
@@ -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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In reality, any change is a breaking change-- we're always making a judgement call to some extent.
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
We'll see if there are any issue reports during beta/rc |
7fa0e91
to
31f0483
Compare
…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.
31f0483
to
eb29bd7
Compare
Closing in favor of #17253 since |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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.