From 60ca44ae8074234441591996f72cfebdb78ea857 Mon Sep 17 00:00:00 2001 From: "rbs%maths.uq.edu.au" Date: Fri, 16 Sep 2005 00:16:40 +0000 Subject: [PATCH] Fully update the state even on invalid markups to avoid crashing, b=307839, r+sr=bz, a=asa git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@180339 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/mathml/base/src/nsMathMLContainerFrame.cpp | 6 ++++-- mozilla/layout/mathml/base/src/nsMathMLmoverFrame.cpp | 2 -- mozilla/layout/mathml/base/src/nsMathMLmunderFrame.cpp | 2 -- mozilla/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp | 2 -- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.cpp index c689ade4714..6245e458cb1 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.cpp @@ -525,7 +525,7 @@ nsMathMLContainerFrame::PropagatePresentationDataFor(nsIFrame* aFrame, PRUint32 aFlagsValues, PRUint32 aFlagsToUpdate) { - if (!aFlagsToUpdate && !aScriptLevelIncrement) + if (!aFrame || (!aFlagsToUpdate && !aScriptLevelIncrement)) return; nsIMathMLFrame* mathMLFrame; aFrame->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLFrame); @@ -557,7 +557,7 @@ nsMathMLContainerFrame::PropagatePresentationDataFromChildAt(nsIFrame* aPa PRUint32 aFlagsValues, PRUint32 aFlagsToUpdate) { - if (!aFlagsToUpdate && !aScriptLevelIncrement) + if (!aParentFrame || (!aFlagsToUpdate && !aScriptLevelIncrement)) return; PRInt32 index = 0; nsIFrame* childFrame = aParentFrame->GetFirstChild(nsnull); @@ -582,6 +582,8 @@ nsMathMLContainerFrame::PropagatePresentationDataFromChildAt(nsIFrame* aPa nsMathMLContainerFrame::PropagateScriptStyleFor(nsIFrame* aFrame, PRInt32 aParentScriptLevel) { + if (!aFrame) + return; nsIMathMLFrame* mathMLFrame; aFrame->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLFrame); if (mathMLFrame) { diff --git a/mozilla/layout/mathml/base/src/nsMathMLmoverFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmoverFrame.cpp index eda8102fed8..82595f49a14 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmoverFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmoverFrame.cpp @@ -191,8 +191,6 @@ XXX The winner is the outermost in conflicting settings like these: nsIFrame* baseFrame = mFrames.FirstChild(); if (baseFrame) overscriptFrame = baseFrame->GetNextSibling(); - if (!baseFrame || !overscriptFrame) - return NS_OK; // a visual error indicator will be reported later during layout // if our base is an embellished operator, let its state bubble to us (in particular, // this is where we get the flag for NS_MATHML_EMBELLISH_MOVABLELIMITS). Our flags diff --git a/mozilla/layout/mathml/base/src/nsMathMLmunderFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmunderFrame.cpp index ce88915a65d..1910113f351 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmunderFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmunderFrame.cpp @@ -191,8 +191,6 @@ XXX The winner is the outermost setting in conflicting settings like these: nsIFrame* baseFrame = mFrames.FirstChild(); if (baseFrame) underscriptFrame = baseFrame->GetNextSibling(); - if (!baseFrame || !underscriptFrame) - return NS_OK; // a visual error indicator will be reported later during layout // if our base is an embellished operator, let its state bubble to us (in particular, // this is where we get the flag for NS_MATHML_EMBELLISH_MOVABLELIMITS). Our flags diff --git a/mozilla/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp index 58ead69d49b..bc524eb48f7 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp @@ -195,8 +195,6 @@ nsMathMLmunderoverFrame::TransmitAutomaticData() underscriptFrame = baseFrame->GetNextSibling(); if (underscriptFrame) overscriptFrame = underscriptFrame->GetNextSibling(); - if (!baseFrame || !underscriptFrame || !overscriptFrame) - return NS_OK; // a visual error indicator will be reported later during layout // if our base is an embellished operator, let its state bubble to us (in particular, // this is where we get the flag for NS_MATHML_EMBELLISH_MOVABLELIMITS). Our flags