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 @@ + + +
hello
+ diff --git a/layout/style/crashtests/crashtests.list b/layout/style/crashtests/crashtests.list index 1be03042c13f..7a7752c81372 100644 --- a/layout/style/crashtests/crashtests.list +++ b/layout/style/crashtests/crashtests.list @@ -160,4 +160,5 @@ pref(dom.animations-api.core.enabled,true) load 1290994-2.html pref(dom.animations-api.core.enabled,true) load 1290994-3.html load 1290994-4.html load 1314531.html +load 1315889-1.html load 1315894-1.html