Bug 1684689 - Fix usage of createImageData in devtools. r=jdescottes

This fixes the DAMP failures and effectively preserves behavior.

Differential Revision: https://phabricator.services.mozilla.com/D100623
This commit is contained in:
Emilio Cobos Álvarez 2021-01-04 17:27:24 +00:00
Родитель df5f73e1b8
Коммит 1903289616
2 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -59,8 +59,10 @@ class WaterfallBackground {
}
// Nuke the context.
const canvasWidth = (this.canvas.width =
state.waterfallWidth - REQUESTS_WATERFALL.LABEL_WIDTH);
const canvasWidth = (this.canvas.width = Math.max(
state.waterfallWidth - REQUESTS_WATERFALL.LABEL_WIDTH,
1
));
// Awww yeah, 1px, repeats on Y axis.
const canvasHeight = (this.canvas.height = 1);

Просмотреть файл

@ -22,7 +22,7 @@ function drawWaterfallBackground(doc, dataScale, waterfallWidth) {
const ctx = canvas.getContext("2d");
// Nuke the context.
const canvasWidth = (canvas.width = waterfallWidth);
const canvasWidth = (canvas.width = Math.max(waterfallWidth, 1));
// Awww yeah, 1px, repeats on Y axis.
const canvasHeight = (canvas.height = 1);