Skip to content

Commit c6388ba

Browse files
committed
Replace layer hinting using will-change: transform with transform: translate3d(0px, 0px, 0px) (microsoft#84214)
1 parent 2054549 commit c6388ba

7 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/vs/base/browser/fastDomNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export class FastDomNode<T extends HTMLElement> {
205205
return;
206206
}
207207
this._layerHint = layerHint;
208-
(<any>this.domNode.style).willChange = this._layerHint ? 'transform' : 'auto';
208+
this.domNode.style.transform = this._layerHint ? 'translate3d(0px, 0px, 0px)' : '';
209209
}
210210

211211
public setContain(contain: 'none' | 'strict' | 'content' | 'size' | 'layout' | 'style' | 'paint'): void {

src/vs/base/browser/ui/list/listView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
234234

235235
this.rowsContainer = document.createElement('div');
236236
this.rowsContainer.className = 'monaco-list-rows';
237-
this.rowsContainer.style.willChange = 'transform';
237+
this.rowsContainer.style.transform = 'translate3d(0px, 0px, 0px)';
238238
this.disposables.add(Gesture.addTarget(this.rowsContainer));
239239

240240
this.scrollableElement = this.disposables.add(new ScrollableElement(this.rowsContainer, {

src/vs/base/browser/ui/progressbar/progressbar.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
animation-duration: 4s;
3636
animation-iteration-count: infinite;
3737
animation-timing-function: linear;
38-
will-change: transform;
38+
transform: translate3d(0px, 0px, 0px);
3939
}
4040

4141
/**

src/vs/editor/common/config/editorOptions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ export interface IEditorOptions {
186186
*/
187187
fontLigatures?: boolean | string;
188188
/**
189-
* Disable the use of `will-change` for the editor margin and lines layers.
190-
* The usage of `will-change` acts as a hint for browsers to create an extra layer.
189+
* Disable the use of `transform: translate3d(0px, 0px, 0px)` for the editor margin and lines layers.
190+
* The usage of `transform: translate3d(0px, 0px, 0px)` acts as a hint for browsers to create an extra layer.
191191
* Defaults to false.
192192
*/
193193
disableLayerHinting?: boolean;

src/vs/monaco.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2597,8 +2597,8 @@ declare namespace monaco.editor {
25972597
*/
25982598
fontLigatures?: boolean | string;
25992599
/**
2600-
* Disable the use of `will-change` for the editor margin and lines layers.
2601-
* The usage of `will-change` acts as a hint for browsers to create an extra layer.
2600+
* Disable the use of `transform: translate3d(0px, 0px, 0px)` for the editor margin and lines layers.
2601+
* The usage of `transform: translate3d(0px, 0px, 0px)` acts as a hint for browsers to create an extra layer.
26022602
* Defaults to false.
26032603
*/
26042604
disableLayerHinting?: boolean;

src/vs/workbench/browser/parts/editor/media/tabstitlecontrol.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
}
8585

8686
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.dragged {
87-
will-change: transform; /* forces tab to be drawn on a separate layer (fixes https://github.com/Microsoft/vscode/issues/18733) */
87+
transform: translate3d(0px, 0px, 0px); /* forces tab to be drawn on a separate layer (fixes https://github.com/Microsoft/vscode/issues/18733) */
8888
}
8989

9090
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.dragged-over div {

src/vs/workbench/browser/parts/notifications/media/notificationsToasts.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
transform: translateY(100%); /* move the notification 50px to the bottom (to prevent bleed through) */
3131
opacity: 0; /* fade the toast in */
3232
transition: transform 300ms ease-out, opacity 300ms ease-out;
33-
will-change: transform, opacity; /* force a separate layer for the toast to speed things up */
33+
transform: translate3d(0px, 0px, 0px); /* force a separate layer for the toast to speed things up */
3434
}
3535

3636
.monaco-workbench > .notifications-toasts .notification-toast-container > .notification-toast.notification-fade-in {
@@ -42,4 +42,4 @@
4242
opacity: 1;
4343
transform: none;
4444
transition: none;
45-
}
45+
}

0 commit comments

Comments
 (0)