Bug 1404140 - Return early when trying to flush to get the style of a disconnected element. r=heycam

We just don't return a styles for them anyway, and this simplifies the following
patches a bit.

Differential Revision: https://phabricator.services.mozilla.com/D40297
This commit is contained in:
Emilio Cobos Álvarez 2019-07-31 19:29:19 +02:00
Родитель d53b9edd1d
Коммит ac6ac81c6f
1 изменённых файлов: 7 добавлений и 0 удалений

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

@ -828,6 +828,13 @@ void nsComputedDOMStyle::UpdateCurrentStyleSources(bool aNeedsLayoutFlush) {
return;
}
// We don't return styles for disconnected elements anymore, so don't go
// through the trouble of flushing or what not.
if (!mElement->IsInComposedDoc()) {
ClearComputedStyle();
return;
}
// TODO(emilio): We may want to handle a few special-cases here:
//
// * https://github.com/w3c/csswg-drafts/issues/1964