зеркало из https://github.com/mozilla/pjs.git
Another renaming for ease of readability: s/core/coreFrame/g and s/next/nextFrame/g
This commit is contained in:
Родитель
8c9bfa6586
Коммит
4e7ee44ceb
|
@ -298,16 +298,16 @@ struct nsPresentationData {
|
|||
// struct used by an embellished container to keep track of its embellished child
|
||||
struct nsEmbellishData {
|
||||
PRUint32 flags;
|
||||
nsIFrame* next; // handy pointer on our embellished child to descend the hierarchy
|
||||
nsIFrame* core; // pointer on the mo frame at the core of the embellished hierarchy
|
||||
nsIFrame* nextFrame; // handy pointer on our embellished child to descend the hierarchy
|
||||
nsIFrame* coreFrame; // pointer on the mo frame at the core of the embellished hierarchy
|
||||
nsStretchDirection direction;
|
||||
nscoord leftSpace, rightSpace;
|
||||
|
||||
nsEmbellishData()
|
||||
{
|
||||
flags = 0;
|
||||
next = nsnull;
|
||||
core = nsnull;
|
||||
nextFrame = nsnull;
|
||||
coreFrame = nsnull;
|
||||
direction = NS_STRETCH_DIRECTION_UNSUPPORTED;
|
||||
leftSpace = rightSpace = 0;
|
||||
}
|
||||
|
|
|
@ -161,19 +161,19 @@ nsMathMLContainerFrame::EmbellishOperator()
|
|||
if (firstChild && IsEmbellishOperator(firstChild)) {
|
||||
// Cache the first child
|
||||
mEmbellishData.flags |= NS_MATHML_EMBELLISH_OPERATOR;
|
||||
mEmbellishData.next = firstChild;
|
||||
mEmbellishData.nextFrame = firstChild;
|
||||
// Cache also the inner-most embellished frame at the core of the hierarchy
|
||||
nsIMathMLFrame* mathMLFrame;
|
||||
firstChild->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLFrame);
|
||||
nsEmbellishData embellishData;
|
||||
mathMLFrame->GetEmbellishData(embellishData);
|
||||
mEmbellishData.core = embellishData.core;
|
||||
mEmbellishData.coreFrame = embellishData.coreFrame;
|
||||
mEmbellishData.direction = embellishData.direction;
|
||||
}
|
||||
else {
|
||||
mEmbellishData.flags &= ~NS_MATHML_EMBELLISH_OPERATOR;
|
||||
mEmbellishData.next = nsnull;
|
||||
mEmbellishData.core = nsnull;
|
||||
mEmbellishData.nextFrame = nsnull;
|
||||
mEmbellishData.coreFrame = nsnull;
|
||||
mEmbellishData.direction = NS_STRETCH_DIRECTION_UNSUPPORTED;
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -259,10 +259,10 @@ nsMathMLContainerFrame::GetPreferredStretchSize(nsIPresContext* aPresContex
|
|||
mathMLFrame->GetEmbellishData(childData);
|
||||
if (NS_MATHML_IS_EMBELLISH_OPERATOR(childData.flags) &&
|
||||
childData.direction == aStretchDirection &&
|
||||
childData.next) {
|
||||
childData.nextFrame) {
|
||||
// embellishements are not included, only consider the inner first child itself
|
||||
nsIMathMLFrame* mathMLchildFrame;
|
||||
childData.next->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLchildFrame);
|
||||
childData.nextFrame->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLchildFrame);
|
||||
if (mathMLchildFrame) {
|
||||
mathMLFrame = mathMLchildFrame;
|
||||
}
|
||||
|
@ -327,7 +327,7 @@ nsMathMLContainerFrame::Stretch(nsIPresContext* aPresContext,
|
|||
|
||||
// Pass the stretch to the first non-empty child ...
|
||||
|
||||
nsIFrame* childFrame = mEmbellishData.next;
|
||||
nsIFrame* childFrame = mEmbellishData.nextFrame;
|
||||
if (childFrame) {
|
||||
nsIMathMLFrame* mathMLFrame;
|
||||
childFrame->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLFrame);
|
||||
|
@ -390,7 +390,7 @@ nsMathMLContainerFrame::Stretch(nsIPresContext* aPresContext,
|
|||
|
||||
childFrame = mFrames.FirstChild();
|
||||
while (childFrame) {
|
||||
if (childFrame != mEmbellishData.next) {
|
||||
if (childFrame != mEmbellishData.nextFrame) {
|
||||
childFrame->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLFrame);
|
||||
if (mathMLFrame) {
|
||||
// retrieve the metrics that was stored at the previous pass
|
||||
|
@ -419,7 +419,7 @@ nsMathMLContainerFrame::Stretch(nsIPresContext* aPresContext,
|
|||
if (!IsEmbellishOperator(mParent)) {
|
||||
|
||||
nsEmbellishData coreData;
|
||||
mEmbellishData.core->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLFrame);
|
||||
mEmbellishData.coreFrame->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLFrame);
|
||||
mathMLFrame->GetEmbellishData(coreData);
|
||||
|
||||
mBoundingMetrics.width += coreData.leftSpace + coreData.rightSpace;
|
||||
|
@ -475,7 +475,7 @@ nsMathMLContainerFrame::FinalizeReflow(nsIPresContext* aPresContext,
|
|||
// because it excludes the particular case of the core <mo>...</mo> itself.
|
||||
// (<mo> needs to fire stretch on its MathMLChar in any case to initialize it)
|
||||
PRBool placeOrigin = !NS_MATHML_IS_EMBELLISH_OPERATOR(mEmbellishData.flags) ||
|
||||
(mEmbellishData.core != this && !mEmbellishData.next &&
|
||||
(mEmbellishData.coreFrame != this && !mEmbellishData.nextFrame &&
|
||||
mEmbellishData.direction == NS_STRETCH_DIRECTION_UNSUPPORTED);
|
||||
Place(aPresContext, aRenderingContext, placeOrigin, aDesiredSize);
|
||||
|
||||
|
@ -492,7 +492,7 @@ nsMathMLContainerFrame::FinalizeReflow(nsIPresContext* aPresContext,
|
|||
if (NS_MATHML_WILL_STRETCH_ALL_CHILDREN_VERTICALLY(parentData.flags) ||
|
||||
NS_MATHML_WILL_STRETCH_ALL_CHILDREN_HORIZONTALLY(parentData.flags) ||
|
||||
(NS_MATHML_IS_EMBELLISH_OPERATOR(parentData.flags)
|
||||
&& parentData.next == this))
|
||||
&& parentData.nextFrame == this))
|
||||
{
|
||||
parentWillFireStretch = PR_TRUE;
|
||||
}
|
||||
|
@ -505,7 +505,7 @@ nsMathMLContainerFrame::FinalizeReflow(nsIPresContext* aPresContext,
|
|||
NS_MATHML_WILL_STRETCH_ALL_CHILDREN_HORIZONTALLY(mEmbellishData.flags);
|
||||
|
||||
nsBoundingMetrics defaultSize;
|
||||
if (mEmbellishData.core == this /* case of a bare <mo>...</mo> itself */
|
||||
if (mEmbellishData.coreFrame == this /* case of a bare <mo>...</mo> itself */
|
||||
|| stretchAll) { /* or <mover><mo>...</mo>...</mover>, or friends */
|
||||
// use our current size as computed earlier by Place()
|
||||
defaultSize = aDesiredSize.mBoundingMetrics;
|
||||
|
|
|
@ -217,6 +217,8 @@ nsMathMLFrame::GetAxisHeight(nsIRenderingContext& aRenderingContext,
|
|||
nsIFontMetrics* aFontMetrics,
|
||||
nscoord& aAxisHeight)
|
||||
{
|
||||
GetAxisHeight(aFontMetrics, aAxisHeight);
|
||||
return;
|
||||
// get the bounding metrics of the minus sign, the rendering context
|
||||
// is assumed to have been set with the font of the current style context
|
||||
#ifdef NS_DEBUG
|
||||
|
|
|
@ -222,8 +222,8 @@ nsMathMLmactionFrame::GetSelectedFrame()
|
|||
// if the selected child is an embellished operator,
|
||||
// we become embellished as well
|
||||
mEmbellishData.flags &= ~NS_MATHML_EMBELLISH_OPERATOR;
|
||||
mEmbellishData.next = nsnull;
|
||||
mEmbellishData.core = nsnull;
|
||||
mEmbellishData.nextFrame = nsnull;
|
||||
mEmbellishData.coreFrame = nsnull;
|
||||
mEmbellishData.direction = NS_STRETCH_DIRECTION_UNSUPPORTED;
|
||||
if (mSelectedFrame) {
|
||||
nsIMathMLFrame* mathMLFrame;
|
||||
|
@ -233,8 +233,8 @@ nsMathMLmactionFrame::GetSelectedFrame()
|
|||
mathMLFrame->GetEmbellishData(embellishData);
|
||||
if (NS_MATHML_IS_EMBELLISH_OPERATOR(embellishData.flags)) {
|
||||
mEmbellishData.flags |= NS_MATHML_EMBELLISH_OPERATOR;
|
||||
mEmbellishData.next = mSelectedFrame; // yes!
|
||||
mEmbellishData.core = embellishData.core;
|
||||
mEmbellishData.nextFrame = mSelectedFrame; // yes!
|
||||
mEmbellishData.coreFrame = embellishData.coreFrame;
|
||||
mEmbellishData.direction = embellishData.direction;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -278,10 +278,10 @@ nsMathMLmfracFrame::Place(nsIPresContext* aPresContext,
|
|||
// lspace & rspace from <mo> if we are an embellished container
|
||||
nscoord leftSpace = onePixel;
|
||||
nscoord rightSpace = onePixel;
|
||||
if (mEmbellishData.core) {
|
||||
if (mEmbellishData.coreFrame) {
|
||||
nsEmbellishData coreData;
|
||||
nsIMathMLFrame* mathMLFrame;
|
||||
mEmbellishData.core->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLFrame);
|
||||
mEmbellishData.coreFrame->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLFrame);
|
||||
mathMLFrame->GetEmbellishData(coreData);
|
||||
leftSpace = coreData.leftSpace;
|
||||
rightSpace = coreData.rightSpace;
|
||||
|
|
|
@ -153,8 +153,8 @@ public:
|
|||
// Stretch() on its embellished child
|
||||
mEmbellishData.direction = NS_STRETCH_DIRECTION_UNSUPPORTED;
|
||||
// break the embellished hierarchy to stop propagating the stretching
|
||||
// process, but keep access to mEmbellishData.core for convenience
|
||||
mEmbellishData.next = nsnull;
|
||||
// process, but keep access to mEmbellishData.coreFrame for convenience
|
||||
mEmbellishData.nextFrame = nsnull;
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
|
@ -204,8 +204,8 @@ nsMathMLmoFrame::SetInitialChildList(nsIPresContext* aPresContext,
|
|||
if (firstChild) {
|
||||
mEmbellishData.direction = mMathMLChar.GetStretchDirection();
|
||||
mEmbellishData.flags |= NS_MATHML_EMBELLISH_OPERATOR;
|
||||
mEmbellishData.next = nsnull;
|
||||
mEmbellishData.core = this;
|
||||
mEmbellishData.nextFrame = nsnull;
|
||||
mEmbellishData.coreFrame = this;
|
||||
|
||||
// there are two extra things that we need to record so that if our
|
||||
// parent is <mover>, <munder>, or <munderover>, they will treat us properly:
|
||||
|
@ -305,9 +305,9 @@ nsMathMLmoFrame::InitData(nsIPresContext* aPresContext)
|
|||
mathMLFrame->GetEmbellishData(embellishData);
|
||||
}
|
||||
else {
|
||||
embellishData.core = nsnull;
|
||||
embellishData.coreFrame = nsnull;
|
||||
}
|
||||
} while (embellishData.core == this);
|
||||
} while (embellishData.coreFrame == this);
|
||||
// flag if we have an embellished ancestor
|
||||
if (embellishAncestor != this) {
|
||||
mFlags |= NS_MATHML_OPERATOR_EMBELLISH_ANCESTOR;
|
||||
|
|
|
@ -206,7 +206,7 @@ XXX The winner is the outermost in conflicting settings like these:
|
|||
}
|
||||
}
|
||||
else { // no attribute, get the value from the core
|
||||
rv = mEmbellishData.core->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLFrame);
|
||||
rv = mEmbellishData.coreFrame->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLFrame);
|
||||
if (NS_SUCCEEDED(rv) && mathMLFrame) {
|
||||
mathMLFrame->GetEmbellishData(embellishData);
|
||||
if (NS_MATHML_EMBELLISH_IS_MOVABLELIMITS(embellishData.flags)) {
|
||||
|
@ -222,8 +222,8 @@ XXX The winner is the outermost in conflicting settings like these:
|
|||
if (NS_SUCCEEDED(rv) && overscriptMathMLFrame) {
|
||||
overscriptMathMLFrame->GetEmbellishData(embellishData);
|
||||
// core of the overscriptFrame
|
||||
if (NS_MATHML_IS_EMBELLISH_OPERATOR(embellishData.flags) && embellishData.core) {
|
||||
rv = embellishData.core->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLFrame);
|
||||
if (NS_MATHML_IS_EMBELLISH_OPERATOR(embellishData.flags) && embellishData.coreFrame) {
|
||||
rv = embellishData.coreFrame->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLFrame);
|
||||
if (NS_SUCCEEDED(rv) && mathMLFrame) {
|
||||
mathMLFrame->GetEmbellishData(embellishData);
|
||||
// if we have the accent attribute, tell the core to behave as
|
||||
|
|
|
@ -205,7 +205,7 @@ XXX The winner is the outermost setting in conflicting settings like these:
|
|||
}
|
||||
}
|
||||
else { // no attribute, get the value from the core
|
||||
rv = mEmbellishData.core->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLFrame);
|
||||
rv = mEmbellishData.coreFrame->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLFrame);
|
||||
if (NS_SUCCEEDED(rv) && mathMLFrame) {
|
||||
mathMLFrame->GetEmbellishData(embellishData);
|
||||
if (NS_MATHML_EMBELLISH_IS_MOVABLELIMITS(embellishData.flags)) {
|
||||
|
@ -221,8 +221,8 @@ XXX The winner is the outermost setting in conflicting settings like these:
|
|||
if (NS_SUCCEEDED(rv) && underscriptMathMLFrame) {
|
||||
underscriptMathMLFrame->GetEmbellishData(embellishData);
|
||||
// core of the underscriptFrame
|
||||
if (NS_MATHML_IS_EMBELLISH_OPERATOR(embellishData.flags) && embellishData.core) {
|
||||
rv = embellishData.core->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLFrame);
|
||||
if (NS_MATHML_IS_EMBELLISH_OPERATOR(embellishData.flags) && embellishData.coreFrame) {
|
||||
rv = embellishData.coreFrame->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLFrame);
|
||||
if (NS_SUCCEEDED(rv) && mathMLFrame) {
|
||||
mathMLFrame->GetEmbellishData(embellishData);
|
||||
// if we have the accentunder attribute, tell the core to behave as
|
||||
|
|
|
@ -210,7 +210,7 @@ nsMathMLmunderoverFrame::SetInitialChildList(nsIPresContext* aPresContext,
|
|||
}
|
||||
}
|
||||
else { // no attribute, get the value from the core
|
||||
rv = mEmbellishData.core->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLFrame);
|
||||
rv = mEmbellishData.coreFrame->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLFrame);
|
||||
if (NS_SUCCEEDED(rv) && mathMLFrame) {
|
||||
mathMLFrame->GetEmbellishData(embellishData);
|
||||
if (NS_MATHML_EMBELLISH_IS_MOVABLELIMITS(embellishData.flags)) {
|
||||
|
@ -226,8 +226,8 @@ nsMathMLmunderoverFrame::SetInitialChildList(nsIPresContext* aPresContext,
|
|||
if (NS_SUCCEEDED(rv) && underscriptMathMLFrame) {
|
||||
underscriptMathMLFrame->GetEmbellishData(embellishData);
|
||||
// core of the underscriptFrame
|
||||
if (NS_MATHML_IS_EMBELLISH_OPERATOR(embellishData.flags) && embellishData.core) {
|
||||
rv = embellishData.core->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLFrame);
|
||||
if (NS_MATHML_IS_EMBELLISH_OPERATOR(embellishData.flags) && embellishData.coreFrame) {
|
||||
rv = embellishData.coreFrame->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLFrame);
|
||||
if (NS_SUCCEEDED(rv) && mathMLFrame) {
|
||||
mathMLFrame->GetEmbellishData(embellishData);
|
||||
// if we have the accentunder attribute, tell the core to behave as
|
||||
|
@ -254,8 +254,8 @@ nsMathMLmunderoverFrame::SetInitialChildList(nsIPresContext* aPresContext,
|
|||
if (NS_SUCCEEDED(rv) && overscriptMathMLFrame) {
|
||||
overscriptMathMLFrame->GetEmbellishData(embellishData);
|
||||
// core of the overscriptFrame
|
||||
if (NS_MATHML_IS_EMBELLISH_OPERATOR(embellishData.flags) && embellishData.core) {
|
||||
rv = embellishData.core->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLFrame);
|
||||
if (NS_MATHML_IS_EMBELLISH_OPERATOR(embellishData.flags) && embellishData.coreFrame) {
|
||||
rv = embellishData.coreFrame->QueryInterface(NS_GET_IID(nsIMathMLFrame), (void**)&mathMLFrame);
|
||||
if (NS_SUCCEEDED(rv) && mathMLFrame) {
|
||||
mathMLFrame->GetEmbellishData(embellishData);
|
||||
// if we have the accent attribute, tell the core to behave as
|
||||
|
|
Загрузка…
Ссылка в новой задаче