perf(ios): move content to stacking context to improve scrolling performance on iOS devices (#22180)

This commit is contained in:
Liam DeBeasi
2020-10-29 16:41:20 -04:00
committed by GitHub
parent 67e570dc95
commit 9f44966d85

View File

@ -83,7 +83,24 @@
.scroll-y, .scroll-y,
.scroll-x { .scroll-x {
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
will-change: scroll-position;
/**
* This adds `.inner-scroll` as part of the
* stacking context in WebKit. Without it,
* children of ion-content are treated as
* siblings rather than descendants. This
* can result in the children being put
* into their own layers, degrading
* scrolling performance.
*
* An optimization called "layer backing
* sharing" usually kicks in to prevent
* this, but having translate3d defeats
* this optimization.
*
* See: https://bugs.webkit.org/show_bug.cgi?id=216701
*/
will-change: scroll-position, transform;
} }
.scroll-y { .scroll-y {