Bug 1373767 part 1: Always make nsMathMLmathBlockFrame a block formatting context. r=bz
(This makes it behave a bit more like a normal CSS block, and it ensures that
it can provide a float manager to its descendants.)
MozReview-Commit-ID: FmnQYjzD2eD
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -5292,17 +5292,16 @@ nsCSSFrameConstructor::FlushAccumulatedB
blockContext = styleSet->
ResolveInheritingAnonymousBoxStyle(anonPseudo, parentContext);
// then, create a block frame that will wrap the child frames. Make it a
// MathML frame so that Get(Absolute/Float)ContainingBlockFor know that this
// is not a suitable block.
nsContainerFrame* blockFrame =
NS_NewMathMLmathBlockFrame(mPresShell, blockContext);
- blockFrame->AddStateBits(NS_BLOCK_FORMATTING_CONTEXT_STATE_BITS);
InitAndRestoreFrame(aState, aContent, aParentFrame, blockFrame);
ReparentFrames(this, blockFrame, aBlockItems, false);
// We have to walk over aBlockItems before we hand it over to blockFrame.
for (nsIFrame* f : aBlockItems) {
f->SetParentIsWrapperAnonBox();
}
// abs-pos and floats are disabled in MathML children so we don't have to
new file mode 100644
--- /dev/null
+++ b/layout/mathml/crashtests/1373767-1.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="UTF-8">
+<style>
+math {
+ position: fixed;
+}
+div {
+ transform: translateZ(0px);
+}
+body {
+ display: -moz-grid;
+}
+</style>
+</head>
+<body>
+<div>
+<math></math>
+</div>
+</body>
+</html>
--- a/layout/mathml/crashtests/crashtests.list
+++ b/layout/mathml/crashtests/crashtests.list
@@ -60,9 +60,10 @@ load 713606-1.html
load 716349-1.html
load 767251.xhtml
load 848725-1.html
load 848725-2.html
load 947557-1.html
load 973322-1.xhtml
load 1028521-1.xhtml
load 1061027.html
+load 1373767-1.html
load 1376158.html
--- a/layout/mathml/nsMathMLContainerFrame.cpp
+++ b/layout/mathml/nsMathMLContainerFrame.cpp
@@ -1544,17 +1544,19 @@ nsMathMLContainerFrame::ReportInvalidChi
return ReportErrorToConsole("InvalidChild", argv, 2);
}
//==========================
nsContainerFrame*
NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
- return new (aPresShell) nsMathMLmathBlockFrame(aContext);
+ auto newFrame = new (aPresShell) nsMathMLmathBlockFrame(aContext);
+ newFrame->AddStateBits(NS_BLOCK_FORMATTING_CONTEXT_STATE_BITS);
+ return newFrame;
}
NS_IMPL_FRAMEARENA_HELPERS(nsMathMLmathBlockFrame)
NS_QUERYFRAME_HEAD(nsMathMLmathBlockFrame)
NS_QUERYFRAME_ENTRY(nsMathMLmathBlockFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame)