зеркало из https://github.com/mozilla/gecko-dev.git
Ongoing deCOMtamination. r+sr=dbaron
This commit is contained in:
Родитель
094e6e3f3a
Коммит
87d53ca294
|
@ -154,8 +154,7 @@ nsMathMLContainerFrame::GetReflowAndBoundingMetricsFor(nsIFrame* aFra
|
|||
// where it is assumed that the frame's rect is still acting as place holder
|
||||
// for the frame's ascent and descent information
|
||||
|
||||
nsRect rect;
|
||||
aFrame->GetRect(rect);
|
||||
nsRect rect = aFrame->GetRect();
|
||||
aReflowMetrics.descent = rect.x;
|
||||
aReflowMetrics.ascent = rect.y;
|
||||
aReflowMetrics.width = rect.width;
|
||||
|
@ -200,7 +199,6 @@ nsMathMLContainerFrame::GetPreferredStretchSize(nsIPresContext* aPresContex
|
|||
NS_MATHML_WILL_STRETCH_ALL_CHILDREN_HORIZONTALLY(mPresentationData.flags) ||
|
||||
NS_MATHML_WILL_STRETCH_ALL_CHILDREN_VERTICALLY(mPresentationData.flags),
|
||||
"invalid call to GetPreferredStretchSize");
|
||||
nsRect rect;
|
||||
PRBool firstTime = PR_TRUE;
|
||||
nsBoundingMetrics bm, bmChild;
|
||||
nsIFrame* childFrame;
|
||||
|
@ -208,7 +206,7 @@ nsMathMLContainerFrame::GetPreferredStretchSize(nsIPresContext* aPresContex
|
|||
FirstChild(aPresContext, nsnull, &childFrame);
|
||||
while (childFrame) {
|
||||
// initializations in case this child happens not to be a MathML frame
|
||||
childFrame->GetRect(rect);
|
||||
nsRect rect = childFrame->GetRect();
|
||||
bmChild.ascent = rect.y;
|
||||
bmChild.descent = rect.x;
|
||||
bmChild.width = rect.width;
|
||||
|
@ -262,7 +260,7 @@ nsMathMLContainerFrame::GetPreferredStretchSize(nsIPresContext* aPresContex
|
|||
break;
|
||||
}
|
||||
}
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
aPreferredStretchSize = bm;
|
||||
}
|
||||
|
@ -334,8 +332,7 @@ nsMathMLContainerFrame::Stretch(nsIPresContext* aPresContext,
|
|||
mEmbellishData.direction, containerSize, childSize);
|
||||
|
||||
// store the updated metrics
|
||||
childFrame->SetRect(aPresContext,
|
||||
nsRect(childSize.descent, childSize.ascent,
|
||||
childFrame->SetRect(nsRect(childSize.descent, childSize.ascent,
|
||||
childSize.width, childSize.height));
|
||||
|
||||
// Remember the siblings which were _deferred_.
|
||||
|
@ -363,12 +360,11 @@ nsMathMLContainerFrame::Stretch(nsIPresContext* aPresContext,
|
|||
mathMLFrame->Stretch(aPresContext, aRenderingContext,
|
||||
stretchDir, containerSize, childSize);
|
||||
// store the updated metrics
|
||||
childFrame->SetRect(aPresContext,
|
||||
nsRect(childSize.descent, childSize.ascent,
|
||||
childFrame->SetRect(nsRect(childSize.descent, childSize.ascent,
|
||||
childSize.width, childSize.height));
|
||||
}
|
||||
}
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -402,12 +398,11 @@ nsMathMLContainerFrame::Stretch(nsIPresContext* aPresContext,
|
|||
aDesiredStretchSize.mBoundingMetrics.leftBearing += dx;
|
||||
aDesiredStretchSize.mBoundingMetrics.rightBearing += dx;
|
||||
|
||||
nsPoint origin;
|
||||
childFrame = mFrames.FirstChild();
|
||||
while (childFrame) {
|
||||
childFrame->GetOrigin(origin);
|
||||
childFrame->MoveTo(aPresContext, origin.x + dx, origin.y);
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame->SetPosition(childFrame->GetPosition()
|
||||
+ nsPoint(dx, 0));
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -538,7 +533,7 @@ nsMathMLContainerFrame::PropagatePresentationDataFor(nsIPresContext* aPresContex
|
|||
while (childFrame) {
|
||||
PropagatePresentationDataFor(aPresContext, childFrame,
|
||||
aScriptLevelIncrement, aFlagsValues, aFlagsToUpdate);
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -565,7 +560,7 @@ nsMathMLContainerFrame::PropagatePresentationDataFromChildAt(nsIPresContext* aPr
|
|||
aScriptLevelIncrement, aFlagsValues, aFlagsToUpdate);
|
||||
}
|
||||
index++;
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -594,8 +589,7 @@ nsMathMLContainerFrame::PropagateScriptStyleFor(nsIPresContext* aPresContext,
|
|||
nsStyleContext* oldStyleContext = aFrame->GetStyleContext();
|
||||
nsStyleContext* parentContext = oldStyleContext->GetParent();
|
||||
|
||||
nsCOMPtr<nsIContent> content;
|
||||
aFrame->GetContent(getter_AddRefs(content));
|
||||
nsIContent* content = aFrame->GetContent();
|
||||
if (!gap) {
|
||||
// unset any -moz-math-font-size attribute without notifying that we want a reflow
|
||||
content->UnsetAttr(kNameSpaceID_None, nsMathMLAtoms::fontsize, PR_FALSE);
|
||||
|
@ -671,8 +665,7 @@ nsMathMLContainerFrame::PropagateScriptStyleFor(nsIPresContext* aPresContext,
|
|||
minChange, maxChange);
|
||||
#ifdef DEBUG
|
||||
// Use the parent frame to make sure we catch in-flows and such
|
||||
nsIFrame* parentFrame;
|
||||
aFrame->GetParent(&parentFrame);
|
||||
nsIFrame* parentFrame = aFrame->GetParent();
|
||||
fm->DebugVerifyStyleTree(parentFrame ? parentFrame : aFrame);
|
||||
#endif
|
||||
}
|
||||
|
@ -692,7 +685,7 @@ nsMathMLContainerFrame::PropagateScriptStyleFor(nsIPresContext* aPresContext,
|
|||
else {
|
||||
PropagateScriptStyleFor(aPresContext, childFrame, aParentScriptLevel);
|
||||
}
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -716,7 +709,7 @@ nsMathMLContainerFrame::WrapForeignFrames(nsIPresContext* aPresContext)
|
|||
nsIFrame* next = mFrames.FirstChild();
|
||||
while (next) {
|
||||
nsIFrame* child = next;
|
||||
next->GetNextSibling(&next);
|
||||
next = next->GetNextSibling();
|
||||
nsInlineFrame* inlineFrame;
|
||||
child->QueryInterface(kInlineFrameCID, (void**)&inlineFrame);
|
||||
if (inlineFrame) {
|
||||
|
@ -853,7 +846,7 @@ nsMathMLContainerFrame::RebuildAutomaticDataForChildren(nsIPresContext* aPresCon
|
|||
childMathMLFrame->InheritAutomaticData(aPresContext, aParentFrame);
|
||||
}
|
||||
RebuildAutomaticDataForChildren(aPresContext, childFrame);
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
nsIMathMLFrame* mathMLFrame;
|
||||
aParentFrame->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLFrame);
|
||||
|
@ -881,8 +874,7 @@ nsMathMLContainerFrame::ReLayoutChildren(nsIPresContext* aPresContext,
|
|||
}
|
||||
// stop if we reach the root <math> tag
|
||||
nsCOMPtr<nsIAtom> tag;
|
||||
nsCOMPtr<nsIContent> content;
|
||||
frame->GetContent(getter_AddRefs(content));
|
||||
nsIContent* content = frame->GetContent();
|
||||
NS_ASSERTION(content, "dangling frame without a content node");
|
||||
if (!content)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -891,10 +883,8 @@ nsMathMLContainerFrame::ReLayoutChildren(nsIPresContext* aPresContext,
|
|||
break;
|
||||
}
|
||||
// mark the frame dirty, and continue to climb up
|
||||
nsFrameState state;
|
||||
frame->GetFrameState(&state);
|
||||
frame->SetFrameState(state | NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
frame->GetParent(&frame);
|
||||
frame->AddStateBits(NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
frame = frame->GetParent();
|
||||
}
|
||||
NS_ASSERTION(frame, "bad MathML markup - could not find the top <math> element");
|
||||
if (!frame)
|
||||
|
@ -931,7 +921,7 @@ nsMathMLContainerFrame::ReLayoutChildren(nsIPresContext* aPresContext,
|
|||
else {
|
||||
PropagateScriptStyleFor(aPresContext, childFrame, parentScriptLevel);
|
||||
}
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
|
||||
// Ask our parent frame to reflow us
|
||||
|
@ -1107,10 +1097,9 @@ printf("\n");
|
|||
// At this stage, the origin points of the children have no use, so we will use the
|
||||
// origins as placeholders to store the child's ascent and descent. Later on,
|
||||
// we should set the origins so as to overwrite what we are storing there now.
|
||||
childFrame->SetRect(aPresContext,
|
||||
nsRect(childDesiredSize.descent, childDesiredSize.ascent,
|
||||
childFrame->SetRect(nsRect(childDesiredSize.descent, childDesiredSize.ascent,
|
||||
childDesiredSize.width, childDesiredSize.height));
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
|
||||
/////////////
|
||||
|
@ -1151,11 +1140,10 @@ printf("\n");
|
|||
mathMLFrame->Stretch(aPresContext, *aReflowState.rendContext,
|
||||
stretchDir, containerSize, childDesiredSize);
|
||||
// store the updated metrics
|
||||
childFrame->SetRect(aPresContext,
|
||||
nsRect(childDesiredSize.descent, childDesiredSize.ascent,
|
||||
childFrame->SetRect(nsRect(childDesiredSize.descent, childDesiredSize.ascent,
|
||||
childDesiredSize.width, childDesiredSize.height));
|
||||
}
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1361,7 +1349,7 @@ nsMathMLContainerFrame::Place(nsIPresContext* aPresContext,
|
|||
// another math frame
|
||||
mBoundingMetrics.width += italicCorrection;
|
||||
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
aDesiredSize.width = mBoundingMetrics.width;
|
||||
aDesiredSize.height = aDesiredSize.ascent + aDesiredSize.descent;
|
||||
|
@ -1406,7 +1394,7 @@ nsMathMLContainerFrame::Place(nsIPresContext* aPresContext,
|
|||
FinishReflowChild(childFrame, aPresContext, nsnull, childSize, dx, dy, 0);
|
||||
// add child size + italic correction
|
||||
dx += bmChild.width + italicCorrection;
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1432,7 +1420,7 @@ GetInterFrameSpacingFor(nsIPresContext* aPresContext,
|
|||
nsCOMPtr<nsIAtom> childFrameType;
|
||||
nsCOMPtr<nsIAtom> prevFrameType;
|
||||
childFrame->GetFrameType(getter_AddRefs(childFrameType));
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
while (childFrame) {
|
||||
prevFrameType = childFrameType;
|
||||
childFrame->GetFrameType(getter_AddRefs(childFrameType));
|
||||
|
@ -1446,7 +1434,7 @@ GetInterFrameSpacingFor(nsIPresContext* aPresContext,
|
|||
// we are done
|
||||
return space * thinSpace;
|
||||
}
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
|
||||
NS_NOTREACHED("child not in the childlist of its parent");
|
||||
|
@ -1458,8 +1446,7 @@ nsMathMLContainerFrame::FixInterFrameSpacing(nsIPresContext* aPresContext,
|
|||
nsHTMLReflowMetrics& aDesiredSize)
|
||||
{
|
||||
nsCOMPtr<nsIAtom> parentTag;
|
||||
nsCOMPtr<nsIContent> parentContent;
|
||||
mParent->GetContent(getter_AddRefs(parentContent));
|
||||
nsIContent* parentContent = mParent->GetContent();
|
||||
parentContent->GetTag(getter_AddRefs(parentTag));
|
||||
if (parentTag == nsMathMLAtoms::math ||
|
||||
parentTag == nsMathMLAtoms::mtd_) {
|
||||
|
@ -1473,10 +1460,8 @@ nsMathMLContainerFrame::FixInterFrameSpacing(nsIPresContext* aPresContext,
|
|||
if (gap) {
|
||||
nsIFrame* childFrame = mFrames.FirstChild();
|
||||
while (childFrame) {
|
||||
nsPoint origin;
|
||||
childFrame->GetOrigin(origin);
|
||||
childFrame->MoveTo(aPresContext, origin.x + gap, origin.y);
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame->SetPosition(childFrame->GetPosition() + nsPoint(gap, 0));
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
mBoundingMetrics.leftBearing += gap;
|
||||
mBoundingMetrics.rightBearing += gap;
|
||||
|
|
|
@ -169,8 +169,7 @@ nsMathMLFrame::GetPresentationDataFrom(nsIFrame* aFrame,
|
|||
}
|
||||
// stop if we reach the root <math> tag
|
||||
nsCOMPtr<nsIAtom> tag;
|
||||
nsCOMPtr<nsIContent> content;
|
||||
frame->GetContent(getter_AddRefs(content));
|
||||
nsIContent* content = frame->GetContent();
|
||||
NS_ASSERTION(content, "dangling frame without a content node");
|
||||
if (!content)
|
||||
break;
|
||||
|
@ -182,22 +181,11 @@ nsMathMLFrame::GetPresentationDataFrom(nsIFrame* aFrame,
|
|||
}
|
||||
break;
|
||||
}
|
||||
frame->GetParent(&frame);
|
||||
frame = frame->GetParent();
|
||||
}
|
||||
NS_ASSERTION(frame, "bad MathML markup - could not find the top <math> element");
|
||||
}
|
||||
|
||||
/* static */ PRBool
|
||||
nsMathMLFrame::HasNextSibling(nsIFrame* aFrame)
|
||||
{
|
||||
if (aFrame) {
|
||||
nsIFrame* sibling;
|
||||
aFrame->GetNextSibling(&sibling);
|
||||
return sibling != nsnull;
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
// helper to get an attribute from the content or the surrounding <mstyle> hierarchy
|
||||
/* static */ nsresult
|
||||
nsMathMLFrame::GetAttribute(nsIContent* aContent,
|
||||
|
@ -215,11 +203,7 @@ nsMathMLFrame::GetAttribute(nsIContent* aContent,
|
|||
if (NS_CONTENT_ATTR_NOT_THERE == rv) {
|
||||
// see if we can get the attribute from the mstyle frame
|
||||
if (aMathMLmstyleFrame) {
|
||||
nsCOMPtr<nsIContent> mstyleContent;
|
||||
aMathMLmstyleFrame->GetContent(getter_AddRefs(mstyleContent));
|
||||
|
||||
nsIFrame* mstyleParent;
|
||||
aMathMLmstyleFrame->GetParent(&mstyleParent);
|
||||
nsIFrame* mstyleParent = aMathMLmstyleFrame->GetParent();
|
||||
|
||||
nsPresentationData mstyleParentData;
|
||||
mstyleParentData.mstyle = nsnull;
|
||||
|
@ -233,7 +217,8 @@ nsMathMLFrame::GetAttribute(nsIContent* aContent,
|
|||
}
|
||||
|
||||
// recurse all the way up into the <mstyle> hierarchy
|
||||
rv = GetAttribute(mstyleContent, mstyleParentData.mstyle, aAttributeAtom, aValue);
|
||||
rv = GetAttribute(aMathMLmstyleFrame->GetContent(),
|
||||
mstyleParentData.mstyle, aAttributeAtom, aValue);
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
|
@ -699,9 +684,7 @@ nsMathMLFrame::MapAttributesIntoCSS(nsIPresContext* aPresContext,
|
|||
nsMathMLFrame::MapAttributesIntoCSS(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame)
|
||||
{
|
||||
nsCOMPtr<nsIContent> content;
|
||||
aFrame->GetContent(getter_AddRefs(content));
|
||||
PRInt32 ruleCount = MapAttributesIntoCSS(aPresContext, content);
|
||||
PRInt32 ruleCount = MapAttributesIntoCSS(aPresContext, aFrame->GetContent());
|
||||
if (!ruleCount)
|
||||
return 0;
|
||||
|
||||
|
@ -718,8 +701,7 @@ nsMathMLFrame::MapAttributesIntoCSS(nsIPresContext* aPresContext,
|
|||
changeList, minChange, maxChange);
|
||||
#ifdef DEBUG
|
||||
// Use the parent frame to make sure we catch in-flows and such
|
||||
nsIFrame* parentFrame;
|
||||
aFrame->GetParent(&parentFrame);
|
||||
nsIFrame* parentFrame = aFrame->GetParent();
|
||||
fm->DebugVerifyStyleTree(parentFrame ? parentFrame : aFrame);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -192,11 +192,6 @@ public:
|
|||
nsPresentationData& aPresentationData,
|
||||
PRBool aClimbTree = PR_TRUE);
|
||||
|
||||
// helper to check if a frame has a next sibling - used to report
|
||||
// an error when a next sibling is found where unexpected
|
||||
static PRBool
|
||||
HasNextSibling(nsIFrame* aFrame);
|
||||
|
||||
// helper to check if a content has an attribute. If content is nsnull or if
|
||||
// the attribute is not there, check if the attribute is on the mstyle hierarchy
|
||||
// @return NS_CONTENT_ATTR_HAS_VALUE --if attribute has non-empty value, attr="value"
|
||||
|
|
|
@ -123,10 +123,8 @@ nsMathMLTokenFrame::SetInitialChildList(nsIPresContext* aPresContext,
|
|||
mState |= NS_FRAME_OUTSIDE_CHILDREN;
|
||||
nsIFrame* childFrame = mFrames.FirstChild();
|
||||
while (childFrame) {
|
||||
nsFrameState state;
|
||||
childFrame->GetFrameState(&state);
|
||||
childFrame->SetFrameState(state | NS_FRAME_OUTSIDE_CHILDREN);
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame->AddStateBits(NS_FRAME_OUTSIDE_CHILDREN);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
|
||||
SetQuotes(aPresContext);
|
||||
|
@ -172,8 +170,7 @@ printf("\n");
|
|||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// origins are used as placeholders to store the child's ascent and descent.
|
||||
childFrame->SetRect(aPresContext,
|
||||
nsRect(childDesiredSize.descent, childDesiredSize.ascent,
|
||||
childFrame->SetRect(nsRect(childDesiredSize.descent, childDesiredSize.ascent,
|
||||
childDesiredSize.width, childDesiredSize.height));
|
||||
// compute and cache the bounding metrics
|
||||
if (0 == count)
|
||||
|
@ -182,7 +179,7 @@ printf("\n");
|
|||
aDesiredSize.mBoundingMetrics += childDesiredSize.mBoundingMetrics;
|
||||
|
||||
count++;
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
|
||||
if (aDesiredSize.mComputeMEW) {
|
||||
|
@ -221,11 +218,10 @@ nsMathMLTokenFrame::Place(nsIPresContext* aPresContext,
|
|||
|
||||
if (aPlaceOrigin) {
|
||||
nscoord dy, dx = 0;
|
||||
nsRect rect;
|
||||
nsIFrame* childFrame;
|
||||
FirstChild(aPresContext, nsnull, &childFrame);
|
||||
while (childFrame) {
|
||||
childFrame->GetRect(rect);
|
||||
nsRect rect = childFrame->GetRect();
|
||||
nsHTMLReflowMetrics childSize(nsnull);
|
||||
childSize.width = rect.width;
|
||||
childSize.height = aDesiredSize.height; //rect.height;
|
||||
|
@ -234,7 +230,7 @@ nsMathMLTokenFrame::Place(nsIPresContext* aPresContext,
|
|||
dy = rect.IsEmpty() ? 0 : aDesiredSize.ascent - rect.y;
|
||||
FinishReflowChild(childFrame, aPresContext, nsnull, childSize, dx, dy, 0);
|
||||
dx += rect.width;
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -359,8 +355,7 @@ nsMathMLTokenFrame::SetTextStyle(nsIPresContext* aPresContext)
|
|||
changeList, minChange, maxChange);
|
||||
#ifdef DEBUG
|
||||
// Use the parent frame to make sure we catch in-flows and such
|
||||
nsIFrame* parentFrame;
|
||||
GetParent(&parentFrame);
|
||||
nsIFrame* parentFrame = GetParent();
|
||||
fm->DebugVerifyStyleTree(parentFrame ? parentFrame : this);
|
||||
#endif
|
||||
}
|
||||
|
@ -399,8 +394,7 @@ SetQuote(nsIPresContext* aPresContext,
|
|||
aFrame = textFrame;
|
||||
} while (textFrame);
|
||||
if (textFrame) {
|
||||
nsCOMPtr<nsIContent> quoteContent;
|
||||
textFrame->GetContent(getter_AddRefs(quoteContent));
|
||||
nsIContent* quoteContent = textFrame->GetContent();
|
||||
if (quoteContent) {
|
||||
nsCOMPtr<nsIDOMText> domText(do_QueryInterface(quoteContent));
|
||||
if (domText) {
|
||||
|
@ -425,9 +419,9 @@ nsMathMLTokenFrame::SetQuotes(nsIPresContext* aPresContext)
|
|||
nsIFrame* baseFrame = nsnull;
|
||||
nsIFrame* leftFrame = mFrames.FirstChild();
|
||||
if (leftFrame)
|
||||
leftFrame->GetNextSibling(&baseFrame);
|
||||
baseFrame = leftFrame->GetNextSibling();
|
||||
if (baseFrame)
|
||||
baseFrame->GetNextSibling(&rightFrame);
|
||||
rightFrame = baseFrame->GetNextSibling();
|
||||
if (!leftFrame || !baseFrame || !rightFrame)
|
||||
return;
|
||||
|
||||
|
|
|
@ -194,7 +194,7 @@ nsMathMLmactionFrame::GetSelectedFrame()
|
|||
if (++count == selection)
|
||||
mSelectedFrame = childFrame;
|
||||
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
// cater for invalid user-supplied selection
|
||||
if (selection > count || selection < 1)
|
||||
|
@ -243,8 +243,7 @@ nsMathMLmactionFrame::GetFrameForPoint(nsIPresContext* aPresContext,
|
|||
{
|
||||
nsIFrame* childFrame = GetSelectedFrame();
|
||||
if (childFrame) {
|
||||
nsPoint pt;
|
||||
pt.MoveTo(aPoint.x - mRect.x, aPoint.y - mRect.y);
|
||||
nsPoint pt(aPoint.x - mRect.x, aPoint.y - mRect.y);
|
||||
return childFrame->GetFrameForPoint(aPresContext, pt, aWhichLayer, aFrame);
|
||||
}
|
||||
return nsFrame::GetFrameForPoint(aPresContext, aPoint, aWhichLayer, aFrame);
|
||||
|
@ -314,8 +313,7 @@ nsMathMLmactionFrame::Reflow(nsIPresContext* aPresContext,
|
|||
childFrame, availSize, reason);
|
||||
rv = ReflowChild(childFrame, aPresContext, aDesiredSize,
|
||||
childReflowState, aStatus);
|
||||
childFrame->SetRect(aPresContext,
|
||||
nsRect(aDesiredSize.descent,aDesiredSize.ascent,
|
||||
childFrame->SetRect(nsRect(aDesiredSize.descent,aDesiredSize.ascent,
|
||||
aDesiredSize.width,aDesiredSize.height));
|
||||
mBoundingMetrics = aDesiredSize.mBoundingMetrics;
|
||||
FinalizeReflow(aPresContext, *aReflowState.rendContext, aDesiredSize);
|
||||
|
|
|
@ -319,8 +319,7 @@ nsMathMLmfencedFrame::doReflow(nsIPresContext* aPresContext,
|
|||
// At this stage, the origin points of the children have no use, so we will use the
|
||||
// origins as placeholders to store the child's ascent and descent. Later on,
|
||||
// we should set the origins so as to overwrite what we are storing there now.
|
||||
childFrame->SetRect(aPresContext,
|
||||
nsRect(childDesiredSize.descent, childDesiredSize.ascent,
|
||||
childFrame->SetRect(nsRect(childDesiredSize.descent, childDesiredSize.ascent,
|
||||
childDesiredSize.width, childDesiredSize.height));
|
||||
|
||||
// compute the bounding metrics right now for mfrac
|
||||
|
@ -333,7 +332,7 @@ nsMathMLmfencedFrame::doReflow(nsIPresContext* aPresContext,
|
|||
else
|
||||
aDesiredSize.mBoundingMetrics += childDesiredSize.mBoundingMetrics;
|
||||
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
|
||||
/////////////
|
||||
|
@ -364,8 +363,7 @@ nsMathMLmfencedFrame::doReflow(nsIPresContext* aPresContext,
|
|||
mathmlChild->Stretch(aPresContext, *aReflowState.rendContext,
|
||||
stretchDir, containerSize, childDesiredSize);
|
||||
// store the updated metrics
|
||||
childFrame->SetRect(aPresContext,
|
||||
nsRect(childDesiredSize.descent, childDesiredSize.ascent,
|
||||
childFrame->SetRect(nsRect(childDesiredSize.descent, childDesiredSize.ascent,
|
||||
childDesiredSize.width, childDesiredSize.height));
|
||||
|
||||
if (aDesiredSize.descent < childDesiredSize.descent)
|
||||
|
@ -373,7 +371,7 @@ nsMathMLmfencedFrame::doReflow(nsIPresContext* aPresContext,
|
|||
if (aDesiredSize.ascent < childDesiredSize.ascent)
|
||||
aDesiredSize.ascent = childDesiredSize.ascent;
|
||||
}
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
// bug 121748: for surrounding fences & separators, use a size that covers everything
|
||||
mathMLFrame->GetPreferredStretchSize(aPresContext, *aReflowState.rendContext,
|
||||
|
@ -449,7 +447,7 @@ nsMathMLmfencedFrame::doReflow(nsIPresContext* aPresContext,
|
|||
}
|
||||
i++;
|
||||
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
|
||||
if (aCloseChar) {
|
||||
|
|
|
@ -264,8 +264,8 @@ nsMathMLmfracFrame::Place(nsIPresContext* aPresContext,
|
|||
nsIFrame* frameDen = nsnull;
|
||||
nsIFrame* frameNum = mFrames.FirstChild();
|
||||
if (frameNum)
|
||||
frameNum->GetNextSibling(&frameDen);
|
||||
if (!frameNum || !frameDen || HasNextSibling(frameDen)) {
|
||||
frameDen = frameNum->GetNextSibling();
|
||||
if (!frameNum || !frameDen || frameDen->GetNextSibling()) {
|
||||
// report an error, encourage people to get their markups in order
|
||||
NS_WARNING("invalid markup");
|
||||
return ReflowError(aPresContext, aRenderingContext, aDesiredSize);
|
||||
|
|
|
@ -82,10 +82,8 @@ nsMathMLmmultiscriptsFrame::TransmitAutomaticData(nsIPresContext* aPresContext)
|
|||
nsAutoVoidArray subScriptFrames;
|
||||
nsIFrame* childFrame = mFrames.FirstChild();
|
||||
while (childFrame) {
|
||||
nsCOMPtr<nsIContent> childContent;
|
||||
nsCOMPtr<nsIAtom> childTag;
|
||||
childFrame->GetContent(getter_AddRefs(childContent));
|
||||
childContent->GetTag(getter_AddRefs(childTag));
|
||||
childFrame->GetContent()->GetTag(getter_AddRefs(childTag));
|
||||
if (childTag.get() == nsMathMLAtoms::mprescripts_) {
|
||||
// mprescripts frame
|
||||
}
|
||||
|
@ -104,7 +102,7 @@ nsMathMLmmultiscriptsFrame::TransmitAutomaticData(nsIPresContext* aPresContext)
|
|||
isSubScript = !isSubScript;
|
||||
}
|
||||
count++;
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
for (PRInt32 i = subScriptFrames.Count() - 1; i >= 0; i--) {
|
||||
childFrame = (nsIFrame*)subScriptFrames[i];
|
||||
|
@ -260,10 +258,8 @@ nsMathMLmmultiscriptsFrame::Place(nsIPresContext* aPresContext,
|
|||
|
||||
nsIFrame* childFrame = mFrames.FirstChild();
|
||||
while (childFrame) {
|
||||
nsCOMPtr<nsIContent> childContent;
|
||||
nsCOMPtr<nsIAtom> childTag;
|
||||
childFrame->GetContent(getter_AddRefs(childContent));
|
||||
childContent->GetTag(getter_AddRefs(childTag));
|
||||
childFrame->GetContent()->GetTag(getter_AddRefs(childTag));
|
||||
|
||||
if (childTag.get() == nsMathMLAtoms::mprescripts_) {
|
||||
if (mprescriptsFrame) {
|
||||
|
@ -373,7 +369,7 @@ nsMathMLmmultiscriptsFrame::Place(nsIPresContext* aPresContext,
|
|||
isSubScript = !isSubScript;
|
||||
}
|
||||
count++;
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
// note: width=0 if all sup-sub pairs match correctly
|
||||
if ((0 != width) || !baseFrame || !subScriptFrame || !supScriptFrame) {
|
||||
|
@ -455,7 +451,7 @@ nsMathMLmmultiscriptsFrame::Place(nsIPresContext* aPresContext,
|
|||
dx += mScriptSpace + width;
|
||||
}
|
||||
}
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
} while (mprescriptsFrame != childFrame);
|
||||
}
|
||||
|
||||
|
|
|
@ -125,9 +125,8 @@ nsMathMLmoFrame::IsFrameInSelection(nsIPresContext* aPresContext,
|
|||
if (!frameSelection)
|
||||
rv = shell->GetFrameSelection(getter_AddRefs(frameSelection));
|
||||
if (NS_SUCCEEDED(rv) && frameSelection) {
|
||||
nsCOMPtr<nsIContent> content;
|
||||
aFrame->GetContent(getter_AddRefs(content));
|
||||
frameSelection->LookUpSelection(content, 0, 1, &details, PR_TRUE);
|
||||
frameSelection->LookUpSelection(aFrame->GetContent(),
|
||||
0, 1, &details, PR_TRUE);
|
||||
}
|
||||
}
|
||||
if (!details)
|
||||
|
@ -165,7 +164,7 @@ nsMathMLmoFrame::Paint(nsIPresContext* aPresContext,
|
|||
nsRect selectedRect;
|
||||
nsIFrame* firstChild = mFrames.FirstChild();
|
||||
if (IsFrameInSelection(aPresContext, firstChild)) {
|
||||
firstChild->GetRect(selectedRect);
|
||||
selectedRect = firstChild->GetRect();
|
||||
isSelected = PR_TRUE;
|
||||
}
|
||||
rv = mMathMLChar.Paint(aPresContext, aRenderingContext, aDirtyRect,
|
||||
|
@ -373,7 +372,7 @@ nsMathMLmoFrame::ProcessOperatorData(nsIPresContext* aPresContext)
|
|||
nsIFrame* parentAncestor = this;
|
||||
do {
|
||||
embellishAncestor = parentAncestor;
|
||||
embellishAncestor->GetParent(&parentAncestor);
|
||||
parentAncestor = embellishAncestor->GetParent();
|
||||
GetEmbellishDataFrom(parentAncestor, embellishData);
|
||||
} while (embellishData.coreFrame == this);
|
||||
|
||||
|
@ -389,8 +388,7 @@ nsMathMLmoFrame::ProcessOperatorData(nsIPresContext* aPresContext)
|
|||
parentAncestor->FirstChild(aPresContext, nsnull, &firstChild);
|
||||
nsFrameList frameList(firstChild);
|
||||
|
||||
nsIFrame* nextSibling;
|
||||
embellishAncestor->GetNextSibling(&nextSibling);
|
||||
nsIFrame* nextSibling = embellishAncestor->GetNextSibling();
|
||||
nsIFrame* prevSibling = frameList.GetPrevSiblingFor(embellishAncestor);
|
||||
|
||||
// flag to distinguish from a real infix
|
||||
|
@ -849,9 +847,7 @@ nsMathMLmoFrame::Stretch(nsIPresContext* aPresContext,
|
|||
aDesiredStretchSize.ascent = mBoundingMetrics.ascent + leading;
|
||||
aDesiredStretchSize.descent = mBoundingMetrics.descent;
|
||||
|
||||
nsPoint origin;
|
||||
firstChild->GetOrigin(origin);
|
||||
firstChild->MoveTo(aPresContext, origin.x, origin.y - dy);
|
||||
firstChild->SetPosition(firstChild->GetPosition() - nsPoint(0, dy));
|
||||
}
|
||||
else if (useMathMLChar) {
|
||||
nscoord ascent, descent;
|
||||
|
@ -899,17 +895,17 @@ nsMathMLmoFrame::Stretch(nsIPresContext* aPresContext,
|
|||
aDesiredStretchSize.mBoundingMetrics.leftBearing += leftSpace;
|
||||
aDesiredStretchSize.mBoundingMetrics.rightBearing += leftSpace;
|
||||
|
||||
nsRect rect;
|
||||
if (useMathMLChar) {
|
||||
nsRect rect;
|
||||
mMathMLChar.GetRect(rect);
|
||||
mMathMLChar.SetRect(nsRect(rect.x + leftSpace, rect.y, rect.width, rect.height));
|
||||
}
|
||||
else {
|
||||
nsIFrame* childFrame = firstChild;
|
||||
while (childFrame) {
|
||||
childFrame->GetRect(rect);
|
||||
childFrame->MoveTo(aPresContext, rect.x + leftSpace, rect.y);
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame->SetPosition(childFrame->GetPosition()
|
||||
+ nsPoint(leftSpace, 0));
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -918,8 +914,7 @@ nsMathMLmoFrame::Stretch(nsIPresContext* aPresContext,
|
|||
if (mFrames.GetLength() != 1)
|
||||
return NS_OK;
|
||||
|
||||
nsRect rect;
|
||||
firstChild->GetRect(rect);
|
||||
nsRect rect = firstChild->GetRect();
|
||||
if (useMathMLChar) {
|
||||
// even though our child text frame is not doing the rendering, we make it play
|
||||
// nice with other operations that the MathMLChar doesn't handle (e.g., caret)
|
||||
|
@ -928,7 +923,7 @@ nsMathMLmoFrame::Stretch(nsIPresContext* aPresContext,
|
|||
rect.y = 0;
|
||||
}
|
||||
rect.height = aDesiredStretchSize.height;
|
||||
firstChild->SetRect(aPresContext, rect);
|
||||
firstChild->SetRect(rect);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -984,7 +979,7 @@ nsMathMLmoFrame::ReflowDirtyChild(nsIPresShell* aPresShell,
|
|||
nsIFrame* target = this;
|
||||
nsEmbellishData embellishData;
|
||||
do {
|
||||
target->GetParent(&target);
|
||||
target = target->GetParent();
|
||||
GetEmbellishDataFrom(target, embellishData);
|
||||
} while (embellishData.coreFrame == this);
|
||||
|
||||
|
@ -1010,7 +1005,7 @@ nsMathMLmoFrame::AttributeChanged(nsIPresContext* aPresContext,
|
|||
nsIFrame* target = this;
|
||||
nsEmbellishData embellishData;
|
||||
do {
|
||||
target->GetParent(&target);
|
||||
target = target->GetParent();
|
||||
GetEmbellishDataFrom(target, embellishData);
|
||||
} while (embellishData.coreFrame == this);
|
||||
|
||||
|
|
|
@ -133,7 +133,7 @@ nsMathMLmoverFrame::UpdatePresentationDataFromChildAt(nsIPresContext* aPresConte
|
|||
aScriptLevelIncrement, aFlagsValues, aFlagsToUpdate);
|
||||
}
|
||||
index++;
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
return NS_OK;
|
||||
|
||||
|
@ -179,7 +179,7 @@ XXX The winner is the outermost in conflicting settings like these:
|
|||
nsIFrame* overscriptFrame = nsnull;
|
||||
nsIFrame* baseFrame = mFrames.FirstChild();
|
||||
if (baseFrame)
|
||||
baseFrame->GetNextSibling(&overscriptFrame);
|
||||
overscriptFrame = baseFrame->GetNextSibling();
|
||||
if (!baseFrame || !overscriptFrame)
|
||||
return NS_OK; // a visual error indicator will be reported later during layout
|
||||
|
||||
|
@ -282,8 +282,8 @@ nsMathMLmoverFrame::Place(nsIPresContext* aPresContext,
|
|||
nsIFrame* overFrame = nsnull;
|
||||
nsIFrame* baseFrame = mFrames.FirstChild();
|
||||
if (baseFrame)
|
||||
baseFrame->GetNextSibling(&overFrame);
|
||||
if (!baseFrame || !overFrame || HasNextSibling(overFrame)) {
|
||||
overFrame = baseFrame->GetNextSibling();
|
||||
if (!baseFrame || !overFrame || overFrame->GetNextSibling()) {
|
||||
// report an error, encourage people to get their markups in order
|
||||
NS_WARNING("invalid markup");
|
||||
return ReflowError(aPresContext, aRenderingContext, aDesiredSize);
|
||||
|
|
|
@ -447,9 +447,8 @@ nsMathMLmpaddedFrame::Reflow(nsIPresContext* aPresContext,
|
|||
if (dx || dy) {
|
||||
nsIFrame* childFrame = mFrames.FirstChild();
|
||||
while (childFrame) {
|
||||
childFrame->GetRect(rect);
|
||||
childFrame->MoveTo(aPresContext, rect.x + dx, rect.y + dy);
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame->SetPosition(childFrame->GetPosition() + nsPoint(dx, dy));
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -207,7 +207,7 @@ nsMathMLmrootFrame::Reflow(nsIPresContext* aPresContext,
|
|||
bmIndex = childDesiredSize.mBoundingMetrics;
|
||||
}
|
||||
count++;
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
if (aDesiredSize.mComputeMEW) {
|
||||
aDesiredSize.mMaxElementWidth = childDesiredSize.mMaxElementWidth;
|
||||
|
|
|
@ -280,14 +280,12 @@ nsMathMLmsqrtFrame::Reflow(nsIPresContext* aPresContext,
|
|||
//////////////////
|
||||
// Adjust the origins to leave room for the sqrt char and the overline bar
|
||||
|
||||
nsPoint origin;
|
||||
dx = radicalSize.width;
|
||||
dy = aDesiredSize.ascent - baseSize.ascent;
|
||||
nsIFrame* childFrame = mFrames.FirstChild();
|
||||
while (childFrame) {
|
||||
childFrame->GetOrigin(origin);
|
||||
childFrame->MoveTo(aPresContext, origin.x + dx, origin.y + dy);
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame->SetPosition(childFrame->GetPosition() + nsPoint(dx, dy));
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
|
||||
if (aDesiredSize.mComputeMEW) {
|
||||
|
|
|
@ -140,8 +140,8 @@ nsMathMLmsubFrame::PlaceSubScript (nsIPresContext* aPresContext,
|
|||
aFrame->FirstChild(aPresContext, nsnull, &baseFrame);
|
||||
nsIFrame* subScriptFrame = nsnull;
|
||||
if (baseFrame)
|
||||
baseFrame->GetNextSibling(&subScriptFrame);
|
||||
if (!baseFrame || !subScriptFrame || HasNextSibling(subScriptFrame)) {
|
||||
subScriptFrame = baseFrame->GetNextSibling();
|
||||
if (!baseFrame || !subScriptFrame || subScriptFrame->GetNextSibling()) {
|
||||
// report an error, encourage people to get their markups in order
|
||||
NS_WARNING("invalid markup");
|
||||
return NS_STATIC_CAST(nsMathMLContainerFrame*,
|
||||
|
|
|
@ -159,10 +159,11 @@ nsMathMLmsubsupFrame::PlaceSubSupScript(nsIPresContext* aPresContext,
|
|||
nsIFrame* supScriptFrame = nsnull;
|
||||
aFrame->FirstChild(aPresContext, nsnull, &baseFrame);
|
||||
if (baseFrame)
|
||||
baseFrame->GetNextSibling(&subScriptFrame);
|
||||
subScriptFrame = baseFrame->GetNextSibling();
|
||||
if (subScriptFrame)
|
||||
subScriptFrame->GetNextSibling(&supScriptFrame);
|
||||
if (!baseFrame || !subScriptFrame || !supScriptFrame || HasNextSibling(supScriptFrame)) {
|
||||
supScriptFrame = subScriptFrame->GetNextSibling();
|
||||
if (!baseFrame || !subScriptFrame || !supScriptFrame ||
|
||||
supScriptFrame->GetNextSibling()) {
|
||||
// report an error, encourage people to get their markups in order
|
||||
NS_WARNING("invalid markup");
|
||||
return NS_STATIC_CAST(nsMathMLContainerFrame*,
|
||||
|
|
|
@ -141,8 +141,8 @@ nsMathMLmsupFrame::PlaceSuperScript(nsIPresContext* aPresContext,
|
|||
nsIFrame* supScriptFrame = nsnull;
|
||||
aFrame->FirstChild(aPresContext, nsnull, &baseFrame);
|
||||
if (baseFrame)
|
||||
baseFrame->GetNextSibling(&supScriptFrame);
|
||||
if (!baseFrame || !supScriptFrame || HasNextSibling(supScriptFrame)) {
|
||||
supScriptFrame = baseFrame->GetNextSibling();
|
||||
if (!baseFrame || !supScriptFrame || supScriptFrame->GetNextSibling()) {
|
||||
// report an error, encourage people to get their markups in order
|
||||
NS_WARNING("invalid markup");
|
||||
return NS_STATIC_CAST(nsMathMLContainerFrame*,
|
||||
|
|
|
@ -127,9 +127,8 @@ GetValueAt(nsIPresContext* aPresContext,
|
|||
if (!valueList) {
|
||||
// The property isn't there yet, so set it
|
||||
nsAutoString values;
|
||||
nsCOMPtr<nsIContent> content;
|
||||
aTableOrRowFrame->GetContent(getter_AddRefs(content));
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, aAttributeAtom, values)) {
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE ==
|
||||
aTableOrRowFrame->GetContent()->GetAttr(kNameSpaceID_None, aAttributeAtom, values)) {
|
||||
valueList = new nsValueList(values);
|
||||
if (valueList) {
|
||||
frameManager->SetFrameProperty(aTableOrRowFrame, aAttributeAtom,
|
||||
|
@ -170,13 +169,9 @@ MapAttributesInto(nsIPresContext* aPresContext,
|
|||
NS_ASSERTION(NS_SUCCEEDED(rv), "cannot find the position of the cell frame");
|
||||
if (NS_FAILED(rv)) return;
|
||||
|
||||
nsIFrame* tableFrame;
|
||||
nsIFrame* rowgroupFrame;
|
||||
nsIFrame* rowFrame;
|
||||
|
||||
cellFrame->GetParent(&rowFrame);
|
||||
rowFrame->GetParent(&rowgroupFrame);
|
||||
rowgroupFrame->GetParent(&tableFrame);
|
||||
nsIFrame* rowFrame = cellFrame->GetParent();
|
||||
nsIFrame* rowgroupFrame = rowFrame->GetParent();
|
||||
nsIFrame* tableFrame = rowgroupFrame->GetParent();
|
||||
DEBUG_VERIFY_THAT_FRAME_IS(rowFrame, TABLE_ROW);
|
||||
DEBUG_VERIFY_THAT_FRAME_IS(rowgroupFrame, TABLE_ROW_GROUP);
|
||||
DEBUG_VERIFY_THAT_FRAME_IS(tableFrame, TABLE);
|
||||
|
@ -297,8 +292,7 @@ MapAttributesInto(nsIPresContext* aPresContext,
|
|||
changeList, minChange, maxChange);
|
||||
#ifdef DEBUG
|
||||
// Use the parent frame to make sure we catch in-flows and such
|
||||
nsIFrame* parentFrame;
|
||||
aCellFrame->GetParent(&parentFrame);
|
||||
nsIFrame* parentFrame = aCellFrame->GetParent();
|
||||
fm->DebugVerifyStyleTree(parentFrame ? parentFrame : aCellFrame);
|
||||
#endif
|
||||
}
|
||||
|
@ -516,14 +510,11 @@ nsMathMLmtableOuterFrame::Reflow(nsIPresContext* aPresContext,
|
|||
rowFrame = GetRowFrameAt(aPresContext, rowIndex);
|
||||
if (rowFrame) {
|
||||
// translate the coordinates to be relative to us
|
||||
nsRect rect;
|
||||
nsIFrame* frame = rowFrame;
|
||||
frame->GetRect(rect);
|
||||
height = rect.height;
|
||||
height = frame->GetSize().height;
|
||||
do {
|
||||
dy += rect.y;
|
||||
frame->GetParent(&frame);
|
||||
frame->GetRect(rect);
|
||||
dy += frame->GetPosition().y;
|
||||
frame = frame->GetParent();
|
||||
} while (frame != this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -133,7 +133,7 @@ nsMathMLmunderFrame::UpdatePresentationDataFromChildAt(nsIPresContext* aPresCont
|
|||
aScriptLevelIncrement, aFlagsValues, aFlagsToUpdate);
|
||||
}
|
||||
index++;
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
return NS_OK;
|
||||
|
||||
|
@ -179,7 +179,7 @@ XXX The winner is the outermost setting in conflicting settings like these:
|
|||
nsIFrame* underscriptFrame = nsnull;
|
||||
nsIFrame* baseFrame = mFrames.FirstChild();
|
||||
if (baseFrame)
|
||||
baseFrame->GetNextSibling(&underscriptFrame);
|
||||
underscriptFrame = baseFrame->GetNextSibling();
|
||||
if (!baseFrame || !underscriptFrame)
|
||||
return NS_OK; // a visual error indicator will be reported later during layout
|
||||
|
||||
|
@ -279,8 +279,8 @@ nsMathMLmunderFrame::Place(nsIPresContext* aPresContext,
|
|||
nsIFrame* underFrame = nsnull;
|
||||
nsIFrame* baseFrame = mFrames.FirstChild();
|
||||
if (baseFrame)
|
||||
baseFrame->GetNextSibling(&underFrame);
|
||||
if (!baseFrame || !underFrame || HasNextSibling(underFrame)) {
|
||||
underFrame = baseFrame->GetNextSibling();
|
||||
if (!baseFrame || !underFrame || underFrame->GetNextSibling()) {
|
||||
// report an error, encourage people to get their markups in order
|
||||
NS_WARNING("invalid markup");
|
||||
return ReflowError(aPresContext, aRenderingContext, aDesiredSize);
|
||||
|
|
|
@ -139,7 +139,7 @@ nsMathMLmunderoverFrame::UpdatePresentationDataFromChildAt(nsIPresContext* aPres
|
|||
aScriptLevelIncrement, aFlagsValues, aFlagsToUpdate);
|
||||
}
|
||||
index++;
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
return NS_OK;
|
||||
|
||||
|
@ -181,9 +181,9 @@ nsMathMLmunderoverFrame::TransmitAutomaticData(nsIPresContext* aPresContext)
|
|||
nsIFrame* underscriptFrame = nsnull;
|
||||
nsIFrame* baseFrame = mFrames.FirstChild();
|
||||
if (baseFrame)
|
||||
baseFrame->GetNextSibling(&underscriptFrame);
|
||||
underscriptFrame = baseFrame->GetNextSibling();
|
||||
if (underscriptFrame)
|
||||
underscriptFrame->GetNextSibling(&overscriptFrame);
|
||||
overscriptFrame = underscriptFrame->GetNextSibling();
|
||||
if (!baseFrame || !underscriptFrame || !overscriptFrame)
|
||||
return NS_OK; // a visual error indicator will be reported later during layout
|
||||
|
||||
|
@ -319,10 +319,10 @@ nsMathMLmunderoverFrame::Place(nsIPresContext* aPresContext,
|
|||
nsIFrame* underFrame = nsnull;
|
||||
nsIFrame* baseFrame = mFrames.FirstChild();
|
||||
if (baseFrame)
|
||||
baseFrame->GetNextSibling(&underFrame);
|
||||
underFrame = baseFrame->GetNextSibling();
|
||||
if (underFrame)
|
||||
underFrame->GetNextSibling(&overFrame);
|
||||
if (!baseFrame || !underFrame || !overFrame || HasNextSibling(overFrame)) {
|
||||
overFrame = underFrame->GetNextSibling();
|
||||
if (!baseFrame || !underFrame || !overFrame || overFrame->GetNextSibling()) {
|
||||
// report an error, encourage people to get their markups in order
|
||||
NS_WARNING("invalid markup");
|
||||
return ReflowError(aPresContext, aRenderingContext, aDesiredSize);
|
||||
|
|
|
@ -336,8 +336,8 @@ nsSVGForeignObjectFrame::Reflow(nsIPresContext* aPresContext,
|
|||
y -= height/2.0f;
|
||||
|
||||
// move ourselves to (x,y):
|
||||
MoveTo(aPresContext, (nscoord) (x*twipsPerPx), (nscoord) (y*twipsPerPx));
|
||||
// XXX: if we have a view, move that
|
||||
SetPosition(nsPoint((nscoord) (x*twipsPerPx), (nscoord) (y*twipsPerPx)));
|
||||
// Xxx: if zewe have a view, move that
|
||||
|
||||
// create a new reflow state, setting our max size to (width,height):
|
||||
nsSize availableSpace((nscoord)(width*twipsPerPx), (nscoord)(height*twipsPerPx));
|
||||
|
@ -607,7 +607,7 @@ ArtUta* nsSVGForeignObjectFrame::DoReflow()
|
|||
|
||||
WillReflow(presContext);
|
||||
Reflow(presContext, desiredSize, reflowState, status);
|
||||
SizeTo(presContext, desiredSize.width, desiredSize.height);
|
||||
SetSize(nsSize(desiredSize.width, desiredSize.height));
|
||||
DidReflow(presContext, &reflowState, NS_FRAME_REFLOW_FINISHED);
|
||||
|
||||
AccumulateUta(&dirtyRegion, GetUta());
|
||||
|
|
|
@ -206,14 +206,13 @@ nsSVGGFrame::AppendFrames(nsIPresContext* aPresContext,
|
|||
// Insert the new frames
|
||||
mFrames.AppendFrames(this, aFrameList);
|
||||
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
while (kid) {
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGFrame* SVGFrame=0;
|
||||
kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame);
|
||||
if (SVGFrame) {
|
||||
SVGFrame->NotifyCTMChanged(); //XXX use different function
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
@ -234,14 +233,13 @@ nsSVGGFrame::InsertFrames(nsIPresContext* aPresContext,
|
|||
#endif
|
||||
mFrames.InsertFrames(nsnull, aPrevFrame, aFrameList);
|
||||
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
while (kid) {
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGFrame* SVGFrame=0;
|
||||
kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame);
|
||||
if (SVGFrame) {
|
||||
SVGFrame->NotifyCTMChanged(); //XXX use different function
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
@ -287,13 +285,12 @@ NS_IMETHODIMP
|
|||
nsSVGGFrame::DidModifySVGObservable (nsISVGValue* observable)
|
||||
{
|
||||
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
while (kid) {
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGFrame* SVGFrame=0;
|
||||
kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame);
|
||||
if (SVGFrame)
|
||||
SVGFrame->NotifyCTMChanged();
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -305,13 +302,12 @@ nsSVGGFrame::DidModifySVGObservable (nsISVGValue* observable)
|
|||
NS_IMETHODIMP
|
||||
nsSVGGFrame::Paint(nsSVGRenderingContext* renderingContext)
|
||||
{
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
while (kid) {
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGFrame* SVGFrame=0;
|
||||
kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame);
|
||||
if (SVGFrame)
|
||||
SVGFrame->Paint(renderingContext);
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -342,8 +338,8 @@ NS_IMETHODIMP
|
|||
nsSVGGFrame::GetFrameForPoint(float x, float y, nsIFrame** hit)
|
||||
{
|
||||
*hit = nsnull;
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
while (kid) {
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGFrame* SVGFrame=0;
|
||||
kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame);
|
||||
if (SVGFrame) {
|
||||
|
@ -355,7 +351,6 @@ nsSVGGFrame::GetFrameForPoint(float x, float y, nsIFrame** hit)
|
|||
// have a singly linked list...
|
||||
}
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
|
||||
return *hit ? NS_OK : NS_ERROR_FAILURE;
|
||||
|
@ -364,14 +359,13 @@ nsSVGGFrame::GetFrameForPoint(float x, float y, nsIFrame** hit)
|
|||
NS_IMETHODIMP
|
||||
nsSVGGFrame::NotifyCTMChanged()
|
||||
{
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
while (kid) {
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGFrame* SVGFrame=0;
|
||||
kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame);
|
||||
if (SVGFrame) {
|
||||
SVGFrame->NotifyCTMChanged();
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -379,14 +373,13 @@ nsSVGGFrame::NotifyCTMChanged()
|
|||
NS_IMETHODIMP
|
||||
nsSVGGFrame::NotifyRedrawSuspended()
|
||||
{
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
while (kid) {
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGFrame* SVGFrame=0;
|
||||
kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame);
|
||||
if (SVGFrame) {
|
||||
SVGFrame->NotifyRedrawSuspended();
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -394,14 +387,13 @@ nsSVGGFrame::NotifyRedrawSuspended()
|
|||
NS_IMETHODIMP
|
||||
nsSVGGFrame::NotifyRedrawUnsuspended()
|
||||
{
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
while (kid) {
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGFrame* SVGFrame=0;
|
||||
kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame);
|
||||
if (SVGFrame) {
|
||||
SVGFrame->NotifyRedrawUnsuspended();
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -192,14 +192,13 @@ nsSVGGenericContainerFrame::AppendFrames(nsIPresContext* aPresContext,
|
|||
// Insert the new frames
|
||||
mFrames.AppendFrames(this, aFrameList);
|
||||
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
while (kid) {
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGFrame* SVGFrame=0;
|
||||
kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame);
|
||||
if (SVGFrame) {
|
||||
SVGFrame->NotifyCTMChanged(); //XXX use different function
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
@ -220,14 +219,13 @@ nsSVGGenericContainerFrame::InsertFrames(nsIPresContext* aPresContext,
|
|||
#endif
|
||||
mFrames.InsertFrames(nsnull, aPrevFrame, aFrameList);
|
||||
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
while (kid) {
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGFrame* SVGFrame=0;
|
||||
kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame);
|
||||
if (SVGFrame) {
|
||||
SVGFrame->NotifyCTMChanged(); //XXX use different function
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
@ -294,14 +292,12 @@ nsSVGGenericContainerFrame::WillModifySVGObservable(nsISVGValue* observable)
|
|||
NS_IMETHODIMP
|
||||
nsSVGGenericContainerFrame::DidModifySVGObservable(nsISVGValue* observable)
|
||||
{
|
||||
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
while (kid) {
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGFrame* SVGFrame=0;
|
||||
kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame);
|
||||
if (SVGFrame)
|
||||
SVGFrame->NotifyCTMChanged();
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -313,13 +309,12 @@ nsSVGGenericContainerFrame::DidModifySVGObservable(nsISVGValue* observable)
|
|||
NS_IMETHODIMP
|
||||
nsSVGGenericContainerFrame::Paint(nsSVGRenderingContext* renderingContext)
|
||||
{
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
while (kid) {
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGFrame* SVGFrame=0;
|
||||
kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame);
|
||||
if (SVGFrame)
|
||||
SVGFrame->Paint(renderingContext);
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -350,8 +345,8 @@ NS_IMETHODIMP
|
|||
nsSVGGenericContainerFrame::GetFrameForPoint(float x, float y, nsIFrame** hit)
|
||||
{
|
||||
*hit = nsnull;
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
while (kid) {
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGFrame* SVGFrame=0;
|
||||
kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame);
|
||||
if (SVGFrame) {
|
||||
|
@ -363,7 +358,6 @@ nsSVGGenericContainerFrame::GetFrameForPoint(float x, float y, nsIFrame** hit)
|
|||
// have a singly linked list...
|
||||
}
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
|
||||
return *hit ? NS_OK : NS_ERROR_FAILURE;
|
||||
|
@ -372,14 +366,13 @@ nsSVGGenericContainerFrame::GetFrameForPoint(float x, float y, nsIFrame** hit)
|
|||
NS_IMETHODIMP
|
||||
nsSVGGenericContainerFrame::NotifyCTMChanged()
|
||||
{
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
while (kid) {
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGFrame* SVGFrame=0;
|
||||
kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame);
|
||||
if (SVGFrame) {
|
||||
SVGFrame->NotifyCTMChanged();
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -387,14 +380,13 @@ nsSVGGenericContainerFrame::NotifyCTMChanged()
|
|||
NS_IMETHODIMP
|
||||
nsSVGGenericContainerFrame::NotifyRedrawSuspended()
|
||||
{
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
while (kid) {
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGFrame* SVGFrame=0;
|
||||
kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame);
|
||||
if (SVGFrame) {
|
||||
SVGFrame->NotifyRedrawSuspended();
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -402,14 +394,13 @@ nsSVGGenericContainerFrame::NotifyRedrawSuspended()
|
|||
NS_IMETHODIMP
|
||||
nsSVGGenericContainerFrame::NotifyRedrawUnsuspended()
|
||||
{
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
while (kid) {
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGFrame* SVGFrame=0;
|
||||
kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame);
|
||||
if (SVGFrame) {
|
||||
SVGFrame->NotifyRedrawUnsuspended();
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -118,8 +118,6 @@ public:
|
|||
PRInt32 aModType,
|
||||
PRInt32 aHint);
|
||||
|
||||
// NS_IMETHOD SetView(nsIPresContext* aPresContext, nsIView* aView);
|
||||
|
||||
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext,
|
||||
const nsPoint& aPoint,
|
||||
nsFramePaintLayer aWhichLayer,
|
||||
|
@ -482,16 +480,12 @@ nsSVGOuterSVGFrame::DidReflow(nsIPresContext* aPresContext,
|
|||
nsIFrame* frame = this;
|
||||
nsPoint origin(0,0);
|
||||
do {
|
||||
nsPoint tmpOrigin;
|
||||
frame->GetOrigin(tmpOrigin);
|
||||
origin += tmpOrigin;
|
||||
origin += frame->GetPosition();
|
||||
|
||||
nsFrameState state;
|
||||
frame->GetFrameState(&state);
|
||||
if(state & NS_FRAME_OUT_OF_FLOW)
|
||||
if(frame->GetStateBits() & NS_FRAME_OUT_OF_FLOW)
|
||||
break;
|
||||
|
||||
frame->GetParent(&frame);
|
||||
frame = frame->GetParent();
|
||||
} while(frame);
|
||||
|
||||
float pxPerTwips = GetPxPerTwips();
|
||||
|
@ -532,20 +526,17 @@ nsSVGOuterSVGFrame::AppendFrames(nsIPresContext* aPresContext,
|
|||
|
||||
// get the view manager, so that we can wrap this up in a batch
|
||||
// update.
|
||||
NS_ENSURE_TRUE(mPresShell, NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsIViewManager> vm;
|
||||
mPresShell->GetViewManager(getter_AddRefs(vm));
|
||||
nsIViewManager* vm = aPresContext->GetViewManager();
|
||||
|
||||
vm->BeginUpdateViewBatch();
|
||||
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
while (kid) {
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGFrame* SVGFrame=0;
|
||||
kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame);
|
||||
if (SVGFrame) {
|
||||
SVGFrame->NotifyCTMChanged(); //XXX use different function
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
|
||||
vm->EndUpdateViewBatch(NS_VMREFRESH_IMMEDIATE);
|
||||
|
@ -580,20 +571,17 @@ nsSVGOuterSVGFrame::InsertFrames(nsIPresContext* aPresContext,
|
|||
|
||||
// get the view manager, so that we can wrap this up in a batch
|
||||
// update.
|
||||
NS_ENSURE_TRUE(mPresShell, NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsIViewManager> vm;
|
||||
mPresShell->GetViewManager(getter_AddRefs(vm));
|
||||
nsIViewManager* vm = aPresContext->GetViewManager();
|
||||
|
||||
vm->BeginUpdateViewBatch();
|
||||
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
while (kid) {
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGFrame* SVGFrame=0;
|
||||
kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame);
|
||||
if (SVGFrame) {
|
||||
SVGFrame->NotifyCTMChanged(); //XXX use different function
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
|
||||
vm->EndUpdateViewBatch(NS_VMREFRESH_IMMEDIATE);
|
||||
|
@ -626,20 +614,17 @@ nsSVGOuterSVGFrame::RemoveFrame(nsIPresContext* aPresContext,
|
|||
|
||||
// get the view manager, so that we can wrap this up in a batch
|
||||
// update.
|
||||
NS_ENSURE_TRUE(mPresShell, NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsIViewManager> vm;
|
||||
mPresShell->GetViewManager(getter_AddRefs(vm));
|
||||
nsIViewManager* vm = aPresContext->GetViewManager();
|
||||
|
||||
vm->BeginUpdateViewBatch();
|
||||
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
while (kid) {
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGFrame* SVGFrame=0;
|
||||
kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame);
|
||||
if (SVGFrame) {
|
||||
SVGFrame->NotifyCTMChanged(); //XXX use different function
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
|
||||
vm->EndUpdateViewBatch(NS_VMREFRESH_IMMEDIATE);
|
||||
|
@ -690,15 +675,6 @@ nsSVGOuterSVGFrame::AttributeChanged(nsIPresContext* aPresContext,
|
|||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//
|
||||
// NS_IMETHODIMP
|
||||
// nsSVGOuterSVGFrame::SetView(nsIPresContext* aPresContext, nsIView* aView)
|
||||
// {
|
||||
// mView = aView;
|
||||
// return nsSVGOuterSVGFrameBase::SetView(aPresContext, aView);
|
||||
// }
|
||||
|
||||
nsresult
|
||||
nsSVGOuterSVGFrame::GetFrameForPoint(nsIPresContext* aPresContext,
|
||||
const nsPoint& aPoint,
|
||||
|
@ -719,9 +695,9 @@ nsSVGOuterSVGFrame::GetFrameForPoint(nsIPresContext* aPresContext,
|
|||
}
|
||||
|
||||
*aFrame = this;
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
nsIFrame* hit = nsnull;
|
||||
while (kid) {
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGFrame* SVGFrame=0;
|
||||
kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame);
|
||||
if (SVGFrame) {
|
||||
|
@ -732,7 +708,6 @@ nsSVGOuterSVGFrame::GetFrameForPoint(nsIPresContext* aPresContext,
|
|||
// have a singly linked list...
|
||||
}
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -777,13 +752,12 @@ nsSVGOuterSVGFrame::Paint(nsIPresContext* aPresContext,
|
|||
Paint(&SVGCtx);
|
||||
|
||||
// paint children:
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
while (kid) {
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGFrame* SVGFrame=0;
|
||||
kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame);
|
||||
if (SVGFrame)
|
||||
SVGFrame->Paint(&SVGCtx);
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
|
||||
SVGCtx.Render();
|
||||
|
@ -832,15 +806,10 @@ nsSVGOuterSVGFrame::InvalidateRegion(ArtUta* uta, PRBool bRedraw)
|
|||
|
||||
if (!uta && !bRedraw) return NS_OK;
|
||||
|
||||
NS_ENSURE_TRUE(mPresShell, NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsIPresContext> presCtx;
|
||||
mPresShell->GetPresContext(getter_AddRefs(presCtx));
|
||||
NS_ENSURE_TRUE(presCtx, NS_ERROR_FAILURE);
|
||||
nsIView* view = GetClosestView(presCtx);
|
||||
nsIView* view = GetClosestView();
|
||||
NS_ENSURE_TRUE(view, NS_ERROR_FAILURE);
|
||||
|
||||
nsCOMPtr<nsIViewManager> vm;
|
||||
view->GetViewManager(*getter_AddRefs(vm));
|
||||
nsIViewManager* vm = view->GetViewManager();
|
||||
|
||||
vm->BeginUpdateViewBatch();
|
||||
if (uta) {
|
||||
|
@ -884,21 +853,17 @@ nsSVGOuterSVGFrame::NotifyRedrawSuspended()
|
|||
|
||||
// get the view manager, so that we can wrap this up in a batch
|
||||
// update.
|
||||
NS_ENSURE_TRUE(mPresShell, NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsIViewManager> vm;
|
||||
mPresShell->GetViewManager(getter_AddRefs(vm));
|
||||
nsIViewManager* vm = GetPresContext()->GetViewManager();
|
||||
|
||||
vm->BeginUpdateViewBatch();
|
||||
|
||||
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
while (kid) {
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGFrame* SVGFrame=0;
|
||||
kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame);
|
||||
if (SVGFrame) {
|
||||
SVGFrame->NotifyRedrawSuspended();
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -915,18 +880,15 @@ nsSVGOuterSVGFrame::NotifyRedrawUnsuspended()
|
|||
|
||||
// get the view manager, so that we can wrap this up in a batch
|
||||
// update.
|
||||
NS_ENSURE_TRUE(mPresShell, NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsIViewManager> vm;
|
||||
mPresShell->GetViewManager(getter_AddRefs(vm));
|
||||
nsIViewManager* vm = GetPresContext()->GetViewManager();
|
||||
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
while (kid) {
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGFrame* SVGFrame=0;
|
||||
kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame);
|
||||
if (SVGFrame) {
|
||||
SVGFrame->NotifyRedrawUnsuspended();
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
|
||||
vm->EndUpdateViewBatch(NS_VMREFRESH_IMMEDIATE);
|
||||
|
|
Загрузка…
Ссылка в новой задаче