diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp
index 12e85a3b91fc..600d2d5f0597 100644
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -3202,6 +3202,18 @@ nsIFrame* nsCSSFrameConstructor::ConstructBlockRubyFrame(
SetRootElementFrameAndConstructCanvasAnonContent(newFrame, aState,
aFrameList);
}
+
+ nsFrameConstructorSaveState absoluteSaveState;
+ blockFrame->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
+ if (aStyleDisplay->IsAbsPosContainingBlock(newFrame)) {
+ aState.PushAbsoluteContainingBlock(blockFrame, blockFrame,
+ absoluteSaveState);
+ }
+ nsFrameConstructorSaveState floatSaveState;
+ if (blockFrame->IsFloatContainingBlock()) {
+ aState.PushFloatContainingBlock(blockFrame, floatSaveState);
+ }
+
nsFrameList childList;
ProcessChildren(aState, content, rubyStyle, rubyFrame, true, childList, false,
nullptr);
diff --git a/layout/generic/crashtests/1574552.html b/layout/generic/crashtests/1574552.html
new file mode 100644
index 000000000000..8a29aeb80dfd
--- /dev/null
+++ b/layout/generic/crashtests/1574552.html
@@ -0,0 +1,6 @@
+
+
+
+A
diff --git a/layout/generic/crashtests/crashtests.list b/layout/generic/crashtests/crashtests.list
index 734c67a95413..cf6c6db56de2 100644
--- a/layout/generic/crashtests/crashtests.list
+++ b/layout/generic/crashtests/crashtests.list
@@ -736,3 +736,4 @@ load 1346454-2.html
load 1555142.html
load 1562105.html
load 1571460.html
+load 1574552.html