diff --git a/layout/base/ServoRestyleManager.cpp b/layout/base/ServoRestyleManager.cpp index a74abe1d4363..e2de2d285833 100644 --- a/layout/base/ServoRestyleManager.cpp +++ b/layout/base/ServoRestyleManager.cpp @@ -366,6 +366,15 @@ ServoRestyleManager::ProcessPendingRestyles() ServoElementSnapshot* snapshot = iter.UserData(); Element* element = iter.Key(); + // The element is no longer in the document, so don't bother computing + // a final restyle hint for it. + // + // XXXheycam RestyleTracker checks that the element's GetComposedDoc() + // matches the document we're restyling. Do we need to do that too? + if (!element->IsInComposedDoc()) { + continue; + } + // TODO: avoid the ComputeRestyleHint call if we already have the highest // explicit restyle hint? nsRestyleHint hint = styleSet->ComputeRestyleHint(element, snapshot); diff --git a/layout/style/crashtests/1315889-1.html b/layout/style/crashtests/1315889-1.html new file mode 100644 index 000000000000..29186fac1c47 --- /dev/null +++ b/layout/style/crashtests/1315889-1.html @@ -0,0 +1,12 @@ + + +