Bug 1663636 - Prevent trying to fetch font faces of destroyed node fronts. r=jdescottes

This isn't really related to EventLoop, but this is another exception thrown when running DAMP.
This time related to a request made against an already destroyed NodeFront.

Differential Revision: https://phabricator.services.mozilla.com/D89451
This commit is contained in:
Alexandre Poirot 2020-09-08 16:31:03 +00:00
Родитель 550422b87a
Коммит ebe9679c75
1 изменённых файлов: 4 добавлений и 0 удалений

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

@ -219,6 +219,10 @@ class ElementStyle {
getUsedFontFamilies() {
return new Promise((resolve, reject) => {
this.ruleView.styleWindow.requestIdleCallback(async () => {
if (this.element.isDestroyed()) {
resolve([]);
return;
}
try {
const fonts = await this.pageStyle.getUsedFontFaces(this.element, {
includePreviews: false,