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(dialog): avoid repainting dialog content element on scroll #6890

Merged
merged 1 commit into from
Sep 12, 2017

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Sep 6, 2017

Fixes the <md-dialog-content> element being repainted on scroll.

Fixes #6878.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Sep 6, 2017
@@ -35,6 +35,9 @@ $mat-dialog-button-margin: 8px !default;
max-height: $mat-dialog-max-height;
overflow: auto;
-webkit-overflow-scrolling: touch;

// Promote the content to a new GPU layer to avoid repaints on scroll.
backface-visibility: hidden;
Copy link
Member

Choose a reason for hiding this comment

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

Why was it repainting on scroll in the first place?

Copy link
Contributor

Choose a reason for hiding this comment

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

Better solution to moving to GPU is transform: translate3d(0, 0, 0)
Or the will-change property is getting more support

Copy link
Member Author

@crisbeto crisbeto Sep 7, 2017

Choose a reason for hiding this comment

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

@Lindsor the result is exactly the same. I went with backface-visibility, because transform might cause the content to be blurry in some browsers.

@jelbourn I'm not sure, it's all up to the browser. My best guess is because it's in a fixed element and it has an explicit overflow: auto.

@crisbeto crisbeto changed the title perf(dialog): avoid repaintin dialog content element on scroll perf(dialog): avoid repainting dialog content element on scroll Sep 7, 2017
@crisbeto crisbeto force-pushed the 6878/dialog-content-paint branch 2 times, most recently from f58d1b4 to bf03370 Compare September 7, 2017 05:53
Fixes the `<md-dialog-content>` element being repainted on scroll.

Fixes angular#6878.
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 and removed pr: needs review labels Sep 7, 2017
@mmalerba mmalerba merged commit 51396d0 into angular:master Sep 12, 2017
josephperrott pushed a commit to josephperrott/components that referenced this pull request Sep 15, 2017
…ar#6890)

Fixes the `<md-dialog-content>` element being repainted on scroll.

Fixes angular#6878.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Oct 18, 2017
Along the same lines as angular#7721, angular#7719 and angular#6890 the tab body currently repaints on scroll.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Oct 18, 2017
Along the same lines as angular#7721, angular#7719 and angular#6890 the tab body currently repaints on scroll.
andrewseguin pushed a commit that referenced this pull request Nov 2, 2017
Along the same lines as #7721, #7719 and #6890 the tab body currently repaints on scroll.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Feb 19, 2018
A while ago we added a `backface-visibility` to some components that have scrollable content in order to avoid repaints while scrolling (see angular#7889, angular#7721, angular#7719, angular#6890, angular#2156) which worked at the time, however in the more recent versions of Chrome it causes the content in RTL mode to shift whenever a child has a transform that is being animated (in our case it's usually ripples). These changes revert the `backface-visibility` in order to avoid the jumping, until we can find a better solution.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Feb 19, 2018
A while ago we added a `backface-visibility` to some components that have scrollable content in order to avoid repaints while scrolling (see angular#7889, angular#7721, angular#7719, angular#6890, angular#2156) which worked at the time, however in the more recent versions of Chrome it causes the content in RTL mode to shift whenever a child has a transform that is being animated (in our case it's usually ripples). These changes revert the `backface-visibility` in order to avoid the jumping, until we can find a better solution.

Relates to angular#10023.
jelbourn pushed a commit that referenced this pull request Feb 26, 2018
A while ago we added a `backface-visibility` to some components that have scrollable content in order to avoid repaints while scrolling (see #7889, #7721, #7719, #6890, #2156) which worked at the time, however in the more recent versions of Chrome it causes the content in RTL mode to shift whenever a child has a transform that is being animated (in our case it's usually ripples). These changes revert the `backface-visibility` in order to avoid the jumping, until we can find a better solution.

Relates to #10023.
mmalerba pushed a commit to mmalerba/components that referenced this pull request Feb 26, 2018
)

A while ago we added a `backface-visibility` to some components that have scrollable content in order to avoid repaints while scrolling (see angular#7889, angular#7721, angular#7719, angular#6890, angular#2156) which worked at the time, however in the more recent versions of Chrome it causes the content in RTL mode to shift whenever a child has a transform that is being animated (in our case it's usually ripples). These changes revert the `backface-visibility` in order to avoid the jumping, until we can find a better solution.

Relates to angular#10023.
jelbourn pushed a commit to jelbourn/components that referenced this pull request Feb 27, 2018
)

A while ago we added a `backface-visibility` to some components that have scrollable content in order to avoid repaints while scrolling (see angular#7889, angular#7721, angular#7719, angular#6890, angular#2156) which worked at the time, however in the more recent versions of Chrome it causes the content in RTL mode to shift whenever a child has a transform that is being animated (in our case it's usually ripples). These changes revert the `backface-visibility` in order to avoid the jumping, until we can find a better solution.

Relates to angular#10023.
@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 Sep 7, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance issue: md-dialog-content on desktop
5 participants