diff --git a/layout/base/RestyleManager.cpp b/layout/base/RestyleManager.cpp index 386a823e7987..dd37beeed48c 100644 --- a/layout/base/RestyleManager.cpp +++ b/layout/base/RestyleManager.cpp @@ -3522,7 +3522,7 @@ RestyleManager::DoReparentComputedStyleForFirstLine(nsIFrame* aFrame, ReparentFrameDescendants(aFrame, providerChild, aStyleSet); // We do not need to do the equivalent of UpdateFramePseudoElementStyles, - // because those are hadled by our descendant walk. + // because those are handled by our descendant walk. } void @@ -3530,6 +3530,12 @@ RestyleManager::ReparentFrameDescendants(nsIFrame* aFrame, nsIFrame* aProviderChild, ServoStyleSet& aStyleSet) { + if (aFrame->GetContent()->IsElement() && + !aFrame->GetContent()->AsElement()->HasServoData()) { + // We're getting into a display: none subtree, avoid reparenting into stuff + // that is going to go away anyway in seconds. + return; + } nsIFrame::ChildListIterator lists(aFrame); for (; !lists.IsDone(); lists.Next()) { for (nsIFrame* child : lists.CurrentList()) { diff --git a/layout/style/crashtests/1455108.html b/layout/style/crashtests/1455108.html new file mode 100644 index 000000000000..29b146779704 --- /dev/null +++ b/layout/style/crashtests/1455108.html @@ -0,0 +1,17 @@ + + +
Yo, I'm a first-line really + diff --git a/layout/style/crashtests/crashtests.list b/layout/style/crashtests/crashtests.list index bf19178b9566..7300e05c27ec 100644 --- a/layout/style/crashtests/crashtests.list +++ b/layout/style/crashtests/crashtests.list @@ -273,3 +273,4 @@ pref(dom.webcomponents.shadowdom.enabled,true) load 1445682.html load 1450691.html pref(dom.webcomponents.shadowdom.enabled,true) load 1453206.html load 1454140.html +load 1455108.html