initial and long-awaited import of MathML for Roger Sidje and his crew

This commit is contained in:
shaver%netscape.com 1999-09-21 02:12:01 +00:00
Родитель f095535665
Коммит ae8628f9e4
75 изменённых файлов: 9117 добавлений и 0 удалений

1
layout/mathml/.cvsignore Normal file
Просмотреть файл

@ -0,0 +1 @@
Makefile

34
layout/mathml/Makefile.in Normal file
Просмотреть файл

@ -0,0 +1,34 @@
#!gmake
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Mozilla MathML Project.
#
# The Initial Developer of the Original Code is Heriot-Watt
# University, Edinburgh. Portions created by Heriot-Watt University
# are Copyright (C) 1999 Heriot-Watt University. All Rights Reserved.
#
# Contributor(s):
# David J. Fiddes <D.J.Fiddes@hw.ac.uk>
#
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = content base
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -0,0 +1 @@
Makefile

Просмотреть файл

@ -0,0 +1,34 @@
#!gmake
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Mozilla MathML Project.
#
# The Initial Developer of the Original Code is Heriot-Watt
# University, Edinburgh. Portions created by Heriot-Watt University
# are Copyright (C) 1999 Heriot-Watt University. All Rights Reserved.
#
# Contributor(s):
# David J. Fiddes <D.J.Fiddes@hw.ac.uk>
#
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = src
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk

Просмотреть файл

Просмотреть файл

@ -0,0 +1 @@
Makefile

Просмотреть файл

@ -0,0 +1,76 @@
#!gmake
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Mozilla MathML Project.
#
# The Initial Developer of the Original Code is Heriot-Watt
# University, Edinburgh. Portions created by Heriot-Watt University
# are Copyright (C) 1999 Heriot-Watt University. All Rights Reserved.
#
# Contributor(s):
# David J. Fiddes <D.J.Fiddes@hw.ac.uk>
#
DEPTH=../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = raptormathmlbase_s
LOCAL_INCLUDES = \
-I$(srcdir)/../../../base/src \
-I$(srcdir)/../../../html/style/src \
-I$(srcdir)/../../../html/base/src \
-I$(srcdir)/../../../html/content/src \
-I$(srcdir)/../../../html/table/src \
-I$(srcdir)/../../content/src \
$(NULL)
CPPSRCS = nsMathMLChar.cpp \
nsMathMLContainerFrame.cpp \
nsMathMLmrowFrame.cpp \
nsMathMLmphantomFrame.cpp \
nsMathMLmfencedFrame.cpp \
nsMathMLmrowFrame.cpp \
nsMathMLmfracFrame.cpp \
nsMathMLmsupFrame.cpp \
nsMathMLmsubFrame.cpp \
nsMathMLmsubsupFrame.cpp \
nsMathMLmmultiscriptsFrame.cpp \
nsMathMLmiFrame.cpp \
nsMathMLmtdFrame.cpp \
nsMathMLmoFrame.cpp \
nsMathMLmunderFrame.cpp \
nsMathMLmoverFrame.cpp \
nsMathMLmunderoverFrame.cpp \
nsMathMLmpaddedFrame.cpp \
nsMathMLmstyleFrame.cpp \
$(NULL)
include $(topsrcdir)/config/config.mk
DEFINES +=
MODULE=layout
MKSHLIB :=
# we don't want the shared lib, but we want to force the creation of a static lib.
# do we still want this? - DJF
override NO_SHARED_LIB=1
override NO_STATIC_LIB=
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -0,0 +1,94 @@
#!nmake
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Mozilla MathML Project.
#
# The Initial Developer of the Original Code is Heriot-Watt
# University, Edinburgh. Portions created by Heriot-Watt University
# are Copyright (C) 1999 Heriot-Watt University. All Rights Reserved.
#
# Contributor(s):
# David J. Fiddes <D.J.Fiddes@hw.ac.uk>
#
DEPTH=..\..\..\..
LIBRARY_NAME=raptormathmlbase_s
MODULE=raptor
REQUIRES=xpcom raptor pref
DEFINES= -DWIN32_LEAN_AND_MEAN
CPPSRCS= nsMathMLChar.cpp \
nsMathMLContainerFrame.cpp \
nsMathMLmrowFrame.obj \
nsMathMLmphantomFrame.cpp \
nsMathMLmfencedFrame.cpp \
nsMathMLmfracFrame.cpp \
nsMathMLmsubFrame.cpp \
nsMathMLmiFrame.cpp \
nsMathMLmsubsupFrame.cpp \
nsMathMLmmultiscriptsFrame.cpp \
nsMathMLmsupFrame.cpp \
nsMathMLmtdFrame.cpp \
nsMathMLmoFrame.cpp \
nsMathMLmunderFrame.cpp \
nsMathMLmoverFrame.cpp \
nsMathMLmunderoverFrame.cpp \
nsMathMLmpaddedFrame.cpp \
nsMathMLmstyleFrame.cpp \
$(NULL)
CPP_OBJS= .\$(OBJDIR)\nsMathMLChar.obj \
.\$(OBJDIR)\nsMathMLContainerFrame.obj \
.\$(OBJDIR)\nsMathMLmrowFrame.obj \
.\$(OBJDIR)\nsMathMLmphantomFrame.obj \
.\$(OBJDIR)\nsMathMLmfencedFrame.obj \
.\$(OBJDIR)\nsMathMLmfracFrame.obj \
.\$(OBJDIR)\nsMathMLmsubFrame.obj \
.\$(OBJDIR)\nsMathMLmiFrame.obj \
.\$(OBJDIR)\nsMathMLmsubsupFrame.obj \
.\$(OBJDIR)\nsMathMLmmultiscriptsFrame.obj \
.\$(OBJDIR)\nsMathMLmsupFrame.obj \
.\$(OBJDIR)\nsMathMLmtdFrame.obj \
.\$(OBJDIR)\nsMathMLmoFrame.obj \
.\$(OBJDIR)\nsMathMLmunderFrame.obj \
.\$(OBJDIR)\nsMathMLmoverFrame.obj \
.\$(OBJDIR)\nsMathMLmunderoverFrame.obj \
.\$(OBJDIR)\nsMathMLmpaddedFrame.obj \
.\$(OBJDIR)\nsMathMLmstyleFrame.obj \
$(NULL)
EXPORTS = \
$(NULL)
LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor -I$(PUBLIC)\js \
-I..\..\..\html\style\src \
-I..\..\..\html\base\src \
-I..\..\..\html\content\src \
-I..\..\..\html\table\src \
-I$(PUBLIC)\dom \
-I..\..\content\src \
-I$(PUBLIC)\netlib -I..\..\..\base\src -I$(PUBLIC)\pref
LCFLAGS = \
$(LCFLAGS) \
$(DEFINES) \
$(NULL)
include <$(DEPTH)\config\rules.mak>
libs:: $(LIBRARY)
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
clobber::
rm -f $(DIST)\lib\$(LIBRARY_NAME).lib

Просмотреть файл

@ -0,0 +1,88 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
*/
#ifndef nsIMathMLFrame_h___
#define nsIMathMLFrame_h___
// IID for the nsIMathMLFrame interface (the IID was taken from IIDS.h)
#define NS_IMATHMLFRAME_IID \
{ 0xa6cf90f6, 0x15b3, 0x11d2, \
{ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 } }
static NS_DEFINE_IID(kIMathMLFrameIID, NS_IMATHMLFRAME_IID);
class nsIMathMLFrame : public nsISupports {
public:
static const nsIID& GetIID() { static nsIID iid = NS_IMATHMLFRAME_IID; return iid; }
/* SUPPORT FOR STRETCHY ELEMENTS: <mo> */
/*====================================================================*/
/* method used to ask a stretchy MathML frame to stretch
* itself depending on its context
*/
NS_IMETHOD
Stretch(nsIPresContext& aPresContext,
nsStretchDirection aStretchDirection,
nsCharMetrics& aContainerSize,
nsCharMetrics& aDesiredStretchSize) = 0;
/* SUPPORT FOR SCRIPTING ELEMENTS: */
/*====================================================================*/
/* GetPresentationData :
/* returns the scriptlevel and displaystyle of the frame */
NS_IMETHOD
GetPresentationData(PRInt32* aScriptLevel,
PRBool* aDisplayStyle) = 0;
/* UpdatePresentationData :
/* Increment the scriptlevel of the frame, and set its displaystyle.
* Note that <mstyle> is the only tag which allows to set
* <mstyle displaystyle="true|false" scriptlevel="[+|-]number">
* Therefore <mstyle> has its peculiar version of this method.
*/
NS_IMETHOD
UpdatePresentationData(PRInt32 aScriptLevelIncrement,
PRBool aDisplayStyle) = 0;
/* UpdatePresentationDataFromChildAt :
/* Increments the scriplevel and set the display level on the whole tree.
* For child frames at: aIndex, aIndex+1, aIndex+2, etc, this method set
* their mDisplayStyle to aDisplayStyle and increment their mScriptLevel
* with aScriptLevelIncrement. The increment is propagated down to the
* subtrees of each of these child frames. Note that <mstyle> is the only
* tag which allows <mstyle displaystyle="true|false" scriptlevel="[+|-]number">
* to reset or increment the scriptlevel in a manual way. Therefore <mstyle>
* has its own peculiar version of this method.
*/
NS_IMETHOD
UpdatePresentationDataFromChildAt(PRInt32 aIndex,
PRInt32 aScriptLevelIncrement,
PRBool aDisplayStyle) = 0;
};
#endif /* nsIMathMLFrame_h___ */

Просмотреть файл

@ -0,0 +1,134 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
*/
#include "nsCOMPtr.h"
#include "nsHTMLParts.h"
#include "nsIHTMLContent.h"
#include "nsFrame.h"
#include "nsLineLayout.h"
#include "nsHTMLIIDs.h"
#include "nsIPresContext.h"
#include "nsHTMLAtoms.h"
#include "nsUnitConversion.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsINameSpaceManager.h"
#include "nsString.h"
#include "nsIRenderingContext.h"
#include "nsIFontMetrics.h"
#include "nsStyleUtil.h"
#include "nsMathMLAtoms.h"
#include "nsMathMLChar.h"
#include "nsMathMLOperators.h"
//
// nsMathMLChar implementation
//
// aDesiredStretchSize is an IN/OUT parameter.
NS_IMETHODIMP
nsMathMLChar::Stretch(nsIPresContext& aPresContext,
nsIStyleContext* aStyleContext,
nsCharMetrics& aContainerSize,
nsCharMetrics& aDesiredStretchSize)
{
// get the value of 'em';
const nsStyleFont* aFont =
(const nsStyleFont*)aStyleContext->GetStyleData(eStyleStruct_Font);
nscoord em = NSToCoordRound(float(aFont->mFont.size));
mOffset.x = nscoord(mLeftSpace * em);
mOffset.y = 0;
// do the stretching
if (NS_MATHML_OPERATOR_IS_STRETCHY(mFlags)) {
if (mDirection == NS_STRETCH_DIRECTION_VERTICAL) {
mOffset.y = aContainerSize.ascent - aDesiredStretchSize.ascent;
// vertical stretching... for a boundary symbol
aDesiredStretchSize.descent = aContainerSize.descent;
aDesiredStretchSize.ascent = aContainerSize.ascent;
aDesiredStretchSize.height = aDesiredStretchSize.ascent
+ aDesiredStretchSize.descent;
}
else if (mDirection == NS_STRETCH_DIRECTION_HORIZONTAL) {
// horizontal stretching... for an accent
aDesiredStretchSize.width = aContainerSize.width;
}
}
// adjust the spacing
aDesiredStretchSize.width += nscoord((mLeftSpace+mRightSpace)*em);
return NS_OK;
}
NS_IMETHODIMP
nsMathMLChar::Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
nsIStyleContext* aStyleContext,
const nsRect& aRect)
{
nsresult rv = NS_OK;
const nsStyleColor* color =
(const nsStyleColor*)aStyleContext->GetStyleData(eStyleStruct_Color);
const nsStyleFont* font =
(const nsStyleFont*)aStyleContext->GetStyleData(eStyleStruct_Font);
// Set color and font
aRenderingContext.SetColor(color->mColor);
aRenderingContext.SetFont(font->mFont);
// Display the char
const PRUnichar* aString = mData.GetUnicode();
PRUint32 aLength = mLength;
aRenderingContext.DrawString(aString, aLength, mOffset.x, mOffset.y);
// DEBUG
// Draw a border around the char
//aRenderingContext.SetColor(NS_RGB(255,0,0));
//aRenderingContext.DrawRect(aRect);
return rv;
}
#if 0
// Each stretchy symbol can have its improved Stretch() and
// Paint() methods that override the default ones.
void
nsMathMLChar::StretchIntegral()
{
}
void
nsMathMLChar::PaintIntegral()
{
}
...
#endif

Просмотреть файл

@ -0,0 +1,91 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
*/
#ifndef nsMathMLChar_h___
#define nsMathMLChar_h___
#include "nsMathMLOperators.h"
class nsMathMLChar
{
public:
NS_IMETHOD Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
nsIStyleContext* aStyleContext,
const nsRect& aRect);
// This is the method called to ask the char to stretch itself.
// aDesiredStretchSize is an IN/OUT parameter.
// On input - it contains our current size.
// On output - the same size or the new size, including padding that we want.
NS_IMETHOD Stretch(nsIPresContext& aPresContext,
nsIStyleContext* aStyleContext,
nsCharMetrics& aContainerSize,
nsCharMetrics& aDesiredStretchSize);
void Init(nsIFrame* aFrame,
const PRInt32 aLength,
const nsString& aData,
const nsOperatorFlags aFlags,
const float aLeftSpace,
const float aRightSpace,
const nsStretchDirection aDirection)
{
mFrame = aFrame;
mLength = aLength;
mData = aData;
mFlags = aFlags;
mLeftSpace = aLeftSpace;
mRightSpace = aRightSpace;
mDirection = aDirection;
}
void SetLength(const PRInt32 aLength)
{
mLength = aLength;
}
PRInt32 GetLength()
{
return mLength;
}
// constructor and destructor
nsMathMLChar()
{
}
~nsMathMLChar()
{
}
protected:
PRInt32 mLength;
nsString mData;
nsOperatorFlags mFlags;
float mLeftSpace;
float mRightSpace;
nsStretchDirection mDirection;
nsPoint mOffset;
nsIFrame* mFrame; // up-pointer to the frame that contains us.
};
#endif /* nsMathMLChar_h___ */

Просмотреть файл

@ -0,0 +1,418 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#include "nsCOMPtr.h"
#include "nsHTMLParts.h"
#include "nsIHTMLContent.h"
#include "nsFrame.h"
#include "nsLineLayout.h"
#include "nsHTMLIIDs.h"
#include "nsIPresContext.h"
#include "nsHTMLAtoms.h"
#include "nsUnitConversion.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsINameSpaceManager.h"
#include "nsIRenderingContext.h"
#include "nsIFontMetrics.h"
#include "nsStyleUtil.h"
#include "nsITextContent.h"
#include "nsMathMLAtoms.h"
#include "nsMathMLParts.h"
#include "nsMathMLChar.h"
#include "nsMathMLContainerFrame.h"
//
// nsMathMLContainerFrame implementation
//
// TODO: Proper management of ignorable whitespace
// and handling of non-math related frames.
// * Should math markups only enclose other math markups?
// Why bother... we can leave them in, as hinted in the newsgroup.
//
// * Space doesn't count. Handling space is more complicated than it seems.
// We have to clean inside and outside:
// <mi> a </mi> <mo> + </mo> <mi> b </mi>
// ^ ^ ^ ^ ^ ^ ^ ^
// *Outside* currently handled using IsOnlyWhitespace().
// For whitespace only frames, their rect is set zero.
//
// *Inside* not currently handled... so the user must do <mi>a</mi>
// What to do?!
// - Add a nsTextFrame::CompressWhitespace() *if* it is MathML content?!
// - via CSS property? Support for "none/compress"? (white-space: normal | pre | nowrap)
// nsISupports
// =============================================================================
NS_IMETHODIMP
nsMathMLContainerFrame::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{
if (NULL == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
*aInstancePtr = nsnull;
if (aIID.Equals(kIMathMLFrameIID)) {
*aInstancePtr = (void*)(nsIMathMLFrame*)this;
NS_ADDREF_THIS(); // not effectual, frames are not Refcounted
return NS_OK;
}
return nsHTMLContainerFrame::QueryInterface(aIID, aInstancePtr);
}
NS_IMETHODIMP_(nsrefcnt)
nsMathMLContainerFrame::AddRef(void)
{
return NS_OK;
}
NS_IMETHODIMP_(nsrefcnt)
nsMathMLContainerFrame::Release(void)
{
return NS_OK;
}
/* ///////////////
* MathML specific - Whitespace management ...
* WHITESPACE: don't forget that whitespace doesn't count in MathML!
* empty frames shouldn't be created in MathML, oh well that's another story.
* =============================================================================
*/
PRBool
nsMathMLContainerFrame::IsOnlyWhitespace(nsIFrame* aFrame)
{
NS_PRECONDITION(aFrame, "null arg");
PRBool rv = PR_FALSE;
// by empty frame we mean a leaf frame whose text content is empty...
nsCOMPtr<nsIContent> aContent;
aFrame->GetContent(getter_AddRefs(aContent));
PRInt32 numKids;
aContent->ChildCount(numKids);
if (0 == numKids) {
nsCOMPtr<nsITextContent> tc(do_QueryInterface(aContent));
if (tc.get()) tc->IsOnlyWhitespace(&rv);
}
return rv;
}
void
nsMathMLContainerFrame::ReflowEmptyChild(nsIFrame* aFrame)
{
// nsHTMLReflowMetrics emptySize(nsnull);
// nsHTMLReflowState emptyReflowState(aPresContext, aReflowState, aFrame, nsSize(0,0));
// nsresult rv = ReflowChild(aFrame, aPresContext, emptySize, emptyReflowState, aStatus);
// 0-size the frame
aFrame->SetRect(nsRect(0,0,0,0));
// 0-size the view
nsIView* view = nsnull;
aFrame->GetView(&view);
if (view) {
nsCOMPtr<nsIViewManager> vm;
view->GetViewManager(*getter_AddRefs(vm));
vm->ResizeView(view, 0,0);
}
}
/* /////////////
* nsIMathMLFrame - support methods for stretchy elements and scripting
* elements (nested frames within msub, msup, msubsup, munder, mover,
* munderover, mmultiscripts, mfrac, mroot, mtable).
* =============================================================================
*/
NS_IMETHODIMP
nsMathMLContainerFrame::Stretch(nsIPresContext& aPresContext,
nsStretchDirection aStretchDirection,
nsCharMetrics& aContainerSize,
nsCharMetrics& aDesiredStretchSize)
{
return NS_OK; // the Stretch() is only implemented by <mo> and its nsMathMLChar
}
NS_IMETHODIMP
nsMathMLContainerFrame::GetPresentationData(PRInt32* aScriptLevel,
PRBool* aDisplayStyle)
{
NS_PRECONDITION(aScriptLevel && aDisplayStyle, "null arg");
*aScriptLevel = mScriptLevel;
*aDisplayStyle = mDisplayStyle;
return NS_OK;
}
NS_IMETHODIMP
nsMathMLContainerFrame::UpdatePresentationData(PRInt32 aScriptLevelIncrement,
PRBool aDisplayStyle)
{
mScriptLevel += aScriptLevelIncrement;
mDisplayStyle = aDisplayStyle;
return NS_OK;
}
NS_IMETHODIMP
nsMathMLContainerFrame::UpdatePresentationDataFromChildAt(PRInt32 aIndex,
PRInt32 aScriptLevelIncrement,
PRBool aDisplayStyle)
{
nsIFrame* childFrame = mFrames.FirstChild();
while (nsnull != childFrame) {
if (!IsOnlyWhitespace(childFrame)) {
if (0 >= aIndex--) {
nsIMathMLFrame* aMathMLFrame = nsnull;
nsresult rv = childFrame->QueryInterface(nsIMathMLFrame::GetIID(), (void**)&aMathMLFrame);
if (NS_SUCCEEDED(rv) && nsnull != aMathMLFrame) {
// update
aMathMLFrame->UpdatePresentationData(aScriptLevelIncrement, aDisplayStyle);
// propagate down the subtrees
aMathMLFrame->UpdatePresentationDataFromChildAt(0, aScriptLevelIncrement, aDisplayStyle);
}
}
}
childFrame->GetNextSibling(&childFrame);
}
return NS_OK;
}
/* //////////////////
* Frame construction
* =============================================================================
*/
NS_IMETHODIMP
nsMathMLContainerFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv;
// first, let the base class do its Init()
rv = nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
// now, if our parent implements the nsIMathMLFrame interface, we inherit
// its scriptlevel and displaystyle. If the parent later wishes to increment
// with other values, it will do so in its SetInitialChildList() method.
mScriptLevel = 0;
mDisplayStyle = PR_TRUE;
nsIMathMLFrame* aMathMLFrame = nsnull;
nsresult res = aParent->QueryInterface(nsIMathMLFrame::GetIID(), (void**)&aMathMLFrame);
if (NS_SUCCEEDED(res) && nsnull != aMathMLFrame) {
PRInt32 aScriptLevel = 0;
PRBool aDisplayStyle = PR_TRUE;
aMathMLFrame->GetPresentationData(&aScriptLevel, &aDisplayStyle);
UpdatePresentationData(aScriptLevel, aDisplayStyle);
}
return rv;
}
NS_IMETHODIMP
nsMathMLContainerFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
nsresult rv = NS_OK;
nsReflowStatus childStatus;
nsHTMLReflowMetrics childDesiredSize(aDesiredSize.maxElementSize);
nsSize availSize(aReflowState.mComputedWidth, aReflowState.mComputedHeight);
nsRect rect;
aStatus = NS_FRAME_NOT_COMPLETE;
aDesiredSize.width = aDesiredSize.height = aDesiredSize.ascent = aDesiredSize.descent = 0;
//////////////////
// Reflow Children
nsIFrame* childFrame = mFrames.FirstChild();
while (nsnull != childFrame) {
//////////////
// WHITESPACE: don't forget that whitespace doesn't count in MathML!
if (IsOnlyWhitespace(childFrame)) {
ReflowEmptyChild(childFrame);
}
else {
nsHTMLReflowState childReflowState(aPresContext, aReflowState, childFrame, availSize);
rv = ReflowChild(childFrame, aPresContext, childDesiredSize, childReflowState, childStatus);
NS_ASSERTION(NS_FRAME_IS_COMPLETE(childStatus), "bad status");
if (NS_FAILED(rv)) {
return rv;
}
// 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. Before return,
// we should set the origins so as to overwrite what we are storing there now.
childFrame->SetRect(nsRect(childDesiredSize.descent, childDesiredSize.ascent,
childDesiredSize.width, childDesiredSize.height));
aDesiredSize.width += childDesiredSize.width;
if (aDesiredSize.ascent < childDesiredSize.ascent) {
aDesiredSize.ascent = childDesiredSize.ascent;
}
if (aDesiredSize.descent < childDesiredSize.descent) {
aDesiredSize.descent = childDesiredSize.descent;
}
}
rv = childFrame->GetNextSibling(&childFrame);
NS_ASSERTION(NS_SUCCEEDED(rv),"failed to get next child");
}
aDesiredSize.height = aDesiredSize.ascent + aDesiredSize.descent;
/////////////
// Ask stretchy children to stretch themselves
nsStretchDirection stretchDir = NS_STRETCH_DIRECTION_VERTICAL;
nsCharMetrics parentSize, childSize;
parentSize.descent = aDesiredSize.descent; parentSize.width = aDesiredSize.width;
parentSize.ascent = aDesiredSize.ascent; parentSize.height = aDesiredSize.height;
aDesiredSize.width = aDesiredSize.height = aDesiredSize.ascent = aDesiredSize.descent = 0;
childFrame = mFrames.FirstChild();
while (nsnull != childFrame) {
// retrieve the metrics that was stored at the previous pass
childFrame->GetRect(rect);
childSize.descent = rect.x; childSize.width = rect.width;
childSize.ascent = rect.y; childSize.height = rect.height;
//////////
// Stretch ...
// Only directed at frames that implement the nsIMathMLFrame interface
nsIMathMLFrame* aMathMLFrame;
rv = childFrame->QueryInterface(nsIMathMLFrame::GetIID(), (void**)&aMathMLFrame);
if (NS_SUCCEEDED(rv) && nsnull != aMathMLFrame) {
aMathMLFrame->Stretch(aPresContext, stretchDir, parentSize, childSize);
// store the updated metrics
childFrame->SetRect(nsRect(childSize.descent, childSize.ascent,
childSize.width, childSize.height));
}
aDesiredSize.width += childSize.width;
if (aDesiredSize.ascent < childSize.ascent) {
aDesiredSize.ascent = childSize.ascent;
}
if (aDesiredSize.descent < childSize.descent) {
aDesiredSize.descent = childSize.descent;
}
rv = childFrame->GetNextSibling(&childFrame);
NS_ASSERTION(NS_SUCCEEDED(rv),"failed to get next child");
}
aDesiredSize.height = aDesiredSize.ascent + aDesiredSize.descent;
/////////////
// Place Children now by re-adjusting the origins to align the baselines
nsPoint offset(0,0);
childFrame = mFrames.FirstChild();
while (nsnull != childFrame) {
childFrame->GetRect(rect);
offset.y = aDesiredSize.ascent - rect.y;
childFrame->MoveTo(offset.x,offset.y);
offset.x += rect.width;
rv = childFrame->GetNextSibling(&childFrame);
NS_ASSERTION(NS_SUCCEEDED(rv),"failed to get next child");
}
if (nsnull != aDesiredSize.maxElementSize) {
aDesiredSize.maxElementSize->width = aDesiredSize.width;
aDesiredSize.maxElementSize->height = aDesiredSize.height;
}
aStatus = NS_FRAME_COMPLETE;
return NS_OK;
}
// This method is an implementation of nsIFrame::ReResolveStyleContext
// It is used for switching the font to a subscript/superscript font in
// msub, msup, msubsup, munder, mover, munderover, mmultiscripts
NS_IMETHODIMP
nsMathMLContainerFrame::ReResolveStyleContext(nsIPresContext* aPresContext,
nsIStyleContext* aParentContext,
PRInt32 aParentChange,
nsStyleChangeList* aChangeList,
PRInt32* aLocalChange)
{
// re calculate our own style context
PRInt32 ourChange = aParentChange;
nsresult rv = nsFrame::ReResolveStyleContext(aPresContext, aParentContext,
ourChange, aChangeList, &ourChange);
if (NS_FAILED(rv)) {
return rv;
}
if (aLocalChange) {
*aLocalChange = ourChange;
}
// re-resolve children
nsIFrame* child = mFrames.FirstChild();
while (nsnull != child && NS_SUCCEEDED(rv)) {
if (!IsOnlyWhitespace(child)) {
// default is to inherit the parent style
nsIStyleContext* aStyleContext = mStyleContext;
nsIStyleContext* newStyleContext = mStyleContext;
// see if the child frame implements the nsIMathMLFrame interface
nsIMathMLFrame* aMathMLFrame;
rv = child->QueryInterface(nsIMathMLFrame::GetIID(), (void**)&aMathMLFrame);
if (NS_SUCCEEDED(rv) && nsnull != aMathMLFrame) {
// get the scriptlevel of the child
PRInt32 childLevel;
PRBool childDisplayStyle;
aMathMLFrame->GetPresentationData(&childLevel, &childDisplayStyle);
// iteration to get a pseudo style context for the script level font
nsAutoString fontSize;
PRInt32 gap = childLevel - mScriptLevel;
fontSize = (0 < gap)? ":-moz-math-font-size-smaller" : ":-moz-math-font-size-larger";
nsCOMPtr<nsIAtom> fontAtom(getter_AddRefs(NS_NewAtom(fontSize)));
if (0 > gap) gap = -gap; // absolute value
while (0 < gap) {
aPresContext->ResolvePseudoStyleContextFor(mContent, fontAtom, aStyleContext,
PR_FALSE, &newStyleContext);
aStyleContext = newStyleContext;
gap--;
}
}
PRInt32 childChange;
rv = child->ReResolveStyleContext(aPresContext, newStyleContext,
ourChange, aChangeList, &childChange);
}
child->GetNextSibling(&child);
}
return rv;
}

Просмотреть файл

@ -0,0 +1,143 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#ifndef nsMathMLContainerFrame_h___
#define nsMathMLContainerFrame_h___
#include "nsCOMPtr.h"
#include "nsIViewManager.h"
#include "nsHTMLContainerFrame.h"
#include "nsMathMLOperators.h"
#include "nsIMathMLFrame.h"
/*
* Base class for MathML container frames. It acts like an inferred
* mrow. By default, this frame uses its Reflow() method to lay its
* children horizontally and ensure that their baselines are aligned.
*
* This frame is a *math-aware frame* in the sense that given the
* markup <tag>base arguments</tag>, the method ReResolveStyleContext()
* can be used to render the 'base' in normal-font, and the 'arguments'
* in small-font. This is a common functionality to tags like msub, msup,
* msubsup, mover, munder, munderover, mmultiscripts. All are derived
* from this base class. They use SetInitialChildList() to trigger
* ReResolveStyleContext() for the very first time as soon as all their
* children are known. However, each of these tags has its own Reflow()
* method to lay its children as appropriate, thus overriding the default
* Reflow() method in this base class.
*
* Other tags like mi that do not have 'arguments' can be derived from
* this base class as well. The class caters for empty arguments.
* Notice that mi implements its own ReResolveStyleContext() method
* to switch to a normal-font (rather than italics) if its text content
* is not a single character (as per the MathML REC).
*
* In general therefore, to derive other tags from this base class,
* ReResolveStyleContext() must be coded to produce the desired stylistic
* effects. For example, mfrac has its own ReResolveStyleContext() method
* to set both the numerator and denominator to a small font size, whereas
* mrow does not have its own implementation of ReResolveStyleContext(),
* and instead uses the one in the base class nsHTMLContainerFrame.
*
* The advantage provided by the default ReResolveStyleContext() herein is
* that MathML tags that need scriptstyle switching can be derived from this
* base class with minimum footprint. For the few tags that need different
* style switching or that do not need style switching at all, you *should*
* override the default ReResolveStyleContext() method provided in this base.
* Do not use this nsMathMLContainerFrame::ReResolveStyleContext for a
* <tag>base arguments</tag> not needing 'arguments' in small font size.
* Instead, you should use nsHTMLContainerFrame::ReResolveStyleContext or
* provide your own.
*
* ReResolveStyleContext() implements nsIFrame::ReResolveStyleContext().
* See the documentation in nsIFrame.h for additional information on the
* frame API.
*/
class nsMathMLContainerFrame : public nsHTMLContainerFrame, public nsIMathMLFrame {
public:
// nsIMathMLFrame methods
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
NS_IMETHOD Stretch(nsIPresContext& aPresContext,
nsStretchDirection aStretchDirection,
nsCharMetrics& aContainerSize,
nsCharMetrics& aDesiredStretchSize);
NS_IMETHOD
GetPresentationData(PRInt32* aScriptLevel,
PRBool* aDisplayStyle);
NS_IMETHOD
UpdatePresentationData(PRInt32 aScriptLevelIncrement,
PRBool aDisplayStyle);
NS_IMETHOD
UpdatePresentationDataFromChildAt(PRInt32 aIndex,
PRInt32 aScriptLevelIncrement,
PRBool aDisplayStyle);
// nsHTMLContainerFrame methods
NS_IMETHOD
Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD
Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD
ReResolveStyleContext(nsIPresContext* aPresContext,
nsIStyleContext* aParentContext,
PRInt32 aParentChange,
nsStyleChangeList* aChangeList,
PRInt32* aLocalChange);
// helper methods for processing empty MathML frames (with whitespace only)
static PRBool
IsOnlyWhitespace(nsIFrame* aFrame);
static void
ReflowEmptyChild(nsIFrame* aFrame);
protected:
PRInt32 mScriptLevel; // Only relevant to nested frames within: msub, msup, msubsup,
// munder, mover, munderover, mmultiscripts, mfrac, mroot, mtable.
PRBool mDisplayStyle; // displaystyle="false" is intended to slightly alter how the
// rendering in done in inline mode.
virtual PRIntn GetSkipSides() const { return 0; }
};
#endif /* nsMathMLContainerFrame_h___ */

Просмотреть файл

@ -0,0 +1,46 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
*/
#ifndef nsMathMLParts_h___
#define nsMathMLParts_h___
#include "nscore.h"
#include "nsISupports.h"
// Factory methods for creating MathML objects
extern nsresult NS_NewMathMLmrowFrame ( nsIFrame** aNewFrame );
extern nsresult NS_NewMathMLmiFrame ( nsIFrame** aNewFrame );
extern nsresult NS_NewMathMLmoFrame ( nsIFrame** aNewFrame );
extern nsresult NS_NewMathMLmphantomFrame ( nsIFrame** aNewFrame );
extern nsresult NS_NewMathMLmpaddedFrame ( nsIFrame** aNewFrame );
extern nsresult NS_NewMathMLmfencedFrame ( nsIFrame** aNewFrame );
extern nsresult NS_NewMathMLmfracFrame ( nsIFrame** aNewFrame );
extern nsresult NS_NewMathMLmsubFrame ( nsIFrame** aNewFrame );
extern nsresult NS_NewMathMLmsupFrame ( nsIFrame** aNewFrame );
extern nsresult NS_NewMathMLmsubsupFrame ( nsIFrame** aNewFrame );
extern nsresult NS_NewMathMLmunderFrame ( nsIFrame** aNewFrame );
extern nsresult NS_NewMathMLmoverFrame ( nsIFrame** aNewFrame );
extern nsresult NS_NewMathMLmunderoverFrame ( nsIFrame** aNewFrame );
extern nsresult NS_NewMathMLmmultiscriptsFrame ( nsIFrame** aNewFrame );
extern nsresult NS_NewMathMLmstyleFrame ( nsIFrame** aNewFrame );
extern nsresult NS_NewMathMLmtdFrame ( nsIFrame** aNewFrame );
#endif /* nsMathMLParts_h___ */

Просмотреть файл

@ -0,0 +1,93 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#include "nsCOMPtr.h"
#include "nsHTMLParts.h"
#include "nsIHTMLContent.h"
#include "nsFrame.h"
#include "nsLineLayout.h"
#include "nsHTMLIIDs.h"
#include "nsIPresContext.h"
#include "nsHTMLAtoms.h"
#include "nsUnitConversion.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsINameSpaceManager.h"
#include "nsIRenderingContext.h"
#include "nsIFontMetrics.h"
#include "nsStyleUtil.h"
#include "nsMathMLAtoms.h"
#include "nsMathMLParts.h"
#include "nsMathMLmfencedFrame.h"
//
// <mfenced> -- surround content with a pair of fences
//
nsresult
NS_NewMathMLmfencedFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmfencedFrame* it = new nsMathMLmfencedFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
nsMathMLmfencedFrame::nsMathMLmfencedFrame()
{
}
nsMathMLmfencedFrame::~nsMathMLmfencedFrame()
{
}
NS_IMETHODIMP
nsMathMLmfencedFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv = nsMathMLContainerFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
// Write me...
return rv;
}
/*
NS_METHOD
nsMathMLmfencedFrame::Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer)
{
return NS_OK;
}
*/

Просмотреть файл

@ -0,0 +1,57 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#ifndef nsMathMLmfencedFrame_h___
#define nsMathMLmfencedFrame_h___
#include "nsCOMPtr.h"
#include "nsMathMLContainerFrame.h"
//
// <mfenced> -- surround content with a pair of fences
//
class nsMathMLmfencedFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmfencedFrame(nsIFrame** aNewFrame);
NS_IMETHOD
Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
/*
NS_IMETHOD Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
*/
protected:
nsMathMLmfencedFrame();
virtual ~nsMathMLmfencedFrame();
virtual PRIntn GetSkipSides() const { return 0; }
};
#endif /* nsMathMLmfencedFrame_h___ */

Просмотреть файл

@ -0,0 +1,253 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#include "nsCOMPtr.h"
#include "nsHTMLParts.h"
#include "nsIHTMLContent.h"
#include "nsFrame.h"
#include "nsLineLayout.h"
#include "nsHTMLIIDs.h"
#include "nsIPresContext.h"
#include "nsHTMLAtoms.h"
#include "nsUnitConversion.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsINameSpaceManager.h"
#include "nsIRenderingContext.h"
#include "nsIFontMetrics.h"
#include "nsStyleUtil.h"
#include "nsMathMLAtoms.h"
#include "nsMathMLParts.h"
#include "nsMathMLmfracFrame.h"
//
// <mfrac> -- form a fraction from two subexpressions - implementation
//
nsresult
NS_NewMathMLmfracFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmfracFrame* it = new nsMathMLmfracFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
nsMathMLmfracFrame::nsMathMLmfracFrame()
{
}
nsMathMLmfracFrame::~nsMathMLmfracFrame()
{
}
NS_IMETHODIMP
nsMathMLmfracFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv = NS_OK;
rv = nsMathMLContainerFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
if (NS_FAILED(rv)) {
return rv;
}
nscoord aLineThickness = DEFAULT_FRACTION_LINE_THICKNESS;
nsAutoString value;
// see if the linethickness attribute is there
if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None,
nsMathMLAtoms::linethickness, value))
{
if (value == "thin")
aLineThickness = THIN_FRACTION_LINE_THICKNESS;
else if (value == "medium")
aLineThickness = MEDIUM_FRACTION_LINE_THICKNESS;
else if (value == "thick")
aLineThickness = THICK_FRACTION_LINE_THICKNESS;
else {
PRInt32 aErrorCode;
PRInt32 aMultiplier = value.ToInteger(&aErrorCode);
if (NS_SUCCEEDED(aErrorCode))
aLineThickness = aMultiplier * DEFAULT_FRACTION_LINE_THICKNESS;
else {
// XXX TODO: try to see if it is a h/v-unit like 1ex, 2px, 1em
// see also nsUnitConversion.h
}
}
}
// mLineThickness = (aLineThickness > MAX_FRACTION_LINE_THICKNESS) ?
// MAX_FRACTION_LINE_THICKNESS : aLineThickness;
mLineThickness = aLineThickness;
mLineOrigin.x = 0;
mLineOrigin.y = 0;
// TODO: other attributes like displaystyle...
return rv;
}
NS_IMETHODIMP
nsMathMLmfracFrame::Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer)
{
nsresult rv = NS_OK;
if (NS_FRAME_PAINT_LAYER_FOREGROUND != aWhichLayer) {
return rv;
}
/////////////
// paint the numerator and denominator
rv = nsMathMLContainerFrame::Paint(aPresContext, aRenderingContext,
aDirtyRect, aWhichLayer);
////////////
// paint the fraction line
if (NS_SUCCEEDED(rv) && 0 < mLineThickness) {
float p2t;
aPresContext.GetScaledPixelsToTwips(&p2t);
nscoord thickness = NSIntPixelsToTwips(mLineThickness, p2t);
/*
// line looking like <hr noshade>
const nsStyleColor* color;
nscolor colors[2];
color = nsStyleUtil::FindNonTransparentBackground(mStyleContext);
NS_Get3DColors(colors, color->mBackgroundColor);
aRenderingContext.SetColor(colors[0]);
*/
// solid line with the current text color
const nsStyleColor* color =
(const nsStyleColor*)mStyleContext->GetStyleData(eStyleStruct_Color);
aRenderingContext.SetColor(color->mColor);
// draw the line
aRenderingContext.FillRect(mLineOrigin.x, mLineOrigin.y, mRect.width, thickness);
}
return rv;
}
NS_IMETHODIMP
nsMathMLmfracFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
nsresult rv = NS_OK;
nsReflowStatus childStatus;
nsHTMLReflowMetrics childDesiredSize(aDesiredSize.maxElementSize);
nsSize availSize(aReflowState.mComputedWidth, aReflowState.mComputedHeight);
//////////////////
// Reflow Children
nscoord count = 0;
nsRect rect[2];
nsIFrame* child[2];
nsIFrame* childFrame = mFrames.FirstChild();
while (nsnull != childFrame)
{
//////////////
// WHITESPACE: don't forget that whitespace doesn't count in MathML!
if (IsOnlyWhitespace(childFrame)) {
childFrame->SetRect(nsRect(0,0,0,0));
}
else if (2 > count) {
nsHTMLReflowState childReflowState(aPresContext, aReflowState, childFrame, availSize);
rv = ReflowChild(childFrame, aPresContext, childDesiredSize, childReflowState, childStatus);
NS_ASSERTION(NS_FRAME_IS_COMPLETE(childStatus), "bad status");
if (NS_FAILED(rv)) {
return rv;
}
child[count] = childFrame;
rect[count].width = childDesiredSize.width;
rect[count].height = childDesiredSize.height;
count++;
}
// else { invalid markup... }
rv = childFrame->GetNextSibling(&childFrame);
NS_ASSERTION(NS_SUCCEEDED(rv),"failed to get next child");
}
//////////////////
// Place Children
// Get the <strike> line and center the fraction bar with the <strike> line.
nscoord strikeOffset, strikeThickness;
nsCOMPtr<nsIFontMetrics> fm;
const nsStyleFont* aFont =
(const nsStyleFont*)mStyleContext->GetStyleData(eStyleStruct_Font);
aPresContext.GetMetricsFor(aFont->mFont, getter_AddRefs(fm));
fm->GetStrikeout(strikeOffset, strikeThickness);
// Take care of mLineThickness
float p2t;
nscoord Thickspace, halfThickspace;
aPresContext.GetScaledPixelsToTwips(&p2t);
if (mLineThickness <= 1) {
Thickspace = 0;
halfThickspace = 0;
}
else {
Thickspace = NSIntPixelsToTwips(mLineThickness-1, p2t);
halfThickspace = Thickspace/2; // distance from the middle of the axis
}
aDesiredSize.width = PR_MAX(rect[0].width, rect[1].width);
aDesiredSize.ascent = rect[0].height + strikeOffset + halfThickspace;
aDesiredSize.descent = rect[1].height - strikeOffset + halfThickspace;
aDesiredSize.height = aDesiredSize.ascent + aDesiredSize.descent;
rect[0].x = (aDesiredSize.width - rect[0].width) / 2; // center w.r.t largest width
rect[1].x = (aDesiredSize.width - rect[1].width) / 2;
rect[0].y = 0;
rect[1].y = aDesiredSize.height - rect[1].height;
child[0]->SetRect(rect[0]);
child[1]->SetRect(rect[1]);
SetLineOrigin(nsPoint(0,rect[0].height)); // position the fraction bar
if (nsnull != aDesiredSize.maxElementSize) {
aDesiredSize.maxElementSize->width = aDesiredSize.width;
aDesiredSize.maxElementSize->height = aDesiredSize.height;
}
aStatus = NS_FRAME_COMPLETE;
return NS_OK;
}

Просмотреть файл

@ -0,0 +1,158 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#ifndef nsMathMLmfracFrame_h___
#define nsMathMLmfracFrame_h___
#include "nsCOMPtr.h"
#include "nsMathMLContainerFrame.h"
//
// <mfrac> -- form a fraction from two subexpressions
//
/*
The MathML REC describes:
The <mfrac> element is used for fractions. It can also be used to mark up
fraction-like objects such as binomial coefficients and Legendre symbols.
The syntax for <mfrac> is:
<mfrac> numerator denominator </mfrac>
Attributes of <mfrac>:
Name values default
linethickness number [ v-unit ] | thin | medium | thick 1
E.g.,
linethickness=2 actually means that linethickness=2*DEFAULT_THICKNESS
(DEFAULT_THICKNESS is not specified by MathML, see below.)
The linethickness attribute indicates the thickness of the horizontal
"fraction bar", or "rule", typically used to render fractions. A fraction
with linethickness="0" renders without the bar, and might be used within
binomial coefficients. A linethickness greater than one might be used with
nested fractions. These cases are shown below:
In general, the value of linethickness can be a number, as a multiplier
of the default thickness of the fraction bar (the default thickness is
not specified by MathML), or a number with a unit of vertical length (see
Section 2.3.3), or one of the keywords medium (same as 1), thin (thinner
than 1, otherwise up to the renderer), or thick (thicker than 1, otherwise
up to the renderer).
The <mfrac> element sets displaystyle to "false", or if it was already
false increments scriptlevel by 1, within numerator and denominator.
These attributes are inherited by every element from its rendering
environment, but can be set explicitly only on the <mstyle>
element. (See Section 3.3.4.)
*/
/*
TODO:
- Take care of displaystyle=true|false and inheritered <mstyle>
Before reflow, <mfrac> should change the font-size of the children with scriptlevel<=2
How to do it? From the DOM interface?
From direct CSS manipulation? In nsCSSStyleRule, there is
nsCSSFont* ourFont;
if (NS_OK == aDeclaration->GetData(kCSSFontSID, (nsCSSStruct**)&ourFont))
- CalcLength(..) in nsCSSStyleRule.cpp is where CSS units are implemented.
How to use that for linethickness and, in general, how to factor the use
of units in the MathML world?
ID Description
em ems (font-relative unit traditionally used for horizontal lengths)
ex exs (font-relative unit traditionally used for vertical lengths)
px pixels, or pixel size of a "typical computer display"
in inches (1 inch = 2.54 centimeters)
cm centimeters
mm millimeters
pt points (1 point = 1/72 inch)
pc picas (1 pica = 12 points)
% percentage of default value
*/
// default fraction line thickness in pixels
#define DEFAULT_FRACTION_LINE_THICKNESS 1
#define THIN_FRACTION_LINE_THICKNESS 1
#define MEDIUM_FRACTION_LINE_THICKNESS 2
#define THICK_FRACTION_LINE_THICKNESS 4
// use an upper bound just in case someone set a too high value? why bother?
// #define MAX_FRACTION_LINE_THICKNESS 5
class nsMathMLmfracFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmfracFrame(nsIFrame** aNewFrame);
NS_IMETHOD
Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD
Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD
Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
NS_IMETHOD
SetInitialChildList(nsIPresContext& aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv;
rv = nsMathMLContainerFrame::SetInitialChildList(aPresContext, aListName, aChildList);
UpdatePresentationDataFromChildAt(0, 1, PR_FALSE);
ReResolveStyleContext(&aPresContext, mStyleContext, NS_STYLE_HINT_REFLOW, nsnull, nsnull);
return rv;
}
void
SetLineThickness(const nscoord aLineThickness) {
mLineThickness = aLineThickness;
}
void
SetLineOrigin(const nsPoint& aOrigin) {
mLineOrigin = aOrigin;
}
protected:
nsMathMLmfracFrame();
virtual ~nsMathMLmfracFrame();
virtual PRIntn GetSkipSides() const { return 0; }
nsPoint mLineOrigin;
nscoord mLineThickness;
};
#endif /* nsMathMLmfracFrame_h___ */

Просмотреть файл

@ -0,0 +1,148 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the The Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#include "nsCOMPtr.h"
#include "nsHTMLParts.h"
#include "nsIHTMLContent.h"
#include "nsFrame.h"
#include "nsLineLayout.h"
#include "nsHTMLIIDs.h"
#include "nsIPresContext.h"
#include "nsHTMLAtoms.h"
#include "nsUnitConversion.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsStyleChangeList.h"
#include "nsINameSpaceManager.h"
#include "nsIRenderingContext.h"
#include "nsIFontMetrics.h"
#include "nsStyleUtil.h"
#include "nsIDOMText.h"
#include "nsITextContent.h"
#include "nsMathMLAtoms.h"
#include "nsMathMLParts.h"
#include "nsMathMLmiFrame.h"
//
// <mi> -- identifier - implementation
//
nsresult
NS_NewMathMLmiFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmiFrame* it = new nsMathMLmiFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
nsMathMLmiFrame::nsMathMLmiFrame()
{
}
nsMathMLmiFrame::~nsMathMLmiFrame()
{
}
NS_IMETHODIMP
nsMathMLmiFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv = NS_OK;
rv = nsMathMLContainerFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
return rv;
}
// if our content is not a single character, we turn the font style to normal.
// XXX TrimWhitespace / CompressWhitespace?
NS_IMETHODIMP
nsMathMLmiFrame::ReResolveStyleContext(nsIPresContext* aPresContext,
nsIStyleContext* aParentContext,
PRInt32 aParentChange,
nsStyleChangeList* aChangeList,
PRInt32* aLocalChange)
{
// our content can include comment-nodes, attribute-nodes, text-nodes...
// we use to DOM to make sure that we are only looking at text-nodes...
PRInt32 aLength = 0;
PRInt32 numKids;
mContent->ChildCount(numKids);
// nsAutoString aData;
for (PRInt32 kid=0; kid<numKids; kid++) {
nsCOMPtr<nsIContent> kidContent;
mContent->ChildAt(kid, *getter_AddRefs(kidContent));
if (kidContent.get()) {
nsCOMPtr<nsIDOMText> kidText(do_QueryInterface(kidContent));
if (kidText.get()) {
PRUint32 kidLength;
kidText->GetLength(&kidLength);
aLength += kidLength;
// nsAutoString kidData;
// kidText->GetData(kidData);
// aData += kidData;
}
}
}
// re calculate our own style context
PRInt32 ourChange = aParentChange;
nsresult rv = nsFrame::ReResolveStyleContext(aPresContext, aParentContext,
ourChange, aChangeList, &ourChange);
if (NS_FAILED(rv)) {
return rv;
}
if (aLocalChange) {
*aLocalChange = ourChange;
}
// get a pseudo style context for the normal style font
nsCOMPtr<nsIAtom> fontAtom(getter_AddRefs(NS_NewAtom(":-moz-math-font-style-normal")));
nsIStyleContext* newStyleContext;
aPresContext->ResolvePseudoStyleContextFor(mContent, fontAtom, mStyleContext,
PR_FALSE, &newStyleContext);
// re-resolve children
PRInt32 childChange;
nsIFrame* child = mFrames.FirstChild();
while (nsnull != child && NS_SUCCEEDED(rv)) {
if (!IsOnlyWhitespace(child)) {
rv = child->ReResolveStyleContext(aPresContext,
(1 == aLength)? mStyleContext : newStyleContext,
ourChange, aChangeList, &childChange);
}
child->GetNextSibling(&child);
}
return rv;
}

Просмотреть файл

@ -0,0 +1,69 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#ifndef nsMathMLmiFrame_h___
#define nsMathMLmiFrame_h___
#include "nsCOMPtr.h"
#include "nsMathMLContainerFrame.h"
//
// <mi> -- identifier
//
class nsMathMLmiFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmiFrame(nsIFrame** aNewFrame);
NS_IMETHOD
Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD
ReResolveStyleContext(nsIPresContext* aPresContext,
nsIStyleContext* aParentContext,
PRInt32 aParentChange,
nsStyleChangeList* aChangeList,
PRInt32* aLocalChange);
NS_IMETHOD
SetInitialChildList(nsIPresContext& aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv;
rv = nsMathMLContainerFrame::SetInitialChildList(aPresContext, aListName, aChildList);
ReResolveStyleContext(&aPresContext, mStyleContext, NS_STYLE_HINT_REFLOW, nsnull, nsnull);
return rv;
}
protected:
nsMathMLmiFrame();
virtual ~nsMathMLmiFrame();
virtual PRIntn GetSkipSides() const { return 0; }
};
#endif /* nsMathMLmiFrame_h___ */

Просмотреть файл

@ -0,0 +1,240 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#include "nsCOMPtr.h"
#include "nsHTMLParts.h"
#include "nsIHTMLContent.h"
#include "nsFrame.h"
#include "nsLineLayout.h"
#include "nsHTMLIIDs.h"
#include "nsIPresContext.h"
#include "nsHTMLAtoms.h"
#include "nsUnitConversion.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsINameSpaceManager.h"
#include "nsIRenderingContext.h"
#include "nsIFontMetrics.h"
#include "nsStyleUtil.h"
#include "nsMathMLAtoms.h"
#include "nsMathMLParts.h"
#include "nsMathMLmmultiscriptsFrame.h"
//
// <mmultiscripts> -- attach prescripts and tensor indices to a base - implementation
//
nsresult
NS_NewMathMLmmultiscriptsFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmmultiscriptsFrame* it = new nsMathMLmmultiscriptsFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
nsMathMLmmultiscriptsFrame::nsMathMLmmultiscriptsFrame()
{
}
nsMathMLmmultiscriptsFrame::~nsMathMLmmultiscriptsFrame()
{
}
NS_IMETHODIMP
nsMathMLmmultiscriptsFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
nsresult rv = NS_OK;
nsReflowStatus childStatus;
nsHTMLReflowMetrics childDesiredSize(aDesiredSize.maxElementSize);
nsSize availSize(aReflowState.mComputedWidth, aReflowState.mComputedHeight);
//////////////////
// Reflow Children
nsIFrame* mprescriptsFrame = nsnull; // frame of <mprescripts/>, if there.
PRBool isSubscript = PR_FALSE;
nscoord ascent, descent, width, height;
nscoord subsupWidth, subHeight, supHeight, subDescent, supAscent;
nscoord count = 0;
nsIFrame* baseFrame = nsnull;
nsIFrame* childFrame = mFrames.FirstChild();
while (nsnull != childFrame)
{
//////////////
// WHITESPACE: don't forget that whitespace doesn't count in MathML!
if (IsOnlyWhitespace(childFrame)) {
ReflowEmptyChild(childFrame);
}
else {
nsCOMPtr<nsIContent> childContent;
nsCOMPtr<nsIAtom> childTag;
childFrame->GetContent(getter_AddRefs(childContent));
childContent->GetTag(*getter_AddRefs(childTag));
if (childTag == nsMathMLAtoms::mprescripts) {
// NS_ASSERTION(mprescriptsFrame == nsnull,"duplicate <mprescripts/>");
//printf("mprescripts Found ...\n"); // should ignore?
mprescriptsFrame = childFrame;
}
else if (childTag == nsMathMLAtoms::none) {
childDesiredSize.height = 0;
childDesiredSize.width = 0;
childDesiredSize.ascent = 0;
childDesiredSize.descent = 0;
}
else {
//printf("child count: %d...\n", count);
nsHTMLReflowState childReflowState(aPresContext, aReflowState,
childFrame, availSize);
rv = ReflowChild(childFrame, aPresContext, childDesiredSize,
childReflowState, childStatus);
NS_ASSERTION(NS_FRAME_IS_COMPLETE(childStatus), "bad status");
if (NS_FAILED(rv)) {
return rv;
}
if (0 == count) {
baseFrame = childFrame;
ascent = childDesiredSize.ascent;
descent = childDesiredSize.descent;
height = childDesiredSize.height;
subsupWidth = childDesiredSize.width;
subHeight = supHeight = height;
supAscent = ascent;
subDescent = descent;
}
else {
if (isSubscript) {
subDescent = PR_MAX(subDescent, childDesiredSize.descent);
subHeight = PR_MAX(subHeight, childDesiredSize.height);
width = childDesiredSize.width;
}
else {
supAscent = PR_MAX(supAscent, childDesiredSize.ascent);
supHeight = PR_MAX(supHeight, childDesiredSize.height);
width = PR_MAX(width, childDesiredSize.width);
subsupWidth += width;
}
}
// At this stage, the origin points of the children have no use, so we will use the
// origins to store the child's ascent and descent. At the next pass, we should
// set the origins so as to overwrite what we are storing there now
childFrame->SetRect(nsRect(childDesiredSize.descent, childDesiredSize.ascent,
childDesiredSize.width, childDesiredSize.height));
isSubscript = !isSubscript;
count++;
}
}
rv = childFrame->GetNextSibling(&childFrame);
NS_ASSERTION(NS_SUCCEEDED(rv),"failed to get next child");
}
//////////////////
// Place Children
// Get the subscript and superscript offsets
nscoord subscriptOffset, superscriptOffset, leading;
nsCOMPtr<nsIFontMetrics> fm;
const nsStyleFont* aFont =
(const nsStyleFont*)mStyleContext->GetStyleData(eStyleStruct_Font);
aPresContext.GetMetricsFor(aFont->mFont, getter_AddRefs(fm));
fm->GetSubscriptOffset(subscriptOffset);
fm->GetSuperscriptOffset(superscriptOffset);
fm->GetLeading(leading);
subHeight = PR_MAX(height, subHeight) + subscriptOffset + leading;
supHeight = PR_MAX(height, supHeight) + superscriptOffset;
aDesiredSize.descent = subHeight - ascent;
aDesiredSize.ascent = supHeight - descent;
aDesiredSize.height = aDesiredSize.descent + aDesiredSize.ascent;
aDesiredSize.width = subsupWidth;
// Place prescripts, followed by base, and then postscripts.
// The list of frames is in the order: {base} {postscripts} {prescripts}
// We go over the list in a circular manner, starting at <prescripts/>
nscoord offset = 0;
nsIFrame* child[2];
nsRect rect[2];
count = 0;
childFrame = mprescriptsFrame;
do {
if (nsnull == childFrame) { // end of prescripts,
//printf("Placing the base ...\n");
childFrame = baseFrame; // place the base
childFrame->GetRect(rect[0]);
rect[0].x = offset;
rect[0].y = aDesiredSize.height - subHeight;
childFrame->SetRect(rect[0]);
offset += rect[0].width;
}
else if (mprescriptsFrame != childFrame) {
//////////////
// WHITESPACE: whitespace doesn't count. Iteration over non empty frames
if (!IsOnlyWhitespace(childFrame)) {
child[count++] = childFrame;
if (2 == count) { // place a sub-sup pair
count = 0;
//printf("Placing the sub-sup pair...\n");
child[0]->GetRect(rect[0]);
child[1]->GetRect(rect[1]);
rect[0].y = aDesiredSize.height - (subDescent + rect[0].y);
rect[1].y = supAscent - rect[1].y;
width = PR_MAX(rect[0].width, rect[1].width);
rect[0].x = offset + (width - rect[0].width) / 2; // centering
rect[1].x = offset + (width - rect[1].width) / 2;
child[0]->SetRect(rect[0]);
child[1]->SetRect(rect[1]);
offset += width;
}
}
}
rv = childFrame->GetNextSibling(&childFrame);
NS_ASSERTION(NS_SUCCEEDED(rv),"failed to get next child");
} while (mprescriptsFrame != childFrame);
if (nsnull != aDesiredSize.maxElementSize) {
aDesiredSize.maxElementSize->width = aDesiredSize.width;
aDesiredSize.maxElementSize->height = aDesiredSize.height;
}
aStatus = NS_FRAME_COMPLETE;
return rv;
}

Просмотреть файл

@ -0,0 +1,62 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#ifndef nsMathMLmmultiscriptsFrame_h___
#define nsMathMLmmultiscriptsFrame_h___
#include "nsCOMPtr.h"
#include "nsMathMLContainerFrame.h"
//
// <mmultiscripts> -- attach prescripts and tensor indices to a base
//
class nsMathMLmmultiscriptsFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmmultiscriptsFrame(nsIFrame** aNewFrame);
NS_IMETHOD
Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD
SetInitialChildList(nsIPresContext& aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv;
rv = nsMathMLContainerFrame::SetInitialChildList(aPresContext, aListName, aChildList);
UpdatePresentationDataFromChildAt(1, 1, PR_FALSE);
ReResolveStyleContext(&aPresContext, mStyleContext, NS_STYLE_HINT_REFLOW, nsnull, nsnull);
return rv;
}
protected:
nsMathMLmmultiscriptsFrame();
virtual ~nsMathMLmmultiscriptsFrame();
virtual PRIntn GetSkipSides() const { return 0; }
};
#endif /* nsMathMLmmultiscriptsFrame_h___ */

Просмотреть файл

@ -0,0 +1,348 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#include "nsCOMPtr.h"
#include "nsHTMLParts.h"
#include "nsIHTMLContent.h"
#include "nsFrame.h"
#include "nsLineLayout.h"
#include "nsHTMLIIDs.h"
#include "nsIPresContext.h"
#include "nsHTMLAtoms.h"
#include "nsUnitConversion.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsINameSpaceManager.h"
#include "nsIRenderingContext.h"
#include "nsIFontMetrics.h"
#include "nsStyleUtil.h"
#include "nsIDOMText.h"
#include "nsMathMLAtoms.h"
#include "nsMathMLParts.h"
#include "nsMathMLChar.h"
#include "nsMathMLOperators.h"
#include "nsMathMLmoFrame.h"
//
// <mo> -- operator, fence, or separator - implementation
//
// TODO:
// * Handle embellished operators
// See the section "Exception for embellished operators"
// in http://www.w3.org/TR/REC-MathML/chap3_2.html
//
// * For a markup <mo>content</mo>, if "content" is not found in
// the operator dictionary, the REC sets default attributes :
// fence = false
// separator = false
// lspace = .27777em
// rspace = .27777em
// stretchy = false
// symmetric = true
// maxsize = infinity
// minsize = 1
// largeop = false
// movablelimits = false
// accent = false
//
// We only have to handle *lspace* and *rspace*, perhaps via a CSS padding rule
// in mathml.css, and override the rule if the content is found?
//
// * The spacing is wrong in certain situations, e.g.// <mrow> <mo>&ForAll;</mo> <mo>+</mo></mrow>
//
// The REC tells more about lspace and rspace attributes:
//
// The values for lspace and rspace given here range from 0 to 6/18 em in
// units of 1/18 em. For the invisible operators whose content is
// "&InvisibleTimes;" or "&ApplyFunction;", it is suggested that MathML
// renderers choose spacing in a context-sensitive way (which is an exception to
// the static values given in the following table). For <mo>&ApplyFunction;</mo>,
// the total spacing (lspace + rspace) in expressions such as "sin x"
// (where the right operand doesn't start with a fence) should be greater
// than 0; for <mo>&InvisibleTimes;</mo>, the total spacing should be greater
// than 0 when both operands (or the nearest tokens on either side, if on
// the baseline) are identifiers displayed in a non-slanted font (i.e., under
// the suggested rules, when both operands are multi-character identifiers).
nsresult
NS_NewMathMLmoFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmoFrame* it = new nsMathMLmoFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
nsMathMLmoFrame::nsMathMLmoFrame()
{
}
nsMathMLmoFrame::~nsMathMLmoFrame()
{
}
NS_IMETHODIMP
nsMathMLmoFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv = NS_OK;
rv = nsMathMLContainerFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
if (NS_FAILED(rv)) {
return rv;
}
// candidly assume we are an operator until proven false -- see Stretch()
mOperator = PR_TRUE;
// record that the MathChar doesn't know anything yet
mMathMLChar.SetLength(-1);
// mMathMLChar.Init(this, -1, 0, 0, 0.0f, 0.0f, 0);
return rv;
}
NS_IMETHODIMP
nsMathMLmoFrame::Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer)
{
nsresult rv = NS_OK;
if (NS_FRAME_PAINT_LAYER_FOREGROUND != aWhichLayer)
return rv;
if (mOperator && 0 < mMathMLChar.GetLength()) {
//printf("Doing the painting with mMathMLChar\n");
rv = mMathMLChar.Paint(aPresContext,
aRenderingContext,
mStyleContext,
nsRect(0,0,mRect.width,mRect.height));
}
else { // let the base class worry about the painting
//printf("Doing the painting with nsMathMLContainerFrame\n");
rv = nsMathMLContainerFrame::Paint(aPresContext,
aRenderingContext,
aDirtyRect,
aWhichLayer);
}
return rv;
}
#if 0
void DEBUG_PrintString(const nsString aString) {
#if 0
PRUnichar* pc = (PRUnichar*)(const PRUnichar*)aString.GetUnicode();
while (*pc) {
if (*pc < 0x00FF)
printf("%c", char(*pc++));
else
printf("[%04x]", *pc++);
}
#endif
PRInt32 i;
for (i = 0; i<aString.Length(); i++) {
PRUnichar ch = aString.CharAt(i);
if (nsString::IsAlpha(ch) || nsString::IsDigit(ch) || ch == ' ')
printf("%c", char(ch));
else
printf("[0x%04X]", ch);
}
}
#endif
// NOTE: aDesiredStretchSize is an IN/OUT parameter
// On input - it contains our current size
// On output - the same size or the new size that we want
NS_IMETHODIMP
nsMathMLmoFrame::Stretch(nsIPresContext& aPresContext,
nsStretchDirection aStretchDirection,
nsCharMetrics& aContainerSize,
nsCharMetrics& aDesiredStretchSize)
{
nsresult rv = NS_OK;
if (!mOperator) // don't wander here if we are not an operator
return NS_OK; // XXX Need to set default values for lspace and rspace
// find the text that we enclose if it is the first time we come here
PRInt32 aLength = mMathMLChar.GetLength();
if (0 > aLength) { // this means it is the very first time we have been here.
// we will not be going over all this again when the
// window is repainted (resize, scroll).
// if we exit prematurely from now on, we are surely not an operator
mOperator = PR_FALSE;
// get the text that we enclose. XXX TrimWhitespace?
nsAutoString aData;
// PRInt32 aLength = 0;
// kids can be comment-nodes, attribute-nodes, text-nodes...
// we use to DOM to ensure that we only look at text-nodes...
PRInt32 numKids;
mContent->ChildCount(numKids);
for (PRInt32 kid=0; kid<numKids; kid++) {
nsCOMPtr<nsIContent> kidContent;
mContent->ChildAt(kid, *getter_AddRefs(kidContent));
if (kidContent.get()) {
nsCOMPtr<nsIDOMText> kidText(do_QueryInterface(kidContent));
if (kidText.get()) {
// PRUint32 kidLength;
// kidText->GetLength(&kidLength);
// aLength += kidLength;
nsAutoString kidData;
kidText->GetData(kidData);
aData += kidData;
}
}
}
// Look at our position from our parent (frames are singly-linked together).
//////////////
// WHITESPACE: don't forget that whitespace doesn't count in MathML!
// Here is the situation: we may have empty frames between us:
// [space*] [prev] [space*] [this] [space*] [next]
// We want to skip them...
// The problem looks like a regexp, we ask a little flag to help us.
PRInt32 state = 0;
nsIFrame* prev = nsnull;
nsIFrame* next = nsnull;
nsIFrame* aFrame;
mParent->FirstChild(nsnull, &aFrame);
while (nsnull != aFrame) {
if (aFrame == this) { // we start looking for next
state++;
}
else if (!IsOnlyWhitespace(aFrame)) {
if (0 == state) { // we are still looking for prev
prev = aFrame;
}
else if (1 == state) { // we got next
next = aFrame;
break; // we can exit the while loop
}
}
rv = aFrame->GetNextSibling(&aFrame);
NS_ASSERTION(NS_SUCCEEDED(rv),"failed to get next sibbling");
}
// set our form flag depending on our position
nsOperatorFlags aForm = NS_MATHML_OPERATOR_FORM_INFIX;
if (nsnull == prev && nsnull != next)
aForm = NS_MATHML_OPERATOR_FORM_PREFIX;
else if (nsnull != prev && nsnull == next)
aForm = NS_MATHML_OPERATOR_FORM_POSTFIX;
// Now that we know the text, we can lookup the operator dictionary to see if
// it was right to assume that this is an operator
// XXX aData.CompressWhitespace() ?
nsOperatorFlags aFlags;
float aLeftSpace, aRightSpace;
mOperator = nsMathMLOperators::LookupOperator(aData, aForm,
&aFlags, &aLeftSpace, &aRightSpace);
// If it doesn't exist in the the dictionary, stop now
if (!mOperator)
return NS_OK;
// XXX If we don't want extra space when we are a script
// if (mScriptLevel > 0) {
// aLeftSpace = aRightSpace = 0;
// }
// XXX Factor all this in nsMathMLAttributes.cpp
// Now see if there are user-defined attributes that override the dictionary.
// XXX If an attribute can be forced to be true when it is false in the
// dictionary, then the following code has to change...
// For each attribute disabled by the user, turn off its bit flag.
// movablelimits|separator|largeop|accent|fence|stretchy|form
nsAutoString kfalse("false");
nsAutoString value;
if (NS_MATHML_OPERATOR_IS_STRETCHY(aFlags)) {
if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None,
nsMathMLAtoms::stretchy, value) && value == kfalse)
aFlags &= ~NS_MATHML_OPERATOR_STRETCHY;
}
if (NS_MATHML_OPERATOR_IS_FENCE(aFlags)) {
if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None,
nsMathMLAtoms::fence, value) && value == kfalse)
aFlags &= ~NS_MATHML_OPERATOR_FENCE;
}
if (NS_MATHML_OPERATOR_IS_ACCENT(aFlags)) {
if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None,
nsMathMLAtoms::accent, value) && value == kfalse)
aFlags &= ~NS_MATHML_OPERATOR_ACCENT;
}
if (NS_MATHML_OPERATOR_IS_LARGEOP(aFlags)) {
if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None,
nsMathMLAtoms::largeop, value) && value == kfalse)
aFlags &= ~NS_MATHML_OPERATOR_LARGEOP;
}
if (NS_MATHML_OPERATOR_IS_SEPARATOR(aFlags)) {
if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None,
nsMathMLAtoms::separator, value) && value == kfalse)
aFlags &= ~NS_MATHML_OPERATOR_SEPARATOR;
}
if (NS_MATHML_OPERATOR_IS_MOVABLELIMITS(aFlags)) {
if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None,
nsMathMLAtoms::movablelimits, value) && value == kfalse)
aFlags &= ~NS_MATHML_OPERATOR_MOVABLELIMITS;
}
// TODO: add also lspace and rspace, minsize, maxsize later ...
// cache all what we have learnt about this operator
mMathMLChar.Init(this, aData.Length(), aData, aFlags,
aLeftSpace, aRightSpace, aStretchDirection);
}
// let the MathMLChar stretch itself...
mMathMLChar.Stretch(aPresContext, mStyleContext,
aContainerSize, aDesiredStretchSize);
return rv;
}

Просмотреть файл

@ -0,0 +1,69 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#ifndef nsMathMLmoFrame_h___
#define nsMathMLmoFrame_h___
#include "nsCOMPtr.h"
#include "nsMathMLContainerFrame.h"
#include "nsMathMLChar.h"
//
// <mo> -- operator, fence, or separator
//
class nsMathMLmoFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmoFrame(nsIFrame** aNewFrame);
NS_IMETHOD
Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD
Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
// This method is called by the parent frame to ask <mo>
// to stretch itself.
NS_IMETHOD
Stretch(nsIPresContext& aPresContext,
nsStretchDirection aStretchDirection,
nsCharMetrics& aContainerSize,
nsCharMetrics& aDesiredStretchSize);
protected:
nsMathMLmoFrame();
virtual ~nsMathMLmoFrame();
virtual PRIntn GetSkipSides() const { return 0; }
PRBool mOperator; // True if we are listed in the operator dictionary.
nsMathMLChar mMathMLChar; // Here is the MathChar that will deal with the operator.
};
#endif /* nsMathMLmoFrame_h___ */

Просмотреть файл

@ -0,0 +1,154 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#include "nsCOMPtr.h"
#include "nsHTMLParts.h"
#include "nsIHTMLContent.h"
#include "nsFrame.h"
#include "nsLineLayout.h"
#include "nsHTMLIIDs.h"
#include "nsIPresContext.h"
#include "nsHTMLAtoms.h"
#include "nsUnitConversion.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsINameSpaceManager.h"
#include "nsIRenderingContext.h"
#include "nsIFontMetrics.h"
#include "nsStyleUtil.h"
#include "nsMathMLAtoms.h"
#include "nsMathMLParts.h"
#include "nsMathMLmoverFrame.h"
//
// <mover> -- attach an overscript to a base - implementation
//
nsresult
NS_NewMathMLmoverFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmoverFrame* it = new nsMathMLmoverFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
nsMathMLmoverFrame::nsMathMLmoverFrame()
{
}
nsMathMLmoverFrame::~nsMathMLmoverFrame()
{
}
NS_IMETHODIMP
nsMathMLmoverFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
nsresult rv = NS_OK;
nsReflowStatus childStatus;
nsHTMLReflowMetrics childDesiredSize(aDesiredSize.maxElementSize);
nsSize availSize(aReflowState.mComputedWidth, aReflowState.mComputedHeight);
//////////////////
// Reflow Children
nscoord count = 0;
nsRect rect[2];
nsIFrame* child[2];
nsIFrame* childFrame = mFrames.FirstChild();
while (nsnull != childFrame)
{
//////////////
// WHITESPACE: don't forget that whitespace doesn't count in MathML!
if (IsOnlyWhitespace(childFrame)) {
ReflowEmptyChild(childFrame);
}
else if (2 > count) {
nsHTMLReflowState childReflowState(aPresContext, aReflowState,
childFrame, availSize);
rv = ReflowChild(childFrame, aPresContext, childDesiredSize,
childReflowState, childStatus);
NS_ASSERTION(NS_FRAME_IS_COMPLETE(childStatus), "bad status");
if (NS_FAILED(rv)) {
return rv;
}
child[count] = childFrame;
rect[count].width = childDesiredSize.width;
rect[count].height = childDesiredSize.height;
if (0 == count) {
aDesiredSize.ascent = childDesiredSize.ascent;
aDesiredSize.descent = childDesiredSize.descent;
}
count++;
}
// else { invalid markup... }
rv = childFrame->GetNextSibling(&childFrame);
NS_ASSERTION(NS_SUCCEEDED(rv),"failed to get next child");
}
//////////////////
// Place Children
aDesiredSize.ascent += rect[1].height;
aDesiredSize.width = PR_MAX(rect[0].width, rect[1].width);
aDesiredSize.height = aDesiredSize.ascent + aDesiredSize.descent;
rect[0].x = (aDesiredSize.width - rect[0].width) / 2; // center w.r.t largest width
rect[1].x = (aDesiredSize.width - rect[1].width) / 2;
rect[1].y = 0;
rect[0].y = rect[1].height;
//ignore the leading (line spacing) that is attached to the text
nscoord leading;
nsCOMPtr<nsIFontMetrics> fm;
const nsStyleFont* aFont =
(const nsStyleFont*)mStyleContext->GetStyleData(eStyleStruct_Font);
aPresContext.GetMetricsFor(aFont->mFont, getter_AddRefs(fm));
fm->GetLeading(leading);
aDesiredSize.height -= leading;
aDesiredSize.ascent -= leading;
rect[0].y -= leading;
//
child[0]->SetRect(rect[0]);
child[1]->SetRect(rect[1]);
if (nsnull != aDesiredSize.maxElementSize) {
aDesiredSize.maxElementSize->width = aDesiredSize.width;
aDesiredSize.maxElementSize->height = aDesiredSize.height;
}
aStatus = NS_FRAME_COMPLETE;
return NS_OK;
}

Просмотреть файл

@ -0,0 +1,63 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#ifndef nsMathMLmoverFrame_h___
#define nsMathMLmoverFrame_h___
#include "nsCOMPtr.h"
#include "nsMathMLContainerFrame.h"
//
// <mover> -- attach an overscript to a base
//
class nsMathMLmoverFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmoverFrame(nsIFrame** aNewFrame);
NS_IMETHOD
Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD
SetInitialChildList(nsIPresContext& aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv;
rv = nsMathMLContainerFrame::SetInitialChildList(aPresContext, aListName, aChildList);
UpdatePresentationDataFromChildAt(1, 1, PR_FALSE);
ReResolveStyleContext(&aPresContext, mStyleContext, NS_STYLE_HINT_REFLOW, nsnull, nsnull);
return rv;
}
protected:
nsMathMLmoverFrame();
virtual ~nsMathMLmoverFrame();
virtual PRIntn GetSkipSides() const { return 0; }
};
#endif /* nsMathMLmoverFrame_h___ */

Просмотреть файл

@ -0,0 +1,82 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#include "nsCOMPtr.h"
#include "nsHTMLParts.h"
#include "nsIHTMLContent.h"
#include "nsFrame.h"
#include "nsLineLayout.h"
#include "nsHTMLIIDs.h"
#include "nsIPresContext.h"
#include "nsHTMLAtoms.h"
#include "nsUnitConversion.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsINameSpaceManager.h"
#include "nsIRenderingContext.h"
#include "nsIFontMetrics.h"
#include "nsStyleUtil.h"
#include "nsMathMLAtoms.h"
#include "nsMathMLParts.h"
#include "nsMathMLmpaddedFrame.h"
//
// <mpadded> -- adjust space around content - implementation
//
nsresult
NS_NewMathMLmpaddedFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmpaddedFrame* it = new nsMathMLmpaddedFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
nsMathMLmpaddedFrame::nsMathMLmpaddedFrame()
{
}
nsMathMLmpaddedFrame::~nsMathMLmpaddedFrame()
{
}
NS_IMETHODIMP
nsMathMLmpaddedFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv = nsMathMLContainerFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
// TODO: process the attributes
return rv;
}

Просмотреть файл

@ -0,0 +1,51 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#ifndef nsMathMLmpaddedFrame_h___
#define nsMathMLmpaddedFrame_h___
#include "nsCOMPtr.h"
#include "nsMathMLContainerFrame.h"
//
// <mpadded> -- adjust space around content
//
class nsMathMLmpaddedFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmpaddedFrame(nsIFrame** aNewFrame);
NS_IMETHOD
Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
protected:
nsMathMLmpaddedFrame();
virtual ~nsMathMLmpaddedFrame();
virtual PRIntn GetSkipSides() const { return 0; }
};
#endif /* nsMathMLmpaddedFrame_h___ */

Просмотреть файл

@ -0,0 +1,79 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#include "nsCOMPtr.h"
#include "nsHTMLParts.h"
#include "nsIHTMLContent.h"
#include "nsFrame.h"
#include "nsLineLayout.h"
#include "nsHTMLIIDs.h"
#include "nsIPresContext.h"
#include "nsHTMLAtoms.h"
#include "nsUnitConversion.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsINameSpaceManager.h"
#include "nsIRenderingContext.h"
#include "nsIFontMetrics.h"
#include "nsStyleUtil.h"
#include "nsMathMLAtoms.h"
#include "nsMathMLParts.h"
#include "nsMathMLmphantomFrame.h"
//
// <mphantom> -- make content invisible but preserve its size
//
nsresult
NS_NewMathMLmphantomFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmphantomFrame* it = new nsMathMLmphantomFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
nsMathMLmphantomFrame::nsMathMLmphantomFrame()
{
}
nsMathMLmphantomFrame::~nsMathMLmphantomFrame()
{
}
NS_METHOD
nsMathMLmphantomFrame::Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer)
{
// do nothing, this is not a bug.
return NS_OK;
}

Просмотреть файл

@ -0,0 +1,50 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#ifndef nsMathMLmphantomFrame_h___
#define nsMathMLmphantomFrame_h___
#include "nsCOMPtr.h"
#include "nsMathMLContainerFrame.h"
//
// <mphantom> -- make content invisible but preserve its size
//
class nsMathMLmphantomFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmphantomFrame(nsIFrame** aNewFrame);
NS_IMETHOD
Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
protected:
nsMathMLmphantomFrame();
virtual ~nsMathMLmphantomFrame();
virtual PRIntn GetSkipSides() const { return 0; }
};
#endif /* nsMathMLmphantomFrame_h___ */

Просмотреть файл

@ -0,0 +1,82 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#include "nsCOMPtr.h"
#include "nsHTMLParts.h"
#include "nsIHTMLContent.h"
#include "nsFrame.h"
#include "nsLineLayout.h"
#include "nsHTMLIIDs.h"
#include "nsIPresContext.h"
#include "nsHTMLAtoms.h"
#include "nsUnitConversion.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsINameSpaceManager.h"
#include "nsIRenderingContext.h"
#include "nsIFontMetrics.h"
#include "nsStyleUtil.h"
#include "nsMathMLAtoms.h"
#include "nsMathMLParts.h"
#include "nsMathMLmrootFrame.h"
//
// <msqrt> and <mroot> -- form a radical
//
nsresult
NS_NewMathMLmrootFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmrootFrame* it = new nsMathMLmrootFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
nsMathMLmrootFrame::nsMathMLmrootFrame()
{
}
nsMathMLmrootFrame::~nsMathMLmrootFrame()
{
}
NS_IMETHODIMP
nsMathMLmrootFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv = nsMathMLContainerFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
// XXX Attributes?
return rv;
}

Просмотреть файл

@ -0,0 +1,63 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#ifndef nsMathMLmrootFrame_h___
#define nsMathMLmrootFrame_h___
#include "nsCOMPtr.h"
#include "nsMathMLContainerFrame.h"
//
// <msqrt> and <mroot> -- form a radical
//
class nsMathMLmrootFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmrootFrame(nsIFrame** aNewFrame);
NS_IMETHOD
Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD
SetInitialChildList(nsIPresContext& aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv;
rv = nsMathMLContainerFrame::SetInitialChildList(aPresContext, aListName, aChildList);
UpdatePresentationDataFromChildAt(0, 2, PR_FALSE);
ReResolveStyleContext(&aPresContext, mStyleContext, NS_STYLE_HINT_REFLOW, nsnull, nsnull);
return rv;
}
protected:
nsMathMLmrootFrame();
virtual ~nsMathMLmrootFrame();
virtual PRIntn GetSkipSides() const { return 0; }
};
#endif /* nsMathMLmrootFrame_h___ */

Просмотреть файл

@ -0,0 +1,82 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#include "nsCOMPtr.h"
#include "nsHTMLParts.h"
#include "nsIHTMLContent.h"
#include "nsFrame.h"
#include "nsLineLayout.h"
#include "nsHTMLIIDs.h"
#include "nsIPresContext.h"
#include "nsHTMLAtoms.h"
#include "nsUnitConversion.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsINameSpaceManager.h"
#include "nsIRenderingContext.h"
#include "nsIFontMetrics.h"
#include "nsStyleUtil.h"
#include "nsMathMLAtoms.h"
#include "nsMathMLParts.h"
#include "nsMathMLmrowFrame.h"
//
// <mrow> -- horizontally group any number of subexpressions - implementation
//
nsresult
NS_NewMathMLmrowFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmrowFrame* it = new nsMathMLmrowFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
nsMathMLmrowFrame::nsMathMLmrowFrame()
{
}
nsMathMLmrowFrame::~nsMathMLmrowFrame()
{
}
NS_IMETHODIMP
nsMathMLmrowFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv = nsMathMLContainerFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
// XXX Attributes?
return rv;
}

Просмотреть файл

@ -0,0 +1,64 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#ifndef nsMathMLmrowFrame_h___
#define nsMathMLmrowFrame_h___
#include "nsCOMPtr.h"
#include "nsMathMLContainerFrame.h"
//
// <mrow> -- horizontally group any number of subexpressions
//
class nsMathMLmrowFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmrowFrame(nsIFrame** aNewFrame);
NS_IMETHOD
Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
// We override the nsMathMLContainerFrame::ReResolveStyleContext() method
// because this container <tag>base arguments</tag> does not need its
// 'arguments' in a smaller font size that the 'base'.
NS_IMETHOD
ReResolveStyleContext(nsIPresContext* aPresContext,
nsIStyleContext* aParentContext,
PRInt32 aParentChange,
nsStyleChangeList* aChangeList,
PRInt32* aLocalChange)
{
return nsHTMLContainerFrame::ReResolveStyleContext(aPresContext, aParentContext, aParentChange, aChangeList, aLocalChange);
}
protected:
nsMathMLmrowFrame();
virtual ~nsMathMLmrowFrame();
virtual PRIntn GetSkipSides() const { return 0; }
};
#endif /* nsMathMLmrowFrame_h___ */

Просмотреть файл

@ -0,0 +1,156 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#include "nsCOMPtr.h"
#include "nsHTMLParts.h"
#include "nsIHTMLContent.h"
#include "nsFrame.h"
#include "nsLineLayout.h"
#include "nsHTMLIIDs.h"
#include "nsIPresContext.h"
#include "nsHTMLAtoms.h"
#include "nsUnitConversion.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsINameSpaceManager.h"
#include "nsIRenderingContext.h"
#include "nsIFontMetrics.h"
#include "nsStyleUtil.h"
#include "nsMathMLAtoms.h"
#include "nsMathMLParts.h"
#include "nsMathMLmstyleFrame.h"
//
// <mstyle> -- style change
//
nsresult
NS_NewMathMLmstyleFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmstyleFrame* it = new nsMathMLmstyleFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
nsMathMLmstyleFrame::nsMathMLmstyleFrame()
{
}
nsMathMLmstyleFrame::~nsMathMLmstyleFrame()
{
}
// mstyle needs special care for its scriptlevel and displaystyle attributes
NS_IMETHODIMP
nsMathMLmstyleFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv = nsMathMLContainerFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
mFlags = 0;
// see if the displaystyle attribute is there
nsAutoString value;
if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None,
nsMathMLAtoms::displaystyle, value)) {
if (value == "true") {
mDisplayStyle = PR_TRUE;
mFlags |= NS_MATHML_MSTYLE_DISPLAYSTYLE;
}
else if (value == "false") {
mDisplayStyle = PR_FALSE;
mFlags |= NS_MATHML_MSTYLE_DISPLAYSTYLE;
}
}
// see if the scriptlevel attribute is there
if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None,
nsMathMLAtoms::scriptlevel, value)) {
PRInt32 aErrorCode, aUserValue;
aUserValue = value.ToInteger(&aErrorCode);
if (NS_SUCCEEDED(aErrorCode)) {
if (value[0] != '+' && value[0] != '-') { // record that it is an explicit value
mFlags |= NS_MATHML_MSTYLE_SCRIPTLEVEL_EXPLICIT;
mScriptLevel = aUserValue; // explicit value...
}
else {
mScriptLevel += aUserValue; // incremental value...
}
}
}
// TODO:
// Examine all other attributes and update the style context to be
// inherited by all children.
return rv;
}
NS_IMETHODIMP
nsMathMLmstyleFrame::UpdatePresentationData(PRInt32 aScriptLevelIncrement,
PRBool aDisplayStyle)
{
// The scriptlevel and displaystyle attributes of mstyle take precedence.
// Update only if attributes are not there
if (!(NS_MATHML_MSTYLE_HAS_DISPLAYSTYLE(mFlags))) {
mDisplayStyle = aDisplayStyle;
}
if (!(NS_MATHML_MSTYLE_HAS_SCRIPTLEVEL_EXPLICIT(mFlags))) {
mScriptLevel += aScriptLevelIncrement;
}
return NS_OK;
}
NS_IMETHODIMP
nsMathMLmstyleFrame::UpdatePresentationDataFromChildAt(PRInt32 aIndex,
PRInt32 aScriptLevelIncrement,
PRBool aDisplayStyle)
{
// mstyle is special...
// Since UpdatePresentationDataFromChildAt() can be called by a parent frame,
// wee need to ensure that the attributes of mstyle take precedence
if (NS_MATHML_MSTYLE_HAS_DISPLAYSTYLE(mFlags)) {
aDisplayStyle = mDisplayStyle;
}
if (NS_MATHML_MSTYLE_HAS_SCRIPTLEVEL_EXPLICIT(mFlags)) {
aScriptLevelIncrement = 0;
}
if (0 == aScriptLevelIncrement && aDisplayStyle == mDisplayStyle)
return NS_OK;
// let the base class worry about the update
return nsMathMLContainerFrame::UpdatePresentationDataFromChildAt(aIndex,
aScriptLevelIncrement, aDisplayStyle);
}

Просмотреть файл

@ -0,0 +1,84 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#ifndef nsMathMLmstyleFrame_h___
#define nsMathMLmstyleFrame_h___
#include "nsCOMPtr.h"
#include "nsMathMLContainerFrame.h"
//
// <mstyle> -- style change
//
#define NS_MATHML_MSTYLE_SCRIPTLEVEL_EXPLICIT (1)
#define NS_MATHML_MSTYLE_DISPLAYSTYLE (1<<1)
#define NS_MATHML_MSTYLE_HAS_SCRIPTLEVEL_EXPLICIT(_flags) \
(NS_MATHML_MSTYLE_SCRIPTLEVEL_EXPLICIT == ((_flags) & NS_MATHML_MSTYLE_SCRIPTLEVEL_EXPLICIT))
#define NS_MATHML_MSTYLE_HAS_DISPLAYSTYLE(_flags) \
(NS_MATHML_MSTYLE_DISPLAYSTYLE == ((_flags) & NS_MATHML_MSTYLE_DISPLAYSTYLE))
class nsMathMLmstyleFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmstyleFrame(nsIFrame** aNewFrame);
NS_IMETHOD
Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD
UpdatePresentationData(PRInt32 aScriptLevel,
PRBool aDisplayStyle);
NS_IMETHOD
UpdatePresentationDataFromChildAt(PRInt32 aIndex,
PRInt32 aScriptLevelIncrement,
PRBool aDisplayStyle);
NS_IMETHOD
SetInitialChildList(nsIPresContext& aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv;
rv = nsMathMLContainerFrame::SetInitialChildList(aPresContext, aListName, aChildList);
ReResolveStyleContext(&aPresContext, mStyleContext, NS_STYLE_HINT_REFLOW, nsnull, nsnull);
return rv;
}
protected:
nsMathMLmstyleFrame();
virtual ~nsMathMLmstyleFrame();
virtual PRIntn GetSkipSides() const { return 0; }
PRInt32 mInnerScriptLevelIncrement;
PRInt32 mFlags;
};
#endif /* nsMathMLmstyleFrame_h___ */

Просмотреть файл

@ -0,0 +1,165 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#include "nsCOMPtr.h"
#include "nsHTMLParts.h"
#include "nsIHTMLContent.h"
#include "nsFrame.h"
#include "nsLineLayout.h"
#include "nsHTMLIIDs.h"
#include "nsIPresContext.h"
#include "nsHTMLAtoms.h"
#include "nsUnitConversion.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsINameSpaceManager.h"
#include "nsIRenderingContext.h"
#include "nsIFontMetrics.h"
#include "nsStyleUtil.h"
#include "nsMathMLAtoms.h"
#include "nsMathMLParts.h"
#include "nsMathMLmsubFrame.h"
//
// <msub> -- attach a subscript to a base - implementation
//
nsresult
NS_NewMathMLmsubFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmsubFrame* it = new nsMathMLmsubFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
nsMathMLmsubFrame::nsMathMLmsubFrame()
{
}
nsMathMLmsubFrame::~nsMathMLmsubFrame()
{
}
NS_IMETHODIMP
nsMathMLmsubFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
nsresult rv = NS_OK;
nsReflowStatus childStatus;
nsHTMLReflowMetrics childDesiredSize(aDesiredSize.maxElementSize);
nsSize availSize(aReflowState.mComputedWidth, aReflowState.mComputedHeight);
//////////////////
// Reflow Children
nscoord count = 0;
nsRect rect[2];
nsIFrame* child[2];
nsIFrame* childFrame = mFrames.FirstChild();
while (nsnull != childFrame)
{
//////////////
// WHITESPACE: don't forget that whitespace doesn't count in MathML!
if (IsOnlyWhitespace(childFrame)) {
ReflowEmptyChild(childFrame);
}
else if (2 > count) {
nsHTMLReflowState childReflowState(aPresContext, aReflowState,
childFrame, availSize);
rv = ReflowChild(childFrame, aPresContext, childDesiredSize,
childReflowState, childStatus);
NS_ASSERTION(NS_FRAME_IS_COMPLETE(childStatus), "bad status");
if (NS_FAILED(rv)) {
return rv;
}
child[count] = childFrame;
rect[count].width = childDesiredSize.width;
rect[count].height = childDesiredSize.height;
if (0 == count) {
aDesiredSize.ascent = childDesiredSize.ascent;
}
count++;
}
// else { invalid markup... }
rv = childFrame->GetNextSibling(&childFrame);
NS_ASSERTION(NS_SUCCEEDED(rv),"failed to get next child");
}
//////////////////
// Place Children
// Get the subscript offset
nscoord subscriptOffset, leading;
nsCOMPtr<nsIFontMetrics> fm;
const nsStyleFont* aFont =
(const nsStyleFont*)mStyleContext->GetStyleData(eStyleStruct_Font);
aPresContext.GetMetricsFor(aFont->mFont, getter_AddRefs(fm));
fm->GetSubscriptOffset(subscriptOffset);
fm->GetLeading(leading);
// XXX temporary hack pending bug http://bugzilla.mozilla.org/show_bug.cgi?id=9640
//#if 0
nscoord fmAscent, xHeight;
fm->GetMaxAscent(fmAscent);
fm->GetXHeight(xHeight);
subscriptOffset = PR_MAX(subscriptOffset,fmAscent-(xHeight*4)/5);
//#endif
//for (int i=0; i<100; i++) {
//printf("Ascent:%d xHeight:%d subscriptOffset:%d leading: %d ",
//fmAscent, xHeight, subscriptOffset, leading);
//}
subscriptOffset += leading;
// logic derived after examining the boxes on three cases: h0==h1, h0>h1, h0<h1
aDesiredSize.height = rect[0].height + rect[1].height - subscriptOffset;
aDesiredSize.width = rect[0].width + rect[1].width;
rect[0].x = 0;
rect[0].y = 0;
rect[1].x = rect[0].width;
rect[1].y = aDesiredSize.height - rect[1].height;
aDesiredSize.descent = aDesiredSize.height - aDesiredSize.ascent;
child[0]->SetRect(rect[0]);
child[1]->SetRect(rect[1]);
if (nsnull != aDesiredSize.maxElementSize) {
aDesiredSize.maxElementSize->width = aDesiredSize.width;
aDesiredSize.maxElementSize->height = aDesiredSize.height;
}
aStatus = NS_FRAME_COMPLETE;
return NS_OK;
}

Просмотреть файл

@ -0,0 +1,62 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#ifndef nsMathMLmsubFrame_h___
#define nsMathMLmsubFrame_h___
#include "nsCOMPtr.h"
#include "nsMathMLContainerFrame.h"
//
// <msub> -- attach a subscript to a base
//
class nsMathMLmsubFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmsubFrame(nsIFrame** aNewFrame);
NS_IMETHOD
Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD
SetInitialChildList(nsIPresContext& aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv;
rv = nsMathMLContainerFrame::SetInitialChildList(aPresContext, aListName, aChildList);
UpdatePresentationDataFromChildAt(1, 1, PR_FALSE);
ReResolveStyleContext(&aPresContext, mStyleContext, NS_STYLE_HINT_REFLOW, nsnull, nsnull);
return rv;
}
protected:
nsMathMLmsubFrame();
virtual ~nsMathMLmsubFrame();
virtual PRIntn GetSkipSides() const { return 0; }
};
#endif /* nsMathMLmsubFrame_h___ */

Просмотреть файл

@ -0,0 +1,174 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#include "nsCOMPtr.h"
#include "nsHTMLParts.h"
#include "nsIHTMLContent.h"
#include "nsFrame.h"
#include "nsLineLayout.h"
#include "nsHTMLIIDs.h"
#include "nsIPresContext.h"
#include "nsHTMLAtoms.h"
#include "nsUnitConversion.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsINameSpaceManager.h"
#include "nsIRenderingContext.h"
#include "nsIFontMetrics.h"
#include "nsStyleUtil.h"
#include "nsMathMLAtoms.h"
#include "nsMathMLParts.h"
#include "nsMathMLmsubsupFrame.h"
//
// <msubsup> -- attach a subscript-superscript pair to a base - implementation
//
nsresult
NS_NewMathMLmsubsupFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmsubsupFrame* it = new nsMathMLmsubsupFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
nsMathMLmsubsupFrame::nsMathMLmsubsupFrame()
{
}
nsMathMLmsubsupFrame::~nsMathMLmsubsupFrame()
{
}
NS_IMETHODIMP
nsMathMLmsubsupFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
nsresult rv = NS_OK;
nsReflowStatus childStatus;
nsHTMLReflowMetrics childDesiredSize(aDesiredSize.maxElementSize);
nsSize availSize(aReflowState.mComputedWidth, aReflowState.mComputedHeight);
//////////////////
// Reflow Children
nscoord ascent, descent;
nscoord count = 0;
nsRect rect[3];
nsIFrame* child[3];
nsIFrame* childFrame = mFrames.FirstChild();
while (nsnull != childFrame)
{
//////////////
// WHITESPACE: don't forget that whitespace doesn't count in MathML!
if (IsOnlyWhitespace(childFrame)) {
ReflowEmptyChild(childFrame);
}
else if (3 > count) {
nsHTMLReflowState childReflowState(aPresContext, aReflowState,
childFrame, availSize);
rv = ReflowChild(childFrame, aPresContext, childDesiredSize,
childReflowState, childStatus);
NS_ASSERTION(NS_FRAME_IS_COMPLETE(childStatus), "bad status");
if (NS_FAILED(rv)) {
return rv;
}
child[count] = childFrame;
rect[count].width = childDesiredSize.width;
rect[count].height = childDesiredSize.height;
if (0 == count) {
ascent = childDesiredSize.ascent;
descent = childDesiredSize.descent;
}
count++;
}
// else { invalid markup... }
rv = childFrame->GetNextSibling(&childFrame);
NS_ASSERTION(NS_SUCCEEDED(rv),"failed to get next child");
}
//////////////////
// Place Children
// Get the subscript and superscript offsets
nscoord subscriptOffset, superscriptOffset, leading;
nsCOMPtr<nsIFontMetrics> fm;
const nsStyleFont* aFont =
(const nsStyleFont*)mStyleContext->GetStyleData(eStyleStruct_Font);
aPresContext.GetMetricsFor(aFont->mFont, getter_AddRefs(fm));
fm->GetSubscriptOffset(subscriptOffset);
fm->GetSuperscriptOffset(superscriptOffset);
fm->GetLeading(leading);
//#if 0
// XXX temporary hack pending bug http://bugzilla.mozilla.org/show_bug.cgi?id=9640
nscoord fmAscent, xHeight;
fm->GetMaxAscent(fmAscent);
fm->GetXHeight(xHeight);
subscriptOffset = PR_MAX(subscriptOffset,fmAscent-(xHeight*4)/5);
//#endif
subscriptOffset += leading;
superscriptOffset += leading;
// logic of superimposing a box with sub and the same box with sup
rect[0].x = 0;
rect[1].x = rect[0].width;
rect[2].x = rect[0].width;
nscoord subHeight = rect[0].height + rect[1].height - subscriptOffset;
nscoord supHeight = rect[0].height + rect[2].height - superscriptOffset;
aDesiredSize.descent = subHeight - ascent;
aDesiredSize.ascent = supHeight - descent;
aDesiredSize.height = aDesiredSize.descent + aDesiredSize.ascent;
aDesiredSize.width = rect[0].width + PR_MAX(rect[1].width, rect[2].width);
rect[2].y = 0;
rect[1].y = aDesiredSize.height - rect[1].height;
rect[0].y = aDesiredSize.height - subHeight;
child[0]->SetRect(rect[0]);
child[1]->SetRect(rect[1]);
child[2]->SetRect(rect[2]);
if (nsnull != aDesiredSize.maxElementSize) {
aDesiredSize.maxElementSize->width = aDesiredSize.width;
aDesiredSize.maxElementSize->height = aDesiredSize.height;
}
aStatus = NS_FRAME_COMPLETE;
return NS_OK;
}

Просмотреть файл

@ -0,0 +1,62 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#ifndef nsMathMLmsubsupFrame_h___
#define nsMathMLmsubsupFrame_h___
#include "nsCOMPtr.h"
#include "nsMathMLContainerFrame.h"
//
// <msubsup> -- attach a subscript-superscript pair to a base
//
class nsMathMLmsubsupFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmsubsupFrame(nsIFrame** aNewFrame);
NS_IMETHOD
Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD
SetInitialChildList(nsIPresContext& aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv;
rv = nsMathMLContainerFrame::SetInitialChildList(aPresContext, aListName, aChildList);
UpdatePresentationDataFromChildAt(1, 1, PR_FALSE);
ReResolveStyleContext(&aPresContext, mStyleContext, NS_STYLE_HINT_REFLOW, nsnull, nsnull);
return rv;
}
protected:
nsMathMLmsubsupFrame();
virtual ~nsMathMLmsubsupFrame();
virtual PRIntn GetSkipSides() const { return 0; }
};
#endif /* nsMathMLmsubsupFrame_h___ */

Просмотреть файл

@ -0,0 +1,152 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#include "nsCOMPtr.h"
#include "nsHTMLParts.h"
#include "nsIHTMLContent.h"
#include "nsFrame.h"
#include "nsLineLayout.h"
#include "nsHTMLIIDs.h"
#include "nsIPresContext.h"
#include "nsHTMLAtoms.h"
#include "nsUnitConversion.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsINameSpaceManager.h"
#include "nsIRenderingContext.h"
#include "nsIFontMetrics.h"
#include "nsStyleUtil.h"
#include "nsMathMLAtoms.h"
#include "nsMathMLParts.h"
#include "nsMathMLmsupFrame.h"
//
// <msup> -- attach a superscript to a base - implementation
//
nsresult
NS_NewMathMLmsupFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmsupFrame* it = new nsMathMLmsupFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
nsMathMLmsupFrame::nsMathMLmsupFrame()
{
}
nsMathMLmsupFrame::~nsMathMLmsupFrame()
{
}
NS_IMETHODIMP
nsMathMLmsupFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
nsresult rv = NS_OK;
nsReflowStatus childStatus;
nsHTMLReflowMetrics childDesiredSize(aDesiredSize.maxElementSize);
nsSize availSize(aReflowState.mComputedWidth, aReflowState.mComputedHeight);
//////////////////
// Reflow Children
nscoord count = 0;
nsRect rect[2];
nsIFrame* child[2];
nsIFrame* childFrame = mFrames.FirstChild();
while (nsnull != childFrame)
{
//////////////
// WHITESPACE: don't forget that whitespace doesn't count in MathML!
if (IsOnlyWhitespace(childFrame)) {
ReflowEmptyChild(childFrame);
}
else if (2 > count) {
nsHTMLReflowState childReflowState(aPresContext, aReflowState,
childFrame, availSize);
rv = ReflowChild(childFrame, aPresContext, childDesiredSize,
childReflowState, childStatus);
NS_ASSERTION(NS_FRAME_IS_COMPLETE(childStatus), "bad status");
if (NS_FAILED(rv)) {
return rv;
}
child[count] = childFrame;
rect[count].width = childDesiredSize.width;
rect[count].height = childDesiredSize.height;
if (0 == count) {
aDesiredSize.descent = childDesiredSize.descent;
}
count++;
}
// else { invalid markup... }
rv = childFrame->GetNextSibling(&childFrame);
NS_ASSERTION(NS_SUCCEEDED(rv),"failed to get next child");
}
//////////////////
// Place Children
// Get the superscript offset
nscoord superscriptOffset, leading;
nsCOMPtr<nsIFontMetrics> fm;
const nsStyleFont* aFont =
(const nsStyleFont*)mStyleContext->GetStyleData(eStyleStruct_Font);
aPresContext.GetMetricsFor(aFont->mFont, getter_AddRefs(fm));
fm->GetSuperscriptOffset(superscriptOffset);
fm->GetLeading(leading);
superscriptOffset += leading;
aDesiredSize.height = rect[0].height + rect[1].height - superscriptOffset;
aDesiredSize.width = rect[0].width + rect[1].width;
rect[0].x = 0;
rect[1].x = rect[0].width;
rect[1].y = 0;
rect[0].y = aDesiredSize.height - rect[0].height;
aDesiredSize.ascent = aDesiredSize.height - aDesiredSize.descent;
child[0]->SetRect(rect[0]);
child[1]->SetRect(rect[1]);
if (nsnull != aDesiredSize.maxElementSize) {
aDesiredSize.maxElementSize->width = aDesiredSize.width;
aDesiredSize.maxElementSize->height = aDesiredSize.height;
}
aStatus = NS_FRAME_COMPLETE;
return NS_OK;
}

Просмотреть файл

@ -0,0 +1,62 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitions under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#ifndef nsMathMLmsupFrame_h___
#define nsMathMLmsupFrame_h___
#include "nsCOMPtr.h"
#include "nsMathMLContainerFrame.h"
//
// <msup> -- attach a superscript to a base
//
class nsMathMLmsupFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmsupFrame(nsIFrame** aNewFrame);
NS_IMETHOD
Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD
SetInitialChildList(nsIPresContext& aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv;
rv = nsMathMLContainerFrame::SetInitialChildList(aPresContext, aListName, aChildList);
UpdatePresentationDataFromChildAt(1, 1, PR_FALSE);
ReResolveStyleContext(&aPresContext, mStyleContext, NS_STYLE_HINT_REFLOW, nsnull, nsnull);
return rv;
}
protected:
nsMathMLmsupFrame();
virtual ~nsMathMLmsupFrame();
virtual PRIntn GetSkipSides() const { return 0; }
};
#endif /* nsMathMLmsupFrame_h___ */

Просмотреть файл

@ -0,0 +1,90 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#include "nsCOMPtr.h"
#include "nsHTMLParts.h"
#include "nsIHTMLContent.h"
#include "nsFrame.h"
#include "nsLineLayout.h"
#include "nsHTMLIIDs.h"
#include "nsIPresContext.h"
#include "nsHTMLAtoms.h"
#include "nsAreaFrame.h"
#include "nsUnitConversion.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsINameSpaceManager.h"
#include "nsIRenderingContext.h"
#include "nsIFontMetrics.h"
#include "nsStyleUtil.h"
#include "nsMathMLAtoms.h"
#include "nsMathMLParts.h"
#include "nsMathMLmtdFrame.h"
//
// <mtd> -- table or matrix - implementation
//
nsresult
NS_NewMathMLmtdFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmtdFrame* it = new nsMathMLmtdFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
// XXX RBS - what about mFlags ?
// it->SetFlags(NS_AREA_WRAP_SIZE); ?
*aNewFrame = it;
return NS_OK;
}
nsMathMLmtdFrame::nsMathMLmtdFrame()
{
}
nsMathMLmtdFrame::~nsMathMLmtdFrame()
{
}
NS_IMETHODIMP
nsMathMLmtdFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
nsresult rv = NS_OK;
// Let the base class do the reflow
rv = nsAreaFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
// more about <maligngroup/> and <malignmark/> later
// ...
return rv;
}

Просмотреть файл

@ -0,0 +1,50 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#ifndef nsMathMLmtdFrame_h___
#define nsMathMLmtdFrame_h___
#include "nsCOMPtr.h"
#include "nsMathMLContainerFrame.h"
//
// <mtd> -- table or matrix
//
class nsMathMLmtdFrame : public nsAreaFrame {
public:
friend nsresult NS_NewMathMLmtdFrame(nsIFrame** aNewFrame);
NS_IMETHOD
Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
protected:
nsMathMLmtdFrame();
virtual ~nsMathMLmtdFrame();
virtual PRIntn GetSkipSides() const { return 0; }
};
#endif /* nsMathMLmtdFrame_h___ */

Просмотреть файл

@ -0,0 +1,165 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#include "nsCOMPtr.h"
#include "nsHTMLParts.h"
#include "nsIHTMLContent.h"
#include "nsFrame.h"
#include "nsLineLayout.h"
#include "nsHTMLIIDs.h"
#include "nsIPresContext.h"
#include "nsHTMLAtoms.h"
#include "nsUnitConversion.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsINameSpaceManager.h"
#include "nsIRenderingContext.h"
#include "nsIFontMetrics.h"
#include "nsStyleUtil.h"
#include "nsMathMLAtoms.h"
#include "nsMathMLParts.h"
#include "nsMathMLmunderFrame.h"
//
// <munder> -- attach an underscript to a base - implementation
//
nsresult
NS_NewMathMLmunderFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmunderFrame* it = new nsMathMLmunderFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
nsMathMLmunderFrame::nsMathMLmunderFrame()
{
}
nsMathMLmunderFrame::~nsMathMLmunderFrame()
{
}
NS_IMETHODIMP
nsMathMLmunderFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
nsresult rv = NS_OK;
nsReflowStatus childStatus;
nsHTMLReflowMetrics childDesiredSize(aDesiredSize.maxElementSize);
nsSize availSize(aReflowState.mComputedWidth, aReflowState.mComputedHeight);
//////////////////
// Reflow Children
nscoord count = 0;
nsRect rect[2];
nsIFrame* child[2];
nsIFrame* childFrame = mFrames.FirstChild();
while (nsnull != childFrame)
{
//////////////
// WHITESPACE: don't forget that whitespace doesn't count in MathML!
if (IsOnlyWhitespace(childFrame)) {
ReflowEmptyChild(childFrame);
}
else if (2 > count) {
nsHTMLReflowState childReflowState(aPresContext, aReflowState,
childFrame, availSize);
rv = ReflowChild(childFrame, aPresContext, childDesiredSize,
childReflowState, childStatus);
NS_ASSERTION(NS_FRAME_IS_COMPLETE(childStatus), "bad status");
if (NS_FAILED(rv)) {
return rv;
}
child[count] = childFrame;
rect[count].width = childDesiredSize.width;
rect[count].height = childDesiredSize.height;
if (0 == count) {
aDesiredSize.ascent = childDesiredSize.ascent;
aDesiredSize.descent = childDesiredSize.descent;
}
count++;
}
// else { invalid markup... }
rv = childFrame->GetNextSibling(&childFrame);
NS_ASSERTION(NS_SUCCEEDED(rv),"failed to get next child");
}
//////////////////
// Place Children
#if 0
// Get the underline offset and align the top of the under-element with it
nscoord underOffset, underThickness;
nsCOMPtr<nsIFontMetrics> fm;
const nsStyleFont* aFont =
(const nsStyleFont*)mStyleContext->GetStyleData(eStyleStruct_Font);
aPresContext.GetMetricsFor(aFont->mFont, getter_AddRefs(fm));
fm->GetUnderline(underOffset, underThickness);
#endif
aDesiredSize.descent += rect[1].height;
aDesiredSize.width = PR_MAX(rect[0].width, rect[1].width);
aDesiredSize.height = aDesiredSize.ascent + aDesiredSize.descent;
rect[0].x = (aDesiredSize.width - rect[0].width) / 2; // center w.r.t largest width
rect[1].x = (aDesiredSize.width - rect[1].width) / 2;
rect[0].y = 0;
rect[1].y = aDesiredSize.height - rect[1].height;
//ignore the leading (line spacing) that is attached to the text
nscoord leading;
nsCOMPtr<nsIFontMetrics> fm;
const nsStyleFont* aFont =
(const nsStyleFont*)mStyleContext->GetStyleData(eStyleStruct_Font);
aPresContext.GetMetricsFor(aFont->mFont, getter_AddRefs(fm));
fm->GetLeading(leading);
aDesiredSize.height -= leading;
aDesiredSize.descent -= leading;
rect[1].y -= leading;
//
child[0]->SetRect(rect[0]);
child[1]->SetRect(rect[1]);
if (nsnull != aDesiredSize.maxElementSize) {
aDesiredSize.maxElementSize->width = aDesiredSize.width;
aDesiredSize.maxElementSize->height = aDesiredSize.height;
}
aStatus = NS_FRAME_COMPLETE;
return NS_OK;
}

Просмотреть файл

@ -0,0 +1,62 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#ifndef nsMathMLmunderFrame_h___
#define nsMathMLmunderFrame_h___
#include "nsCOMPtr.h"
#include "nsMathMLContainerFrame.h"
//
// <munder> -- attach an underscript to a base
//
class nsMathMLmunderFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmunderFrame(nsIFrame** aNewFrame);
NS_IMETHOD
Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD
SetInitialChildList(nsIPresContext& aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv;
rv = nsMathMLContainerFrame::SetInitialChildList(aPresContext, aListName, aChildList);
UpdatePresentationDataFromChildAt(1, 1, PR_FALSE);
ReResolveStyleContext(&aPresContext, mStyleContext, NS_STYLE_HINT_REFLOW, nsnull, nsnull);
return rv;
}
protected:
nsMathMLmunderFrame();
virtual ~nsMathMLmunderFrame();
virtual PRIntn GetSkipSides() const { return 0; }
};
#endif /* nsMathMLmunderFrame_h___ */

Просмотреть файл

@ -0,0 +1,166 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#include "nsCOMPtr.h"
#include "nsHTMLParts.h"
#include "nsIHTMLContent.h"
#include "nsFrame.h"
#include "nsLineLayout.h"
#include "nsHTMLIIDs.h"
#include "nsIPresContext.h"
#include "nsHTMLAtoms.h"
#include "nsUnitConversion.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsINameSpaceManager.h"
#include "nsIRenderingContext.h"
#include "nsIFontMetrics.h"
#include "nsStyleUtil.h"
#include "nsMathMLAtoms.h"
#include "nsMathMLParts.h"
#include "nsMathMLmunderoverFrame.h"
//
// <munderover> -- attach an underscript-overscript pair to a base - implementation
//
nsresult
NS_NewMathMLmunderoverFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmunderoverFrame* it = new nsMathMLmunderoverFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
nsMathMLmunderoverFrame::nsMathMLmunderoverFrame()
{
}
nsMathMLmunderoverFrame::~nsMathMLmunderoverFrame()
{
}
NS_IMETHODIMP
nsMathMLmunderoverFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
nsresult rv = NS_OK;
nsReflowStatus childStatus;
nsHTMLReflowMetrics childDesiredSize(aDesiredSize.maxElementSize);
nsSize availSize(aReflowState.mComputedWidth, aReflowState.mComputedHeight);
aDesiredSize.width = 0;
//////////////////
// Reflow Children
nscoord count = 0;
nsRect rect[3];
nsIFrame* child[3];
nsIFrame* childFrame = mFrames.FirstChild();
while (nsnull != childFrame)
{
//////////////
// WHITESPACE: don't forget that whitespace doesn't count in MathML!
if (IsOnlyWhitespace(childFrame)) {
ReflowEmptyChild(childFrame);
}
else if (3 > count) {
nsHTMLReflowState childReflowState(aPresContext, aReflowState,
childFrame, availSize);
rv = ReflowChild(childFrame, aPresContext, childDesiredSize,
childReflowState, childStatus);
NS_ASSERTION(NS_FRAME_IS_COMPLETE(childStatus), "bad status");
if (NS_FAILED(rv)) {
return rv;
}
child[count] = childFrame;
rect[count].width = childDesiredSize.width;
rect[count].height = childDesiredSize.height;
if (aDesiredSize.width < childDesiredSize.width) {
aDesiredSize.width = childDesiredSize.width;
}
if (0 == count) {
aDesiredSize.ascent = childDesiredSize.ascent;
aDesiredSize.descent = childDesiredSize.descent;
}
count++;
}
// else { invalid markup... }
rv = childFrame->GetNextSibling(&childFrame);
NS_ASSERTION(NS_SUCCEEDED(rv),"failed to get next child");
}
//////////////////
// Place Children
aDesiredSize.ascent += rect[1].height;
aDesiredSize.descent += rect[2].height;
aDesiredSize.height = aDesiredSize.ascent + aDesiredSize.descent;
rect[0].x = (aDesiredSize.width - rect[0].width) / 2; // center w.r.t largest width
rect[1].x = (aDesiredSize.width - rect[1].width) / 2;
rect[2].x = (aDesiredSize.width - rect[2].width) / 2;
rect[0].y = rect[1].height;
rect[1].y = aDesiredSize.height - rect[1].height;
rect[2].y = 0;
//ignore the leading (line spacing) that is attached to the text
nscoord leading;
nsCOMPtr<nsIFontMetrics> fm;
const nsStyleFont* aFont =
(const nsStyleFont*)mStyleContext->GetStyleData(eStyleStruct_Font);
aPresContext.GetMetricsFor(aFont->mFont, getter_AddRefs(fm));
fm->GetLeading(leading);
aDesiredSize.height -= 2*leading;
aDesiredSize.ascent -= leading;
aDesiredSize.descent -= leading;
rect[0].y -= leading;
rect[1].y -= 2*leading;
//
child[0]->SetRect(rect[0]);
child[1]->SetRect(rect[1]);
child[2]->SetRect(rect[2]);
if (nsnull != aDesiredSize.maxElementSize) {
aDesiredSize.maxElementSize->width = aDesiredSize.width;
aDesiredSize.maxElementSize->height = aDesiredSize.height;
}
aStatus = NS_FRAME_COMPLETE;
return NS_OK;
}

Просмотреть файл

@ -0,0 +1,63 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* David J. Fiddes <D.J.Fiddes@hw.ac.uk>
*/
#ifndef nsMathMLmunderoverFrame_h___
#define nsMathMLmunderoverFrame_h___
#include "nsCOMPtr.h"
#include "nsMathMLContainerFrame.h"
//
// <munderover> -- attach an underscript-overscript pair to a base
//
class nsMathMLmunderoverFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmunderoverFrame(nsIFrame** aNewFrame);
NS_IMETHOD
Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD
SetInitialChildList(nsIPresContext& aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv;
rv = nsMathMLContainerFrame::SetInitialChildList(aPresContext, aListName, aChildList);
UpdatePresentationDataFromChildAt(1, 1, PR_FALSE);
ReResolveStyleContext(&aPresContext, mStyleContext, NS_STYLE_HINT_REFLOW, nsnull, nsnull);
return rv;
}
protected:
nsMathMLmunderoverFrame();
virtual ~nsMathMLmunderoverFrame();
virtual PRIntn GetSkipSides() const { return 0; }
};
#endif /* nsMathMLmunderoverFrame_h___ */

Просмотреть файл

@ -0,0 +1 @@
Makefile

Просмотреть файл

@ -0,0 +1,34 @@
#!gmake
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Mozilla MathML Project.
#
# The Initial Developer of the Original Code is Heriot-Watt
# University, Edinburgh. Portions created by Heriot-Watt University
# are Copyright (C) 1999 Heriot-Watt University. All Rights Reserved.
#
# Contributor(s):
# David J. Fiddes <D.J.Fiddes@hw.ac.uk>
#
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = src
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk

Просмотреть файл

Просмотреть файл

@ -0,0 +1 @@
Makefile

Просмотреть файл

@ -0,0 +1,65 @@
#!gmake
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Mozilla MathML Project.
#
# The Initial Developer of the Original Code is Heriot-Watt
# University, Edinburgh. Portions created by Heriot-Watt University
# are Copyright (C) 1999 Heriot-Watt University. All Rights Reserved.
#
# Contributor(s):
# David J. Fiddes <D.J.Fiddes@hw.ac.uk>
# Roger B. Sidje <rbs@maths.uq.edu.au>
#
DEPTH=../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk
LIBRARY_NAME = raptormathmlcontent_s
DEFINES += -D_IMPL_NS_HTML
INCLUDES += \
-I$(srcdir)/../../../base/src \
-I$(DIST)/public/raptor \
$(NULL)
CPPSRCS = \
nsMathMLAtoms.cpp \
nsMathMLOperators.cpp \
$(NULL)
EXPORTS = \
nsMathMLOperators.h \
nsMathMLOperatorList.h \
$(NULL)
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
MODULE=layout
REQUIRES = xpcom raptor dom
MKSHLIB :=
# we don't want the shared lib, but we want to force the creation of a static lib.
override NO_SHARED_LIB=1
override NO_STATIC_LIB=
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -0,0 +1,62 @@
#!nmake
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Mozilla MathML Project.
#
# The Initial Developer of the Original Code is Heriot-Watt
# University, Edinburgh. Portions created by Heriot-Watt University
# are Copyright (C) 1999 Heriot-Watt University. All Rights Reserved.
#
# Contributor(s):
# David J. Fiddes <D.J.Fiddes@hw.ac.uk>
# Roger B. Sidje <rbs@maths.uq.edu.au>
#
DEPTH=..\..\..\..
LIBRARY_NAME=raptormathmlcontent_s
MODULE=raptor
REQUIRES=xpcom raptor pref
DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN
EXPORTS = nsMathMLOperators.h \
nsMathMLOperatorList.h \
$(NULL)
CPPSRCS= \
nsMathMLAtoms.cpp \
nsMathMLOperators.cpp \
$(NULL)
CPP_OBJS= \
.\$(OBJDIR)\nsMathMLAtoms.obj \
.\$(OBJDIR)\nsMathMLOperators.obj \
$(NULL)
LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor -I$(PUBLIC)\js \
-I..\..\..\html\style\src -I..\..\..\html\base\src -I$(PUBLIC)\dom \
-I..\..\..\html\document\src \
-I$(PUBLIC)\netlib -I..\..\..\base\src -I$(PUBLIC)\pref
LCFLAGS = \
$(LCFLAGS) \
$(DEFINES) \
$(NULL)
include <$(DEPTH)\config\rules.mak>
libs:: $(LIBRARY)
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
clobber::
rm -f $(DIST)\lib\$(LIBRARY_NAME).lib

Просмотреть файл

@ -0,0 +1,175 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* (Following the model of the Gecko team)
*/
/******
This file contains the list of all MathML nsIAtoms and their values
It is designed to be used as inline input to nsMathMLAtoms.cpp *only*
through the magic of C preprocessing.
All entires must be enclosed in the macro MATHML_ATOM which will have cruel
and unusual things done to it
It is recommended (but not strictly necessary) to keep all entries
in alphabetical order
The first argument to MATHML_ATOM is the C++ identifier of the atom
The second argument is the string value of the atom
******/
MATHML_ATOM(abs, "abs")
MATHML_ATOM(accent, "accent")
MATHML_ATOM(and, "and")
MATHML_ATOM(annotation, "annotation")
MATHML_ATOM(apply, "apply")
MATHML_ATOM(arccos, "arccos")
MATHML_ATOM(arcsin, "arcsin")
MATHML_ATOM(arctan, "arctan")
MATHML_ATOM(bvar, "bvar")
MATHML_ATOM(ci, "ci")
MATHML_ATOM(cn, "cn")
MATHML_ATOM(compose, "compose")
MATHML_ATOM(condition, "condition")
MATHML_ATOM(conjugate, "conjugate")
MATHML_ATOM(cos, "cos")
MATHML_ATOM(cosh, "cosh")
MATHML_ATOM(cot, "cot")
MATHML_ATOM(coth, "coth")
MATHML_ATOM(csc, "csc")
MATHML_ATOM(csch, "csch")
MATHML_ATOM(declare, "declare")
MATHML_ATOM(degree, "degree")
MATHML_ATOM(determinant, "determinant")
MATHML_ATOM(diff, "diff")
MATHML_ATOM(displaystyle, "displaystyle")
MATHML_ATOM(divide, "divide")
MATHML_ATOM(eq, "eq")
MATHML_ATOM(exists, "exists")
MATHML_ATOM(exp, "exp")
MATHML_ATOM(factorial, "factorial")
MATHML_ATOM(fence, "fence")
MATHML_ATOM(fn, "fn")
MATHML_ATOM(forall, "forall")
MATHML_ATOM(form, "form")
MATHML_ATOM(geq, "geq")
MATHML_ATOM(gt, "gt")
MATHML_ATOM(ident, "ident")
MATHML_ATOM(implies, "implies")
MATHML_ATOM(in, "in")
MATHML_ATOM(_int, "int")
MATHML_ATOM(intersect, "intersect")
MATHML_ATOM(interval, "interval")
MATHML_ATOM(inverse, "inverse")
MATHML_ATOM(lambda, "lambda")
MATHML_ATOM(largeop, "largeop")
MATHML_ATOM(leq, "leq")
MATHML_ATOM(limit, "limit")
MATHML_ATOM(linethickness, "linethickness")
MATHML_ATOM(list, "list")
MATHML_ATOM(ln, "ln")
MATHML_ATOM(log, "log")
MATHML_ATOM(logbase, "logbase")
MATHML_ATOM(lowlimit, "lowlimit")
MATHML_ATOM(lt, "lt")
MATHML_ATOM(maction, "maction")
MATHML_ATOM(maligngroup, "maligngroup")
MATHML_ATOM(malignmark, "malignmark")
MATHML_ATOM(math, "math")
MATHML_ATOM(matrix, "matrix")
MATHML_ATOM(matrixrow, "matrixrow")
MATHML_ATOM(max, "max")
MATHML_ATOM(mean, "mean")
MATHML_ATOM(median, "median")
MATHML_ATOM(merror, "merror")
MATHML_ATOM(mfenced, "mfenced")
MATHML_ATOM(mfrac, "mfrac")
MATHML_ATOM(mi, "mi")
MATHML_ATOM(min, "min")
MATHML_ATOM(minus, "minus")
MATHML_ATOM(mmultiscripts, "mmultiscripts")
MATHML_ATOM(mn, "mn")
MATHML_ATOM(mo, "mo")
MATHML_ATOM(mode, "mode")
MATHML_ATOM(moment, "moment")
MATHML_ATOM(movablelimits, "movablelimits")
MATHML_ATOM(mover, "mover")
MATHML_ATOM(mpadded, "mpadded")
MATHML_ATOM(mphantom, "mphantom")
MATHML_ATOM(mprescripts, "mprescripts")
MATHML_ATOM(mroot, "mroot")
MATHML_ATOM(mrow, "mrow")
MATHML_ATOM(ms, "ms")
MATHML_ATOM(mspace, "mspace")
MATHML_ATOM(msqrt, "msqrt")
MATHML_ATOM(mstyle, "mstyle")
MATHML_ATOM(msub, "msub")
MATHML_ATOM(msubsup, "msubsup")
MATHML_ATOM(msup, "msup")
MATHML_ATOM(mtable, "mtable")
MATHML_ATOM(mtd, "mtd")
MATHML_ATOM(mtext, "mtext")
MATHML_ATOM(mtr, "mtr")
MATHML_ATOM(munder, "munder")
MATHML_ATOM(munderover, "munderover")
MATHML_ATOM(neq, "neq")
MATHML_ATOM(none, "none")
MATHML_ATOM(not, "not")
MATHML_ATOM(notin, "notin")
MATHML_ATOM(notprsubset, "notprsubset")
MATHML_ATOM(notsubset, "notsubset")
MATHML_ATOM(or, "or")
MATHML_ATOM(partialdiff, "partialdiff")
MATHML_ATOM(plus, "plus")
MATHML_ATOM(power, "power")
MATHML_ATOM(product, "product")
MATHML_ATOM(prsubset, "prsubset")
MATHML_ATOM(quotient, "quotient")
MATHML_ATOM(reln, "reln")
MATHML_ATOM(rem, "rem")
MATHML_ATOM(root, "root")
MATHML_ATOM(scriptlevel, "scriptlevel")
MATHML_ATOM(sdev, "sdev")
MATHML_ATOM(sec, "sec")
MATHML_ATOM(sech, "sech")
MATHML_ATOM(select, "select")
MATHML_ATOM(semantics, "semantics")
MATHML_ATOM(sep, "sep")
MATHML_ATOM(separator, "separator")
MATHML_ATOM(set, "set")
MATHML_ATOM(setdiff, "setdiff")
MATHML_ATOM(sin, "sin")
MATHML_ATOM(sinh, "sinh")
MATHML_ATOM(stretchy, "stretchy")
MATHML_ATOM(subset, "subset")
MATHML_ATOM(sum, "sum")
MATHML_ATOM(tan, "tan")
MATHML_ATOM(tanh, "tanh")
MATHML_ATOM(tendsto, "tendsto")
MATHML_ATOM(times, "times")
MATHML_ATOM(transpose, "transpose")
MATHML_ATOM(_union, "union")
MATHML_ATOM(uplimit, "uplimit")
MATHML_ATOM(var, "var")
MATHML_ATOM(vector, "vector")
MATHML_ATOM(xor, "xor")

Просмотреть файл

@ -0,0 +1,70 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* (Following the model of the Gecko team)
*/
#include "nsString.h"
#include "nsINameSpaceManager.h"
#include "nsMathMLAtoms.h"
static const char kMathMLNameSpace[] = "http://www.w3.org/Math/MathML";
PRInt32 nsMathMLAtoms::nameSpaceID;
// define storage for all atoms
#define MATHML_ATOM(_name, _value) nsIAtom* nsMathMLAtoms::_name;
#include "nsMathMLAtomList.h"
#undef MATHML_ATOM
static nsrefcnt gRefCnt;
static nsINameSpaceManager* gNameSpaceManager;
void nsMathMLAtoms::AddRefAtoms() {
if (gRefCnt == 0) {
/* MathML Atoms registers the MathML name space ID because it's a convenient
place to do this, if you don't want a permanent, "well-known" ID.
*/
if (NS_SUCCEEDED(NS_NewNameSpaceManager(&gNameSpaceManager)))
// gNameSpaceManager->CreateRootNameSpace(namespace);
gNameSpaceManager->RegisterNameSpace(kMathMLNameSpace, nameSpaceID);
else
NS_ASSERTION(0, "failed to create MathML atoms namespace manager");
// now register the atoms
#define MATHML_ATOM(_name, _value) _name = NS_NewAtom(_value);
#include "nsMathMLAtomList.h"
#undef MATHML_ATOM
}
++gRefCnt;
}
void nsMathMLAtoms::ReleaseAtoms() {
NS_PRECONDITION(gRefCnt != 0, "bad release of MathML atoms");
if (--gRefCnt == 0) {
#define MATHML_ATOM(_name, _value) NS_RELEASE(_name);
#include "nsMathMLAtomList.h"
#undef MATHML_ATOM
NS_IF_RELEASE(gNameSpaceManager);
}
}

Просмотреть файл

@ -0,0 +1,60 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
* (Following the model of the Gecko team)
*/
#ifndef nsMathMLAtoms_h___
#define nsMathMLAtoms_h___
#include "prtypes.h"
#include "nsIAtom.h"
class nsINameSpaceManager;
/**
* This class wraps up the creation and destruction of the standard
* set of MathML atoms used during normal MathML handling. This object
* is created when the first MathML content object is created, and
* destroyed when the last such content object is destroyed.
*/
class nsMathMLAtoms {
public:
static void AddRefAtoms();
static void ReleaseAtoms();
// MathML namespace ID, good for the life of the nsMathMLAtoms object
static PRInt32 nameSpaceID;
/* Declare all atoms
The atom names and values are stored in nsMathMLAtomList.h and
are brought to you by the magic of C preprocessing
Add new atoms to nsMathMLAtomList and all support logic will be auto-generated
after a clobber-build within this directory
*/
#define MATHML_ATOM(_name, _value) static nsIAtom* _name;
#include "nsMathMLAtomList.h"
#undef MATHML_ATOM
};
#endif /* nsMathMLAtoms_h___ */

Просмотреть файл

@ -0,0 +1,727 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
*/
/* MathML Operator Dictionary - Auto-generated by operator.pl. Do not edit! */
/* FORMAT
MATHML_OPERATOR(_rank,
_operator,= string value of the operator
_flags, = bitwise: movablelimits|separator|largeop|accent|fence|stretchy|form
_lspace, = leftspace in em
_rspace) = rightspace in em
*/
#ifdef WANT_MATHML_OPERATOR_COUNT
#define NS_MATHML_OPERATOR_COUNT 343
#else
#ifdef WANT_MATHML_OPERATOR_UNICHAR
//Unicode(s),\0// group symbol form
0x0028,0x0000, // 0 ( prefix
0x0029,0x0000, // 0 ) postfix
0x005B,0x0000, // 0 [ prefix
0x005D,0x0000, // 0 ] postfix
0x007B,0x0000, // 0 { prefix
0x007D,0x0000, // 0 } postfix
0x201D,0x0000, // 0 &CloseCurlyDoubleQuote; postfix
0x2019,0x0000, // 0 &CloseCurlyQuote; postfix
0x3008,0x0000, // 0 &LeftAngleBracket; prefix
0xF603,0x0000, // 0 &LeftBracketingBar; prefix
0x2308,0x0000, // 0 &LeftCeiling; prefix
0x301A,0x0000, // 0 &LeftDoubleBracket; prefix
0xF605,0x0000, // 0 &LeftDoubleBracketingBar; prefix
0x230A,0x0000, // 0 &LeftFloor; prefix
0x201C,0x0000, // 0 &OpenCurlyDoubleQuote; prefix
0x2018,0x0000, // 0 &OpenCurlyQuote; prefix
0x3009,0x0000, // 0 &RightAngleBracket; postfix
0xF604,0x0000, // 0 &RightBracketingBar; postfix
0x2309,0x0000, // 0 &RightCeiling; postfix
0x301B,0x0000, // 0 &RightDoubleBracket; postfix
0xF606,0x0000, // 0 &RightDoubleBracketingBar; postfix
0x230B,0x0000, // 0 &RightFloor; postfix
0xE850,0x0000, // 0 &LeftSkeleton; prefix
0xE851,0x0000, // 0 &RightSkeleton; postfix
0xE89C,0x0000, // 1 &InvisibleComma; infix
0x002C,0x0000, // 2 , infix
0xE859,0x0000, // 3 &HorizontalLine; infix
0xE85A,0x0000, // 3 &VerticalLine; infix
0x003B,0x0000, // 4 ; infix
0x003B,0x0000, // 4 ; postfix
0x003A,0x003D,0x0000, // 5 := infix
0xE85B,0x0000, // 5 &Assign; infix
0x2235,0x0000, // 6 &Because; infix
0x2234,0x0000, // 6 &Therefore; infix
0xE85C,0x0000, // 7 &VerticalSeparator; infix
0x002F,0x002F,0x0000, // 8 // infix
0x2237,0x0000, // 9 &Colon; infix
0x0026,0x0000, // 10 &amp; prefix
0x0026,0x0000, // 10 &amp; postfix
0x002A,0x003D,0x0000, // 11 *= infix
0x002D,0x003D,0x0000, // 11 -= infix
0x002B,0x003D,0x0000, // 11 += infix
0x002F,0x003D,0x0000, // 11 /= infix
0x002D,0x003E,0x0000, // 12 -&gt; infix
0x003A,0x0000, // 13 : infix
0x002E,0x002E,0x0000, // 14 .. postfix
0x002E,0x002E,0x002E,0x0000, // 14 ... postfix
0x220B,0x0000, // 15 &SuchThat; infix
0xE30F,0x0000, // 16 &DoubleLeftTee; infix
0x22A8,0x0000, // 16 &DoubleRightTee; infix
0x22A4,0x0000, // 16 &DownTee; infix
0x22A3,0x0000, // 16 &LeftTee; infix
0x22A2,0x0000, // 16 &RightTee; infix
0x21D2,0x0000, // 17 &Implies; infix
0xF524,0x0000, // 17 &RoundImplies; infix
0x007C,0x0000, // 18 | infix
0x007C,0x007C,0x0000, // 18 || infix
0xE375,0x0000, // 18 &Or; infix
0x0026,0x0026,0x0000, // 19 &amp;&amp; infix
0xE374,0x0000, // 19 &And; infix
0x0026,0x0000, // 20 &amp; infix
0x0021,0x0000, // 21 ! prefix
0xE3AC,0x0000, // 21 &Not; prefix
0x2203,0x0000, // 22 &Exists; prefix
0x2200,0x0000, // 22 &ForAll; prefix
0x2204,0x0000, // 22 &NotExists; prefix
0x2208,0x0000, // 23 &Element; infix
0x2209,0x0000, // 23 &NotElement; infix
0x220C,0x0000, // 23 &NotReverseElement; infix
0xE604,0x0000, // 23 &NotSquareSubset; infix
0x22E2,0x0000, // 23 &NotSquareSubsetEqual; infix
0xE615,0x0000, // 23 &NotSquareSuperset; infix
0x22E3,0x0000, // 23 &NotSquareSupersetEqual; infix
0x2284,0x0000, // 23 &NotSubset; infix
0x2288,0x0000, // 23 &NotSubsetEqual; infix
0x2285,0x0000, // 23 &NotSuperset; infix
0x2289,0x0000, // 23 &NotSupersetEqual; infix
0x220B,0x0000, // 23 &ReverseElement; infix
0x228F,0x0000, // 23 &SquareSubset; infix
0x2291,0x0000, // 23 &SquareSubsetEqual; infix
0x2290,0x0000, // 23 &SquareSuperset; infix
0x2292,0x0000, // 23 &SquareSupersetEqual; infix
0x22D0,0x0000, // 23 &Subset; infix
0x2286,0x0000, // 23 &SubsetEqual; infix
0x2283,0x0000, // 23 &Superset; infix
0x2287,0x0000, // 23 &SupersetEqual; infix
0x21D0,0x0000, // 24 &DoubleLeftArrow; infix
0x21D4,0x0000, // 24 &DoubleLeftRightArrow; infix
0x21D2,0x0000, // 24 &DoubleRightArrow; infix
0xF50B,0x0000, // 24 &DownLeftRightVector; infix
0xF50E,0x0000, // 24 &DownLeftTeeVector; infix
0x21BD,0x0000, // 24 &DownLeftVector; infix
0xF50C,0x0000, // 24 &DownLeftVectorBar; infix
0xF50F,0x0000, // 24 &DownRightTeeVector; infix
0x21C1,0x0000, // 24 &DownRightVector; infix
0xF50D,0x0000, // 24 &DownRightVectorBar; infix
0x2190,0x0000, // 24 &LeftArrow; infix
0x21E4,0x0000, // 24 &LeftArrowBar; infix
0x21C6,0x0000, // 24 &LeftArrowRightArrow; infix
0x2194,0x0000, // 24 &LeftRightArrow; infix
0xF505,0x0000, // 24 &LeftRightVector; infix
0x21A4,0x0000, // 24 &LeftTeeArrow; infix
0xF509,0x0000, // 24 &LeftTeeVector; infix
0x21BC,0x0000, // 24 &LeftVector; infix
0xF507,0x0000, // 24 &LeftVectorBar; infix
0x2199,0x0000, // 24 &LowerLeftArrow; infix
0x2198,0x0000, // 24 &LowerRightArrow; infix
0x2192,0x0000, // 24 &RightArrow; infix
0x21E5,0x0000, // 24 &RightArrowBar; infix
0x21C4,0x0000, // 24 &RightArrowLeftArrow; infix
0x21A6,0x0000, // 24 &RightTeeArrow; infix
0xF50A,0x0000, // 24 &RightTeeVector; infix
0x21C0,0x0000, // 24 &RightVector; infix
0xF508,0x0000, // 24 &RightVectorBar; infix
0xE233,0x0000, // 24 &ShortLeftArrow; infix
0xE232,0x0000, // 24 &ShortRightArrow; infix
0x2196,0x0000, // 24 &UpperLeftArrow; infix
0x2197,0x0000, // 24 &UpperRightArrow; infix
0x003D,0x0000, // 25 = infix
0x003C,0x0000, // 25 &lt; infix
0x003E,0x0000, // 25 &gt; infix
0x0021,0x003D,0x0000, // 25 != infix
0x003D,0x003D,0x0000, // 25 == infix
0x003C,0x003D,0x0000, // 25 &lt;= infix
0x003E,0x003D,0x0000, // 25 &gt;= infix
0x2261,0x0000, // 25 &Congruent; infix
0x224D,0x0000, // 25 &CupCap; infix
0x2250,0x0000, // 25 &DotEqual; infix
0x2225,0x0000, // 25 &DoubleVerticalBar; infix
0xF431,0x0000, // 25 &Equal; infix
0x2242,0x0000, // 25 &EqualTilde; infix
0x21CC,0x0000, // 25 &Equilibrium; infix
0x2265,0x0000, // 25 &GreaterEqual; infix
0x22DB,0x0000, // 25 &GreaterEqualLess; infix
0x2267,0x0000, // 25 &GreaterFullEqual; infix
0xE2F7,0x0000, // 25 &GreaterGreater; infix
0x2277,0x0000, // 25 &GreaterLess; infix
0xE2F6,0x0000, // 25 &GreaterSlantEqual; infix
0x2273,0x0000, // 25 &GreaterTilde; infix
0x224E,0x0000, // 25 &HumpDownHump; infix
0x224F,0x0000, // 25 &HumpEqual; infix
0x22B2,0x0000, // 25 &LeftTriangle; infix
0xF410,0x0000, // 25 &LeftTriangleBar; infix
0x22B4,0x0000, // 25 &LeftTriangleEqual; infix
0x2264,0x0000, // 25 &le; infix
0x22DA,0x0000, // 25 &LessEqualGreater; infix
0x2266,0x0000, // 25 &LessFullEqual; infix
0x2276,0x0000, // 25 &LessGreater; infix
0xE2FB,0x0000, // 25 &LessLess; infix
0xE2FA,0x0000, // 25 &LessSlantEqual; infix
0x2272,0x0000, // 25 &LessTilde; infix
0x226B,0x0000, // 25 &NestedGreaterGreater; infix
0x226A,0x0000, // 25 &NestedLessLess; infix
0x2262,0x0000, // 25 &NotCongruent; infix
0x226D,0x0000, // 25 &NotCupCap; infix
0x2226,0x0000, // 25 &NotDoubleVerticalBar; infix
0x2260,0x0000, // 25 &NotEqual; infix
0xE84E,0x0000, // 25 &NotEqualTilde; infix
0x226F,0x0000, // 25 &NotGreater; infix
0xE2A6,0x0000, // 25 &NotGreaterEqual; infix
0x2270,0x0000, // 25 &NotGreaterFullEqual; infix
0xE2CC,0x0000, // 25 &NotGreaterGreater; infix
0x2279,0x0000, // 25 &NotGreaterLess; infix
0x2271,0x0000, // 25 &NotGreaterSlantEqual; infix
0x2275,0x0000, // 25 &NotGreaterTilde; infix
0xE616,0x0000, // 25 &NotHumpDownHump; infix
0xE84D,0x0000, // 25 &NotHumpEqual; infix
0x22EA,0x0000, // 25 &NotLeftTriangle; infix
0xF412,0x0000, // 25 &NotLeftTriangleBar; infix
0x22EC,0x0000, // 25 &NotLeftTriangleEqual; infix
0x226E,0x0000, // 25 &NotLess; infix
0xE2A7,0x0000, // 25 &NotLessEqual; infix
0x2278,0x0000, // 25 &NotLessGreater; infix
0xE2CB,0x0000, // 25 &NotLessLess; infix
0x2270,0x0000, // 25 &NotLessSlantEqual; infix
0x2274,0x0000, // 25 &NotLessTilde; infix
0xF428,0x0000, // 25 &NotNestedGreaterGreater; infix
0xF423,0x0000, // 25 &NotNestedLessLess; infix
0x2280,0x0000, // 25 &NotPrecedes; infix
0xE5DC,0x0000, // 25 &NotPrecedesEqual; infix
0x22E0,0x0000, // 25 &NotPrecedesSlantEqual; infix
0x22EB,0x0000, // 25 &NotRightTriangle; infix
0xF413,0x0000, // 25 &NotRightTriangleBar; infix
0x22ED,0x0000, // 25 &NotRightTriangleEqual; infix
0x2281,0x0000, // 25 &NotSucceeds; infix
0xE5F1,0x0000, // 25 &NotSucceedsEqual; infix
0x22E1,0x0000, // 25 &NotSucceedsSlantEqual; infix
0xE837,0x0000, // 25 &NotSucceedsTilde; infix
0x2241,0x0000, // 25 &NotTilde; infix
0x2244,0x0000, // 25 &NotTildeEqual; infix
0x2247,0x0000, // 25 &NotTildeFullEqual; infix
0x2249,0x0000, // 25 &NotTildeTilde; infix
0x2224,0x0000, // 25 &NotVerticalBar; infix
0x227A,0x0000, // 25 &Precedes; infix
0xE2FE,0x0000, // 25 &PrecedesEqual; infix
0x227C,0x0000, // 25 &PrecedesSlantEqual; infix
0x227E,0x0000, // 25 &PrecedesTilde; infix
0x2237,0x0000, // 25 &Proportion; infix
0x221D,0x0000, // 25 &Proportional; infix
0x21CB,0x0000, // 25 &ReverseEquilibrium; infix
0x22B3,0x0000, // 25 &RightTriangle; infix
0xF411,0x0000, // 25 &RightTriangleBar; infix
0x22B5,0x0000, // 25 &RightTriangleEqual; infix
0x227B,0x0000, // 25 &Succeeds; infix
0x227D,0x0000, // 25 &SucceedsEqual; infix
0x227D,0x0000, // 25 &SucceedsSlantEqual; infix
0x227F,0x0000, // 25 &SucceedsTilde; infix
0x223C,0x0000, // 25 &Tilde; infix
0x2243,0x0000, // 25 &TildeEqual; infix
0x2245,0x0000, // 25 &TildeFullEqual; infix
0x2248,0x0000, // 25 &TildeTilde; infix
0x22A5,0x0000, // 25 &UpTee; infix
0x2223,0x0000, // 25 &VerticalBar; infix
0x2294,0x0000, // 26 &SquareUnion; infix
0x22C3,0x0000, // 26 &Union; infix
0x228E,0x0000, // 26 &UnionPlus; infix
0x002D,0x0000, // 27 - infix
0x002B,0x0000, // 27 + infix
0x22C2,0x0000, // 27 &Intersection; infix
0x2213,0x0000, // 27 &MinusPlus; infix
0x00B1,0x0000, // 27 &PlusMinus; infix
0x2293,0x0000, // 27 &SquareIntersection; infix
0x22C1,0x0000, // 28 &Vee; prefix
0x2296,0x0000, // 28 &CircleMinus; prefix
0x2295,0x0000, // 28 &CirclePlus; prefix
0x2211,0x0000, // 28 &Sum; prefix
0x22C3,0x0000, // 28 &Union; prefix
0x228E,0x0000, // 28 &UnionPlus; prefix
0x006C,0x0069,0x006D,0x0000, // 28 lim prefix
0x006D,0x0061,0x0078,0x0000, // 28 max prefix
0x006D,0x0069,0x006E,0x0000, // 28 min prefix
0x2296,0x0000, // 29 &CircleMinus; infix
0x2295,0x0000, // 29 &CirclePlus; infix
0x2232,0x0000, // 30 &ClockwiseContourIntegral; prefix
0x222E,0x0000, // 30 &ContourIntegral; prefix
0x2233,0x0000, // 30 &CounterClockwiseContourIntegral; prefix
0x222F,0x0000, // 30 &DoubleContourIntegral; prefix
0x222B,0x0000, // 30 &Integral; prefix
0x22D3,0x0000, // 31 &Cup; infix
0x22D2,0x0000, // 32 &Cap; infix
0x2240,0x0000, // 33 &VerticalTilde; infix
0x22C0,0x0000, // 34 &Wedge; prefix
0x2297,0x0000, // 34 &CircleTimes; prefix
0x2210,0x0000, // 34 &Coproduct; prefix
0x220F,0x0000, // 34 &Product; prefix
0x22C2,0x0000, // 34 &Intersection; prefix
0x2210,0x0000, // 35 &Coproduct; infix
0x22C6,0x0000, // 36 &Star; infix
0x2299,0x0000, // 37 &CircleDot; prefix
0x002A,0x0000, // 38 * infix
0xE89E,0x0000, // 38 &InvisibleTimes; infix
0x00B7,0x0000, // 39 &CenterDot; infix
0x2297,0x0000, // 40 &CircleTimes; infix
0x22C1,0x0000, // 41 &Vee; infix
0x22C0,0x0000, // 42 &Wedge; infix
0x22C4,0x0000, // 43 &Diamond; infix
0x2216,0x0000, // 44 &Backslash; infix
0x002F,0x0000, // 45 / infix
0x002D,0x0000, // 46 - prefix
0x002B,0x0000, // 46 + prefix
0x2213,0x0000, // 46 &MinusPlus; prefix
0x00B1,0x0000, // 46 &PlusMinus; prefix
0x002E,0x0000, // 47 . infix
0xE619,0x0000, // 48 &Cross; infix
0x002A,0x002A,0x0000, // 49 ** infix
0x2299,0x0000, // 50 &CircleDot; infix
0x2218,0x0000, // 51 &SmallCircle; infix
0x25A1,0x0000, // 52 &Square; prefix
0x2207,0x0000, // 53 &Del; prefix
0x2202,0x0000, // 53 &PartialD; prefix
0xF74B,0x0000, // 54 &CapitalDifferentialD; prefix
0xF74C,0x0000, // 54 &DifferentialD; prefix
0x221A,0x0000, // 55 &Sqrt; prefix
0x21D3,0x0000, // 56 &DoubleDownArrow; infix
0xE200,0x0000, // 56 &DoubleLongLeftArrow; infix
0xE202,0x0000, // 56 &DoubleLongLeftRightArrow; infix
0xE204,0x0000, // 56 &DoubleLongRightArrow; infix
0x21D1,0x0000, // 56 &DoubleUpArrow; infix
0x21D5,0x0000, // 56 &DoubleUpDownArrow; infix
0x2193,0x0000, // 56 &DownArrow; infix
0xF504,0x0000, // 56 &DownArrowBar; infix
0xE216,0x0000, // 56 &DownArrowUpArrow; infix
0x21A7,0x0000, // 56 &DownTeeArrow; infix
0xF519,0x0000, // 56 &LeftDownTeeVector; infix
0x21C3,0x0000, // 56 &LeftDownVector; infix
0xF517,0x0000, // 56 &LeftDownVectorBar; infix
0xF515,0x0000, // 56 &LeftUpDownVector; infix
0xF518,0x0000, // 56 &LeftUpTeeVector; infix
0x21BF,0x0000, // 56 &LeftUpVector; infix
0xF516,0x0000, // 56 &LeftUpVectorBar; infix
0xE201,0x0000, // 56 &LongLeftArrow; infix
0xE203,0x0000, // 56 &LongLeftRightArrow; infix
0xE205,0x0000, // 56 &LongRightArrow; infix
0xE217,0x0000, // 56 &ReverseUpEquilibrium; infix
0xF514,0x0000, // 56 &RightDownTeeVector; infix
0x21C2,0x0000, // 56 &RightDownVector; infix
0xF512,0x0000, // 56 &RightDownVectorBar; infix
0xF510,0x0000, // 56 &RightUpDownVector; infix
0xF513,0x0000, // 56 &RightUpTeeVector; infix
0x21BE,0x0000, // 56 &RightUpVector; infix
0xF511,0x0000, // 56 &RightUpVectorBar; infix
0xE87F,0x0000, // 56 &ShortDownArrow; infix
0xE880,0x0000, // 56 &ShortUpArrow; infix
0x2191,0x0000, // 56 &UpArrow; infix
0xF503,0x0000, // 56 &UpArrowBar; infix
0x21C5,0x0000, // 56 &UpArrowDownArrow; infix
0x2195,0x0000, // 56 &UpDownArrow; infix
0xE218,0x0000, // 56 &UpEquilibrium; infix
0x21A5,0x0000, // 56 &UpTeeArrow; infix
0x005E,0x0000, // 57 ^ infix
0x003C,0x003E,0x0000, // 58 &lt;&gt; infix
0x0027,0x0000, // 59 ' postfix
0x0021,0x0000, // 60 ! postfix
0x0021,0x0021,0x0000, // 60 !! postfix
0x007E,0x0000, // 61 ~ infix
0x0040,0x0000, // 62 @ infix
0x002D,0x002D,0x0000, // 63 -- postfix
0x002D,0x002D,0x0000, // 63 -- prefix
0x002B,0x002B,0x0000, // 63 ++ postfix
0x002B,0x002B,0x0000, // 63 ++ prefix
0xE8A0,0x0000, // 64 &ApplyFunction; infix
0x003F,0x0000, // 65 ? infix
0x005F,0x0000, // 66 _ infix
0x02D8,0x0000, // 67 &Breve; postfix
0x00B8,0x0000, // 67 &Cedilla; postfix
0x0060,0x0000, // 67 &DiacriticalGrave; postfix
0x02D9,0x0000, // 67 &DiacriticalDot; postfix
0x02DD,0x0000, // 67 &DiacriticalDoubleAcute; postfix
0x00B4,0x0000, // 67 &DiacriticalAcute; postfix
0x02DC,0x0000, // 67 &DiacriticalTilde; postfix
0x00A8,0x0000, // 67 &DoubleDot; postfix
0x0311,0x0000, // 67 &DownBreve; postfix
0x02C7,0x0000, // 67 &Hacek; postfix
0x0302,0x0000, // 67 &Hat; postfix
0x00AF,0x0000, // 67 &OverBar; postfix
0xF612,0x0000, // 67 &OverBrace; postfix
0xF614,0x0000, // 67 &OverBracket; postfix
0xF610,0x0000, // 67 &OverParenthesis; postfix
0x20DB,0x0000, // 67 &TripleDot; postfix
0x0332,0x0000, // 67 &UnderBar; postfix
0xF613,0x0000, // 67 &UnderBrace; postfix
0xF615,0x0000, // 67 &UnderBracket; postfix
0xF611,0x0000, // 67 &UnderParenthesis; postfix
#else
MATHML_OPERATOR(0,"(",(2|(1<<2)|(1<<3)),0.0f,0.0f) // 0028 prefix
MATHML_OPERATOR(1,")",(3|(1<<2)|(1<<3)),0.0f,0.0f) // 0029 postfix
MATHML_OPERATOR(2,"[",(2|(1<<2)|(1<<3)),0.0f,0.0f) // 005B prefix
MATHML_OPERATOR(3,"]",(3|(1<<2)|(1<<3)),0.0f,0.0f) // 005D postfix
MATHML_OPERATOR(4,"{",(2|(1<<2)|(1<<3)),0.0f,0.0f) // 007B prefix
MATHML_OPERATOR(5,"}",(3|(1<<2)|(1<<3)),0.0f,0.0f) // 007D postfix
MATHML_OPERATOR(6,"&CloseCurlyDoubleQuote;",(3|(1<<3)),0.0f,0.0f) // 201D postfix
MATHML_OPERATOR(7,"&CloseCurlyQuote;",(3|(1<<3)),0.0f,0.0f) // 2019 postfix
MATHML_OPERATOR(8,"&LeftAngleBracket;",(2|(1<<2)|(1<<3)),0.0f,0.0f) // 3008 prefix
MATHML_OPERATOR(9,"&LeftBracketingBar;",(2|(1<<2)|(1<<3)),0.0f,0.0f) // F603 prefix
MATHML_OPERATOR(10,"&LeftCeiling;",(2|(1<<2)|(1<<3)),0.0f,0.0f) // 2308 prefix
MATHML_OPERATOR(11,"&LeftDoubleBracket;",(2|(1<<2)|(1<<3)),0.0f,0.0f) // 301A prefix
MATHML_OPERATOR(12,"&LeftDoubleBracketingBar;",(2|(1<<2)|(1<<3)),0.0f,0.0f) // F605 prefix
MATHML_OPERATOR(13,"&LeftFloor;",(2|(1<<2)|(1<<3)),0.0f,0.0f) // 230A prefix
MATHML_OPERATOR(14,"&OpenCurlyDoubleQuote;",(2|(1<<3)),0.0f,0.0f) // 201C prefix
MATHML_OPERATOR(15,"&OpenCurlyQuote;",(2|(1<<3)),0.0f,0.0f) // 2018 prefix
MATHML_OPERATOR(16,"&RightAngleBracket;",(3|(1<<2)|(1<<3)),0.0f,0.0f) // 3009 postfix
MATHML_OPERATOR(17,"&RightBracketingBar;",(3|(1<<2)|(1<<3)),0.0f,0.0f) // F604 postfix
MATHML_OPERATOR(18,"&RightCeiling;",(3|(1<<2)|(1<<3)),0.0f,0.0f) // 2309 postfix
MATHML_OPERATOR(19,"&RightDoubleBracket;",(3|(1<<2)|(1<<3)),0.0f,0.0f) // 301B postfix
MATHML_OPERATOR(20,"&RightDoubleBracketingBar;",(3|(1<<2)|(1<<3)),0.0f,0.0f) // F606 postfix
MATHML_OPERATOR(21,"&RightFloor;",(3|(1<<2)|(1<<3)),0.0f,0.0f) // 230B postfix
MATHML_OPERATOR(22,"&LeftSkeleton;",(2|(1<<3)),0.0f,0.0f) // E850 prefix
MATHML_OPERATOR(23,"&RightSkeleton;",(3|(1<<3)),0.0f,0.0f) // E851 postfix
MATHML_OPERATOR(24,"&InvisibleComma;",(1|(1<<6)),0.0f,0.0f) // E89C infix
MATHML_OPERATOR(25,",",(1|(1<<6)),0.0f,.33333f) // 002C infix
MATHML_OPERATOR(26,"&HorizontalLine;",(1|(1<<2)),0.0f,0.0f) // E859 infix
MATHML_OPERATOR(27,"&VerticalLine;",(1|(1<<2)),0.0f,0.0f) // E85A infix
MATHML_OPERATOR(28,";",(1|(1<<6)),0.0f,.27777f) // 003B infix
MATHML_OPERATOR(29,";",(3|(1<<6)),0.0f,0.0f) // 003B postfix
MATHML_OPERATOR(30,":=",1,.27777f,.27777f) // 003A 003D infix
MATHML_OPERATOR(31,"&Assign;",1,.27777f,.27777f) // E85B infix
MATHML_OPERATOR(32,"&Because;",1,.27777f,.27777f) // 2235 infix
MATHML_OPERATOR(33,"&Therefore;",1,.27777f,.27777f) // 2234 infix
MATHML_OPERATOR(34,"&VerticalSeparator;",(1|(1<<2)),.27777f,.27777f) // E85C infix
MATHML_OPERATOR(35,"//",1,.27777f,.27777f) // 002F 002F infix
MATHML_OPERATOR(36,"&Colon;",1,.27777f,.27777f) // 2237 infix
MATHML_OPERATOR(37,"&amp;",2,0.0f,.27777f) // 0026 prefix
MATHML_OPERATOR(38,"&amp;",3,.27777f,0.0f) // 0026 postfix
MATHML_OPERATOR(39,"*=",1,.27777f,.27777f) // 002A 003D infix
MATHML_OPERATOR(40,"-=",1,.27777f,.27777f) // 002D 003D infix
MATHML_OPERATOR(41,"+=",1,.27777f,.27777f) // 002B 003D infix
MATHML_OPERATOR(42,"/=",1,.27777f,.27777f) // 002F 003D infix
MATHML_OPERATOR(43,"-&gt;",1,.27777f,.27777f) // 002D 003E infix
MATHML_OPERATOR(44,":",1,.27777f,.27777f) // 003A infix
MATHML_OPERATOR(45,"..",3,.22222f,0.0f) // 002E 002E postfix
MATHML_OPERATOR(46,"...",3,.22222f,0.0f) // 002E 002E 002E postfix
MATHML_OPERATOR(47,"&SuchThat;",1,.27777f,.27777f) // 220B infix
MATHML_OPERATOR(48,"&DoubleLeftTee;",1,.27777f,.27777f) // E30F infix
MATHML_OPERATOR(49,"&DoubleRightTee;",1,.27777f,.27777f) // 22A8 infix
MATHML_OPERATOR(50,"&DownTee;",1,.27777f,.27777f) // 22A4 infix
MATHML_OPERATOR(51,"&LeftTee;",1,.27777f,.27777f) // 22A3 infix
MATHML_OPERATOR(52,"&RightTee;",1,.27777f,.27777f) // 22A2 infix
MATHML_OPERATOR(53,"&Implies;",(1|(1<<2)),.27777f,.27777f) // 21D2 infix
MATHML_OPERATOR(54,"&RoundImplies;",1,.27777f,.27777f) // F524 infix
MATHML_OPERATOR(55,"|",(1|(1<<2)),.27777f,.27777f) // 007C infix
MATHML_OPERATOR(56,"||",1,.22222f,.22222f) // 007C 007C infix
MATHML_OPERATOR(57,"&Or;",(1|(1<<2)),.22222f,.22222f) // E375 infix
MATHML_OPERATOR(58,"&amp;&amp;",1,.27777f,.27777f) // 0026 0026 infix
MATHML_OPERATOR(59,"&And;",(1|(1<<2)),.22222f,.22222f) // E374 infix
MATHML_OPERATOR(60,"&amp;",1,.27777f,.27777f) // 0026 infix
MATHML_OPERATOR(61,"!",2,0.0f,.27777f) // 0021 prefix
MATHML_OPERATOR(62,"&Not;",2,0.0f,.27777f) // E3AC prefix
MATHML_OPERATOR(63,"&Exists;",2,0.0f,.27777f) // 2203 prefix
MATHML_OPERATOR(64,"&ForAll;",2,0.0f,.27777f) // 2200 prefix
MATHML_OPERATOR(65,"&NotExists;",2,0.0f,.27777f) // 2204 prefix
MATHML_OPERATOR(66,"&Element;",1,.27777f,.27777f) // 2208 infix
MATHML_OPERATOR(67,"&NotElement;",1,.27777f,.27777f) // 2209 infix
MATHML_OPERATOR(68,"&NotReverseElement;",1,.27777f,.27777f) // 220C infix
MATHML_OPERATOR(69,"&NotSquareSubset;",1,.27777f,.27777f) // E604 infix
MATHML_OPERATOR(70,"&NotSquareSubsetEqual;",1,.27777f,.27777f) // 22E2 infix
MATHML_OPERATOR(71,"&NotSquareSuperset;",1,.27777f,.27777f) // E615 infix
MATHML_OPERATOR(72,"&NotSquareSupersetEqual;",1,.27777f,.27777f) // 22E3 infix
MATHML_OPERATOR(73,"&NotSubset;",1,.27777f,.27777f) // 2284 infix
MATHML_OPERATOR(74,"&NotSubsetEqual;",1,.27777f,.27777f) // 2288 infix
MATHML_OPERATOR(75,"&NotSuperset;",1,.27777f,.27777f) // 2285 infix
MATHML_OPERATOR(76,"&NotSupersetEqual;",1,.27777f,.27777f) // 2289 infix
MATHML_OPERATOR(77,"&ReverseElement;",1,.27777f,.27777f) // 220B infix
MATHML_OPERATOR(78,"&SquareSubset;",1,.27777f,.27777f) // 228F infix
MATHML_OPERATOR(79,"&SquareSubsetEqual;",1,.27777f,.27777f) // 2291 infix
MATHML_OPERATOR(80,"&SquareSuperset;",1,.27777f,.27777f) // 2290 infix
MATHML_OPERATOR(81,"&SquareSupersetEqual;",1,.27777f,.27777f) // 2292 infix
MATHML_OPERATOR(82,"&Subset;",1,.27777f,.27777f) // 22D0 infix
MATHML_OPERATOR(83,"&SubsetEqual;",1,.27777f,.27777f) // 2286 infix
MATHML_OPERATOR(84,"&Superset;",1,.27777f,.27777f) // 2283 infix
MATHML_OPERATOR(85,"&SupersetEqual;",1,.27777f,.27777f) // 2287 infix
MATHML_OPERATOR(86,"&DoubleLeftArrow;",(1|(1<<2)),.27777f,.27777f) // 21D0 infix
MATHML_OPERATOR(87,"&DoubleLeftRightArrow;",(1|(1<<2)),.27777f,.27777f) // 21D4 infix
MATHML_OPERATOR(88,"&DoubleRightArrow;",(1|(1<<2)),.27777f,.27777f) // 21D2 infix
MATHML_OPERATOR(89,"&DownLeftRightVector;",(1|(1<<2)),.27777f,.27777f) // F50B infix
MATHML_OPERATOR(90,"&DownLeftTeeVector;",(1|(1<<2)),.27777f,.27777f) // F50E infix
MATHML_OPERATOR(91,"&DownLeftVector;",(1|(1<<2)),.27777f,.27777f) // 21BD infix
MATHML_OPERATOR(92,"&DownLeftVectorBar;",(1|(1<<2)),.27777f,.27777f) // F50C infix
MATHML_OPERATOR(93,"&DownRightTeeVector;",(1|(1<<2)),.27777f,.27777f) // F50F infix
MATHML_OPERATOR(94,"&DownRightVector;",(1|(1<<2)),.27777f,.27777f) // 21C1 infix
MATHML_OPERATOR(95,"&DownRightVectorBar;",(1|(1<<2)),.27777f,.27777f) // F50D infix
MATHML_OPERATOR(96,"&LeftArrow;",(1|(1<<2)),.27777f,.27777f) // 2190 infix
MATHML_OPERATOR(97,"&LeftArrowBar;",(1|(1<<2)),.27777f,.27777f) // 21E4 infix
MATHML_OPERATOR(98,"&LeftArrowRightArrow;",(1|(1<<2)),.27777f,.27777f) // 21C6 infix
MATHML_OPERATOR(99,"&LeftRightArrow;",(1|(1<<2)),.27777f,.27777f) // 2194 infix
MATHML_OPERATOR(100,"&LeftRightVector;",(1|(1<<2)),.27777f,.27777f) // F505 infix
MATHML_OPERATOR(101,"&LeftTeeArrow;",(1|(1<<2)),.27777f,.27777f) // 21A4 infix
MATHML_OPERATOR(102,"&LeftTeeVector;",(1|(1<<2)),.27777f,.27777f) // F509 infix
MATHML_OPERATOR(103,"&LeftVector;",(1|(1<<2)),.27777f,.27777f) // 21BC infix
MATHML_OPERATOR(104,"&LeftVectorBar;",(1|(1<<2)),.27777f,.27777f) // F507 infix
MATHML_OPERATOR(105,"&LowerLeftArrow;",(1|(1<<2)),.27777f,.27777f) // 2199 infix
MATHML_OPERATOR(106,"&LowerRightArrow;",(1|(1<<2)),.27777f,.27777f) // 2198 infix
MATHML_OPERATOR(107,"&RightArrow;",(1|(1<<2)),.27777f,.27777f) // 2192 infix
MATHML_OPERATOR(108,"&RightArrowBar;",(1|(1<<2)),.27777f,.27777f) // 21E5 infix
MATHML_OPERATOR(109,"&RightArrowLeftArrow;",(1|(1<<2)),.27777f,.27777f) // 21C4 infix
MATHML_OPERATOR(110,"&RightTeeArrow;",(1|(1<<2)),.27777f,.27777f) // 21A6 infix
MATHML_OPERATOR(111,"&RightTeeVector;",(1|(1<<2)),.27777f,.27777f) // F50A infix
MATHML_OPERATOR(112,"&RightVector;",(1|(1<<2)),.27777f,.27777f) // 21C0 infix
MATHML_OPERATOR(113,"&RightVectorBar;",(1|(1<<2)),.27777f,.27777f) // F508 infix
MATHML_OPERATOR(114,"&ShortLeftArrow;",1,.27777f,.27777f) // E233 infix
MATHML_OPERATOR(115,"&ShortRightArrow;",1,.27777f,.27777f) // E232 infix
MATHML_OPERATOR(116,"&UpperLeftArrow;",(1|(1<<2)),.27777f,.27777f) // 2196 infix
MATHML_OPERATOR(117,"&UpperRightArrow;",(1|(1<<2)),.27777f,.27777f) // 2197 infix
MATHML_OPERATOR(118,"=",1,.27777f,.27777f) // 003D infix
MATHML_OPERATOR(119,"&lt;",1,.27777f,.27777f) // 003C infix
MATHML_OPERATOR(120,"&gt;",1,.27777f,.27777f) // 003E infix
MATHML_OPERATOR(121,"!=",1,.27777f,.27777f) // 0021 003D infix
MATHML_OPERATOR(122,"==",1,.27777f,.27777f) // 003D 003D infix
MATHML_OPERATOR(123,"&lt;=",1,.27777f,.27777f) // 003C 003D infix
MATHML_OPERATOR(124,"&gt;=",1,.27777f,.27777f) // 003E 003D infix
MATHML_OPERATOR(125,"&Congruent;",1,.27777f,.27777f) // 2261 infix
MATHML_OPERATOR(126,"&CupCap;",1,.27777f,.27777f) // 224D infix
MATHML_OPERATOR(127,"&DotEqual;",1,.27777f,.27777f) // 2250 infix
MATHML_OPERATOR(128,"&DoubleVerticalBar;",1,.27777f,.27777f) // 2225 infix
MATHML_OPERATOR(129,"&Equal;",1,.27777f,.27777f) // F431 infix
MATHML_OPERATOR(130,"&EqualTilde;",1,.27777f,.27777f) // 2242 infix
MATHML_OPERATOR(131,"&Equilibrium;",(1|(1<<2)),.27777f,.27777f) // 21CC infix
MATHML_OPERATOR(132,"&GreaterEqual;",1,.27777f,.27777f) // 2265 infix
MATHML_OPERATOR(133,"&GreaterEqualLess;",1,.27777f,.27777f) // 22DB infix
MATHML_OPERATOR(134,"&GreaterFullEqual;",1,.27777f,.27777f) // 2267 infix
MATHML_OPERATOR(135,"&GreaterGreater;",1,.27777f,.27777f) // E2F7 infix
MATHML_OPERATOR(136,"&GreaterLess;",1,.27777f,.27777f) // 2277 infix
MATHML_OPERATOR(137,"&GreaterSlantEqual;",1,.27777f,.27777f) // E2F6 infix
MATHML_OPERATOR(138,"&GreaterTilde;",1,.27777f,.27777f) // 2273 infix
MATHML_OPERATOR(139,"&HumpDownHump;",1,.27777f,.27777f) // 224E infix
MATHML_OPERATOR(140,"&HumpEqual;",1,.27777f,.27777f) // 224F infix
MATHML_OPERATOR(141,"&LeftTriangle;",1,.27777f,.27777f) // 22B2 infix
MATHML_OPERATOR(142,"&LeftTriangleBar;",1,.27777f,.27777f) // F410 infix
MATHML_OPERATOR(143,"&LeftTriangleEqual;",1,.27777f,.27777f) // 22B4 infix
MATHML_OPERATOR(144,"&le;",1,.27777f,.27777f) // 2264 infix
MATHML_OPERATOR(145,"&LessEqualGreater;",1,.27777f,.27777f) // 22DA infix
MATHML_OPERATOR(146,"&LessFullEqual;",1,.27777f,.27777f) // 2266 infix
MATHML_OPERATOR(147,"&LessGreater;",1,.27777f,.27777f) // 2276 infix
MATHML_OPERATOR(148,"&LessLess;",1,.27777f,.27777f) // E2FB infix
MATHML_OPERATOR(149,"&LessSlantEqual;",1,.27777f,.27777f) // E2FA infix
MATHML_OPERATOR(150,"&LessTilde;",1,.27777f,.27777f) // 2272 infix
MATHML_OPERATOR(151,"&NestedGreaterGreater;",1,.27777f,.27777f) // 226B infix
MATHML_OPERATOR(152,"&NestedLessLess;",1,.27777f,.27777f) // 226A infix
MATHML_OPERATOR(153,"&NotCongruent;",1,.27777f,.27777f) // 2262 infix
MATHML_OPERATOR(154,"&NotCupCap;",1,.27777f,.27777f) // 226D infix
MATHML_OPERATOR(155,"&NotDoubleVerticalBar;",1,.27777f,.27777f) // 2226 infix
MATHML_OPERATOR(156,"&NotEqual;",1,.27777f,.27777f) // 2260 infix
MATHML_OPERATOR(157,"&NotEqualTilde;",1,.27777f,.27777f) // E84E infix
MATHML_OPERATOR(158,"&NotGreater;",1,.27777f,.27777f) // 226F infix
MATHML_OPERATOR(159,"&NotGreaterEqual;",1,.27777f,.27777f) // E2A6 infix
MATHML_OPERATOR(160,"&NotGreaterFullEqual;",1,.27777f,.27777f) // 2270 infix
MATHML_OPERATOR(161,"&NotGreaterGreater;",1,.27777f,.27777f) // E2CC infix
MATHML_OPERATOR(162,"&NotGreaterLess;",1,.27777f,.27777f) // 2279 infix
MATHML_OPERATOR(163,"&NotGreaterSlantEqual;",1,.27777f,.27777f) // 2271 infix
MATHML_OPERATOR(164,"&NotGreaterTilde;",1,.27777f,.27777f) // 2275 infix
MATHML_OPERATOR(165,"&NotHumpDownHump;",1,.27777f,.27777f) // E616 infix
MATHML_OPERATOR(166,"&NotHumpEqual;",1,.27777f,.27777f) // E84D infix
MATHML_OPERATOR(167,"&NotLeftTriangle;",1,.27777f,.27777f) // 22EA infix
MATHML_OPERATOR(168,"&NotLeftTriangleBar;",1,.27777f,.27777f) // F412 infix
MATHML_OPERATOR(169,"&NotLeftTriangleEqual;",1,.27777f,.27777f) // 22EC infix
MATHML_OPERATOR(170,"&NotLess;",1,.27777f,.27777f) // 226E infix
MATHML_OPERATOR(171,"&NotLessEqual;",1,.27777f,.27777f) // E2A7 infix
MATHML_OPERATOR(172,"&NotLessGreater;",1,.27777f,.27777f) // 2278 infix
MATHML_OPERATOR(173,"&NotLessLess;",1,.27777f,.27777f) // E2CB infix
MATHML_OPERATOR(174,"&NotLessSlantEqual;",1,.27777f,.27777f) // 2270 infix
MATHML_OPERATOR(175,"&NotLessTilde;",1,.27777f,.27777f) // 2274 infix
MATHML_OPERATOR(176,"&NotNestedGreaterGreater;",1,.27777f,.27777f) // F428 infix
MATHML_OPERATOR(177,"&NotNestedLessLess;",1,.27777f,.27777f) // F423 infix
MATHML_OPERATOR(178,"&NotPrecedes;",1,.27777f,.27777f) // 2280 infix
MATHML_OPERATOR(179,"&NotPrecedesEqual;",1,.27777f,.27777f) // E5DC infix
MATHML_OPERATOR(180,"&NotPrecedesSlantEqual;",1,.27777f,.27777f) // 22E0 infix
MATHML_OPERATOR(181,"&NotRightTriangle;",1,.27777f,.27777f) // 22EB infix
MATHML_OPERATOR(182,"&NotRightTriangleBar;",1,.27777f,.27777f) // F413 infix
MATHML_OPERATOR(183,"&NotRightTriangleEqual;",1,.27777f,.27777f) // 22ED infix
MATHML_OPERATOR(184,"&NotSucceeds;",1,.27777f,.27777f) // 2281 infix
MATHML_OPERATOR(185,"&NotSucceedsEqual;",1,.27777f,.27777f) // E5F1 infix
MATHML_OPERATOR(186,"&NotSucceedsSlantEqual;",1,.27777f,.27777f) // 22E1 infix
MATHML_OPERATOR(187,"&NotSucceedsTilde;",1,.27777f,.27777f) // E837 infix
MATHML_OPERATOR(188,"&NotTilde;",1,.27777f,.27777f) // 2241 infix
MATHML_OPERATOR(189,"&NotTildeEqual;",1,.27777f,.27777f) // 2244 infix
MATHML_OPERATOR(190,"&NotTildeFullEqual;",1,.27777f,.27777f) // 2247 infix
MATHML_OPERATOR(191,"&NotTildeTilde;",1,.27777f,.27777f) // 2249 infix
MATHML_OPERATOR(192,"&NotVerticalBar;",1,.27777f,.27777f) // 2224 infix
MATHML_OPERATOR(193,"&Precedes;",1,.27777f,.27777f) // 227A infix
MATHML_OPERATOR(194,"&PrecedesEqual;",1,.27777f,.27777f) // E2FE infix
MATHML_OPERATOR(195,"&PrecedesSlantEqual;",1,.27777f,.27777f) // 227C infix
MATHML_OPERATOR(196,"&PrecedesTilde;",1,.27777f,.27777f) // 227E infix
MATHML_OPERATOR(197,"&Proportion;",1,.27777f,.27777f) // 2237 infix
MATHML_OPERATOR(198,"&Proportional;",1,.27777f,.27777f) // 221D infix
MATHML_OPERATOR(199,"&ReverseEquilibrium;",(1|(1<<2)),.27777f,.27777f) // 21CB infix
MATHML_OPERATOR(200,"&RightTriangle;",1,.27777f,.27777f) // 22B3 infix
MATHML_OPERATOR(201,"&RightTriangleBar;",1,.27777f,.27777f) // F411 infix
MATHML_OPERATOR(202,"&RightTriangleEqual;",1,.27777f,.27777f) // 22B5 infix
MATHML_OPERATOR(203,"&Succeeds;",1,.27777f,.27777f) // 227B infix
MATHML_OPERATOR(204,"&SucceedsEqual;",1,.27777f,.27777f) // 227D infix
MATHML_OPERATOR(205,"&SucceedsSlantEqual;",1,.27777f,.27777f) // 227D infix
MATHML_OPERATOR(206,"&SucceedsTilde;",1,.27777f,.27777f) // 227F infix
MATHML_OPERATOR(207,"&Tilde;",1,.27777f,.27777f) // 223C infix
MATHML_OPERATOR(208,"&TildeEqual;",1,.27777f,.27777f) // 2243 infix
MATHML_OPERATOR(209,"&TildeFullEqual;",1,.27777f,.27777f) // 2245 infix
MATHML_OPERATOR(210,"&TildeTilde;",1,.27777f,.27777f) // 2248 infix
MATHML_OPERATOR(211,"&UpTee;",1,.27777f,.27777f) // 22A5 infix
MATHML_OPERATOR(212,"&VerticalBar;",1,.27777f,.27777f) // 2223 infix
MATHML_OPERATOR(213,"&SquareUnion;",(1|(1<<2)),.22222f,.22222f) // 2294 infix
MATHML_OPERATOR(214,"&Union;",(1|(1<<2)),.22222f,.22222f) // 22C3 infix
MATHML_OPERATOR(215,"&UnionPlus;",(1|(1<<2)),.22222f,.22222f) // 228E infix
MATHML_OPERATOR(216,"-",1,.22222f,.22222f) // 002D infix
MATHML_OPERATOR(217,"+",1,.22222f,.22222f) // 002B infix
MATHML_OPERATOR(218,"&Intersection;",(1|(1<<2)),.22222f,.22222f) // 22C2 infix
MATHML_OPERATOR(219,"&MinusPlus;",1,.22222f,.22222f) // 2213 infix
MATHML_OPERATOR(220,"&PlusMinus;",1,.22222f,.22222f) // 00B1 infix
MATHML_OPERATOR(221,"&SquareIntersection;",(1|(1<<2)),.22222f,.22222f) // 2293 infix
MATHML_OPERATOR(222,"&Vee;",(2|(1<<2)|(1<<5)),0.0f,.16666f) // 22C1 prefix
MATHML_OPERATOR(223,"&CircleMinus;",(2|(1<<5)),0.0f,.16666f) // 2296 prefix
MATHML_OPERATOR(224,"&CirclePlus;",(2|(1<<5)),0.0f,.16666f) // 2295 prefix
MATHML_OPERATOR(225,"&Sum;",(2|(1<<2)|(1<<5)),0.0f,.16666f) // 2211 prefix
MATHML_OPERATOR(226,"&Union;",(2|(1<<2)|(1<<5)),0.0f,.16666f) // 22C3 prefix
MATHML_OPERATOR(227,"&UnionPlus;",(2|(1<<2)|(1<<5)),0.0f,.16666f) // 228E prefix
MATHML_OPERATOR(228,"lim",2,0.0f,.16666f) // 006C 0069 006D prefix
MATHML_OPERATOR(229,"max",2,0.0f,.16666f) // 006D 0061 0078 prefix
MATHML_OPERATOR(230,"min",2,0.0f,.16666f) // 006D 0069 006E prefix
MATHML_OPERATOR(231,"&CircleMinus;",1,.16666f,.16666f) // 2296 infix
MATHML_OPERATOR(232,"&CirclePlus;",1,.16666f,.16666f) // 2295 infix
MATHML_OPERATOR(233,"&ClockwiseContourIntegral;",(2|(1<<2)|(1<<5)),0.0f,0.0f) // 2232 prefix
MATHML_OPERATOR(234,"&ContourIntegral;",(2|(1<<2)|(1<<5)),0.0f,0.0f) // 222E prefix
MATHML_OPERATOR(235,"&CounterClockwiseContourIntegral;",(2|(1<<2)|(1<<5)),0.0f,0.0f) // 2233 prefix
MATHML_OPERATOR(236,"&DoubleContourIntegral;",(2|(1<<2)|(1<<5)),0.0f,0.0f) // 222F prefix
MATHML_OPERATOR(237,"&Integral;",(2|(1<<2)|(1<<5)),0.0f,0.0f) // 222B prefix
MATHML_OPERATOR(238,"&Cup;",1,.16666f,.16666f) // 22D3 infix
MATHML_OPERATOR(239,"&Cap;",1,.16666f,.16666f) // 22D2 infix
MATHML_OPERATOR(240,"&VerticalTilde;",1,.16666f,.16666f) // 2240 infix
MATHML_OPERATOR(241,"&Wedge;",(2|(1<<2)|(1<<5)),0.0f,.16666f) // 22C0 prefix
MATHML_OPERATOR(242,"&CircleTimes;",(2|(1<<5)),0.0f,.16666f) // 2297 prefix
MATHML_OPERATOR(243,"&Coproduct;",(2|(1<<2)|(1<<5)),0.0f,.16666f) // 2210 prefix
MATHML_OPERATOR(244,"&Product;",(2|(1<<2)|(1<<5)),0.0f,.16666f) // 220F prefix
MATHML_OPERATOR(245,"&Intersection;",(2|(1<<2)|(1<<5)),0.0f,.16666f) // 22C2 prefix
MATHML_OPERATOR(246,"&Coproduct;",1,.16666f,.16666f) // 2210 infix
MATHML_OPERATOR(247,"&Star;",1,.16666f,.16666f) // 22C6 infix
MATHML_OPERATOR(248,"&CircleDot;",(2|(1<<5)),0.0f,.16666f) // 2299 prefix
MATHML_OPERATOR(249,"*",1,.16666f,.16666f) // 002A infix
MATHML_OPERATOR(250,"&InvisibleTimes;",1,0.0f,0.0f) // E89E infix
MATHML_OPERATOR(251,"&CenterDot;",1,.16666f,.16666f) // 00B7 infix
MATHML_OPERATOR(252,"&CircleTimes;",1,.16666f,.16666f) // 2297 infix
MATHML_OPERATOR(253,"&Vee;",1,.16666f,.16666f) // 22C1 infix
MATHML_OPERATOR(254,"&Wedge;",1,.16666f,.16666f) // 22C0 infix
MATHML_OPERATOR(255,"&Diamond;",1,.16666f,.16666f) // 22C4 infix
MATHML_OPERATOR(256,"&Backslash;",(1|(1<<2)),.16666f,.16666f) // 2216 infix
MATHML_OPERATOR(257,"/",(1|(1<<2)),.16666f,.16666f) // 002F infix
MATHML_OPERATOR(258,"-",2,0.0f,.05555f) // 002D prefix
MATHML_OPERATOR(259,"+",2,0.0f,.05555f) // 002B prefix
MATHML_OPERATOR(260,"&MinusPlus;",2,0.0f,.05555f) // 2213 prefix
MATHML_OPERATOR(261,"&PlusMinus;",2,0.0f,.05555f) // 00B1 prefix
MATHML_OPERATOR(262,".",1,0.0f,0.0f) // 002E infix
MATHML_OPERATOR(263,"&Cross;",1,.11111f,.11111f) // E619 infix
MATHML_OPERATOR(264,"**",1,.11111f,.11111f) // 002A 002A infix
MATHML_OPERATOR(265,"&CircleDot;",1,.11111f,.11111f) // 2299 infix
MATHML_OPERATOR(266,"&SmallCircle;",1,.11111f,.11111f) // 2218 infix
MATHML_OPERATOR(267,"&Square;",2,0.0f,.11111f) // 25A1 prefix
MATHML_OPERATOR(268,"&Del;",2,0.0f,.11111f) // 2207 prefix
MATHML_OPERATOR(269,"&PartialD;",2,0.0f,.11111f) // 2202 prefix
MATHML_OPERATOR(270,"&CapitalDifferentialD;",2,0.0f,.11111f) // F74B prefix
MATHML_OPERATOR(271,"&DifferentialD;",2,0.0f,.11111f) // F74C prefix
MATHML_OPERATOR(272,"&Sqrt;",(2|(1<<2)),0.0f,.11111f) // 221A prefix
MATHML_OPERATOR(273,"&DoubleDownArrow;",(1|(1<<2)),.11111f,.11111f) // 21D3 infix
MATHML_OPERATOR(274,"&DoubleLongLeftArrow;",(1|(1<<2)),.11111f,.11111f) // E200 infix
MATHML_OPERATOR(275,"&DoubleLongLeftRightArrow;",(1|(1<<2)),.11111f,.11111f) // E202 infix
MATHML_OPERATOR(276,"&DoubleLongRightArrow;",(1|(1<<2)),.11111f,.11111f) // E204 infix
MATHML_OPERATOR(277,"&DoubleUpArrow;",(1|(1<<2)),.11111f,.11111f) // 21D1 infix
MATHML_OPERATOR(278,"&DoubleUpDownArrow;",(1|(1<<2)),.11111f,.11111f) // 21D5 infix
MATHML_OPERATOR(279,"&DownArrow;",(1|(1<<2)),.11111f,.11111f) // 2193 infix
MATHML_OPERATOR(280,"&DownArrowBar;",(1|(1<<2)),.11111f,.11111f) // F504 infix
MATHML_OPERATOR(281,"&DownArrowUpArrow;",(1|(1<<2)),.11111f,.11111f) // E216 infix
MATHML_OPERATOR(282,"&DownTeeArrow;",(1|(1<<2)),.11111f,.11111f) // 21A7 infix
MATHML_OPERATOR(283,"&LeftDownTeeVector;",(1|(1<<2)),.11111f,.11111f) // F519 infix
MATHML_OPERATOR(284,"&LeftDownVector;",(1|(1<<2)),.11111f,.11111f) // 21C3 infix
MATHML_OPERATOR(285,"&LeftDownVectorBar;",(1|(1<<2)),.11111f,.11111f) // F517 infix
MATHML_OPERATOR(286,"&LeftUpDownVector;",(1|(1<<2)),.11111f,.11111f) // F515 infix
MATHML_OPERATOR(287,"&LeftUpTeeVector;",(1|(1<<2)),.11111f,.11111f) // F518 infix
MATHML_OPERATOR(288,"&LeftUpVector;",(1|(1<<2)),.11111f,.11111f) // 21BF infix
MATHML_OPERATOR(289,"&LeftUpVectorBar;",(1|(1<<2)),.11111f,.11111f) // F516 infix
MATHML_OPERATOR(290,"&LongLeftArrow;",(1|(1<<2)),.11111f,.11111f) // E201 infix
MATHML_OPERATOR(291,"&LongLeftRightArrow;",(1|(1<<2)),.11111f,.11111f) // E203 infix
MATHML_OPERATOR(292,"&LongRightArrow;",(1|(1<<2)),.11111f,.11111f) // E205 infix
MATHML_OPERATOR(293,"&ReverseUpEquilibrium;",(1|(1<<2)),.11111f,.11111f) // E217 infix
MATHML_OPERATOR(294,"&RightDownTeeVector;",(1|(1<<2)),.11111f,.11111f) // F514 infix
MATHML_OPERATOR(295,"&RightDownVector;",(1|(1<<2)),.11111f,.11111f) // 21C2 infix
MATHML_OPERATOR(296,"&RightDownVectorBar;",(1|(1<<2)),.11111f,.11111f) // F512 infix
MATHML_OPERATOR(297,"&RightUpDownVector;",(1|(1<<2)),.11111f,.11111f) // F510 infix
MATHML_OPERATOR(298,"&RightUpTeeVector;",(1|(1<<2)),.11111f,.11111f) // F513 infix
MATHML_OPERATOR(299,"&RightUpVector;",(1|(1<<2)),.11111f,.11111f) // 21BE infix
MATHML_OPERATOR(300,"&RightUpVectorBar;",(1|(1<<2)),.11111f,.11111f) // F511 infix
MATHML_OPERATOR(301,"&ShortDownArrow;",1,.11111f,.11111f) // E87F infix
MATHML_OPERATOR(302,"&ShortUpArrow;",1,.11111f,.11111f) // E880 infix
MATHML_OPERATOR(303,"&UpArrow;",(1|(1<<2)),.11111f,.11111f) // 2191 infix
MATHML_OPERATOR(304,"&UpArrowBar;",(1|(1<<2)),.11111f,.11111f) // F503 infix
MATHML_OPERATOR(305,"&UpArrowDownArrow;",(1|(1<<2)),.11111f,.11111f) // 21C5 infix
MATHML_OPERATOR(306,"&UpDownArrow;",(1|(1<<2)),.11111f,.11111f) // 2195 infix
MATHML_OPERATOR(307,"&UpEquilibrium;",(1|(1<<2)),.11111f,.11111f) // E218 infix
MATHML_OPERATOR(308,"&UpTeeArrow;",(1|(1<<2)),.11111f,.11111f) // 21A5 infix
MATHML_OPERATOR(309,"^",1,.11111f,.11111f) // 005E infix
MATHML_OPERATOR(310,"&lt;&gt;",1,.11111f,.11111f) // 003C 003E infix
MATHML_OPERATOR(311,"'",3,.11111f,0.0f) // 0027 postfix
MATHML_OPERATOR(312,"!",3,.11111f,0.0f) // 0021 postfix
MATHML_OPERATOR(313,"!!",3,.11111f,0.0f) // 0021 0021 postfix
MATHML_OPERATOR(314,"~",1,.11111f,.11111f) // 007E infix
MATHML_OPERATOR(315,"@",1,.11111f,.11111f) // 0040 infix
MATHML_OPERATOR(316,"--",3,.11111f,0.0f) // 002D 002D postfix
MATHML_OPERATOR(317,"--",2,0.0f,.11111f) // 002D 002D prefix
MATHML_OPERATOR(318,"++",3,.11111f,0.0f) // 002B 002B postfix
MATHML_OPERATOR(319,"++",2,0.0f,.11111f) // 002B 002B prefix
MATHML_OPERATOR(320,"&ApplyFunction;",1,0.0f,0.0f) // E8A0 infix
MATHML_OPERATOR(321,"?",1,.11111f,.11111f) // 003F infix
MATHML_OPERATOR(322,"_",1,.11111f,.11111f) // 005F infix
MATHML_OPERATOR(323,"&Breve;",(3|(1<<4)),0.0f,0.0f) // 02D8 postfix
MATHML_OPERATOR(324,"&Cedilla;",(3|(1<<4)),0.0f,0.0f) // 00B8 postfix
MATHML_OPERATOR(325,"&DiacriticalGrave;",(3|(1<<4)),0.0f,0.0f) // 0060 postfix
MATHML_OPERATOR(326,"&DiacriticalDot;",(3|(1<<4)),0.0f,0.0f) // 02D9 postfix
MATHML_OPERATOR(327,"&DiacriticalDoubleAcute;",(3|(1<<4)),0.0f,0.0f) // 02DD postfix
MATHML_OPERATOR(328,"&DiacriticalAcute;",(3|(1<<4)),0.0f,0.0f) // 00B4 postfix
MATHML_OPERATOR(329,"&DiacriticalTilde;",(3|(1<<2)|(1<<4)),0.0f,0.0f) // 02DC postfix
MATHML_OPERATOR(330,"&DoubleDot;",(3|(1<<4)),0.0f,0.0f) // 00A8 postfix
MATHML_OPERATOR(331,"&DownBreve;",(3|(1<<4)),0.0f,0.0f) // 0311 postfix
MATHML_OPERATOR(332,"&Hacek;",(3|(1<<2)|(1<<4)),0.0f,0.0f) // 02C7 postfix
MATHML_OPERATOR(333,"&Hat;",(3|(1<<2)|(1<<4)),0.0f,0.0f) // 0302 postfix
MATHML_OPERATOR(334,"&OverBar;",(3|(1<<2)|(1<<4)),0.0f,0.0f) // 00AF postfix
MATHML_OPERATOR(335,"&OverBrace;",(3|(1<<2)|(1<<4)),0.0f,0.0f) // F612 postfix
MATHML_OPERATOR(336,"&OverBracket;",(3|(1<<2)|(1<<4)),0.0f,0.0f) // F614 postfix
MATHML_OPERATOR(337,"&OverParenthesis;",(3|(1<<2)|(1<<4)),0.0f,0.0f) // F610 postfix
MATHML_OPERATOR(338,"&TripleDot;",(3|(1<<4)),0.0f,0.0f) // 20DB postfix
MATHML_OPERATOR(339,"&UnderBar;",(3|(1<<2)|(1<<4)),0.0f,0.0f) // 0332 postfix
MATHML_OPERATOR(340,"&UnderBrace;",(3|(1<<2)|(1<<4)),0.0f,0.0f) // F613 postfix
MATHML_OPERATOR(341,"&UnderBracket;",(3|(1<<2)|(1<<4)),0.0f,0.0f) // F615 postfix
MATHML_OPERATOR(342,"&UnderParenthesis;",(3|(1<<2)|(1<<4)),0.0f,0.0f) // F611 postfix
#endif
#endif

Просмотреть файл

@ -0,0 +1,283 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
*/
#include "nsString.h"
#include "nsAVLTree.h"
#include "nsMathMLOperators.h"
// get the actual value generated for NS_MATHML_OPERATOR_COUNT
#define WANT_MATHML_OPERATOR_COUNT
#include "nsMathMLOperatorList.h"
#undef WANT_MATHML_OPERATOR_COUNT
// define a zero-separated linear array of all MathML Operators in Unicode
#define WANT_MATHML_OPERATOR_UNICHAR
const PRUnichar kMathMLOperator[] = {
#include "nsMathMLOperatorList.h"
};
#undef WANT_MATHML_OPERATOR_UNICHAR
// operator dictionary entry
struct OperatorNode {
OperatorNode(void)
: mStr(),
mFlags(0),
mLeftSpace(0.0f),
mRightSpace(0.0f)
{
nsStr::Initialize(mStr, eTwoByte); // with MathML, we are two-byte by default
}
OperatorNode(const nsStr& aStringValue, const nsOperatorFlags aFlags)
: mStr(),
mFlags(aFlags),
mLeftSpace(0.0f),
mRightSpace(0.0f)
{ // point to the incomming buffer
// note that the incomming buffer may really be 2 byte
nsStr::Initialize(mStr, aStringValue.mStr, aStringValue.mCapacity,
aStringValue.mLength, aStringValue.mCharSize, PR_FALSE);
}
void
Init(const nsOperatorFlags aFlags,
const float aLeftSpace,
const float aRightSpace)
{
mFlags = aFlags;
mLeftSpace = aLeftSpace;
mRightSpace = aRightSpace;
};
// member data
nsString mStr;
nsOperatorFlags mFlags;
float mLeftSpace; // unit is em
float mRightSpace; // unit is em
};
// index comparitor: based on the string of the operator and its form bits
class OperatorComparitor: public nsAVLNodeComparitor {
public:
virtual ~OperatorComparitor(void) {}
virtual PRInt32 operator()(void* anItem1,void* anItem2) {
OperatorNode* one = (OperatorNode*)anItem1;
OperatorNode* two = (OperatorNode*)anItem2;
PRInt32 rv;
rv = one->mStr.Compare(two->mStr, PR_FALSE);
if (rv == 0) {
nsOperatorFlags form1 = NS_MATHML_OPERATOR_GET_FORM(one->mFlags);
nsOperatorFlags form2 = NS_MATHML_OPERATOR_GET_FORM(two->mFlags);
if (form1 < form2) rv = -1;
else if (form1 > form2) rv = 1;
}
return rv;
}
};
static PRInt32 gTableRefCount;
static OperatorNode* gOperatorArray;
static nsAVLTree* gOperatorTree;
static OperatorComparitor* gComparitor;
void
nsMathMLOperators::AddRefTable(void)
{
if (0 == gTableRefCount++) {
if (! gOperatorArray) {
gOperatorArray = new OperatorNode[NS_MATHML_OPERATOR_COUNT];
gComparitor = new OperatorComparitor();
if (gComparitor) {
gOperatorTree = new nsAVLTree(*gComparitor, nsnull);
}
if (gOperatorArray && gOperatorTree) {
#define MATHML_OPERATOR(_i,_operator,_flags,_lspace,_rspace) \
gOperatorArray[_i].Init(nsOperatorFlags(_flags),float(_lspace),float(_rspace));
#include "nsMathMLOperatorList.h"
#undef MATHML_OPERATOR
const PRUnichar* cp = &kMathMLOperator[0];
PRInt32 i = -1;
while (++i < PRInt32(NS_MATHML_OPERATOR_COUNT)) {
gOperatorArray[i].mStr = *cp++;
while (*cp) { gOperatorArray[i].mStr.Append(*cp++); }
cp++; // skip null separator
gOperatorTree->AddItem(&(gOperatorArray[i]));
}
}
}
}
}
void
nsMathMLOperators::ReleaseTable(void)
{
if (0 == --gTableRefCount) {
if (gOperatorArray) {
delete[] gOperatorArray;
gOperatorArray = nsnull;
}
if (gOperatorTree) {
delete gOperatorTree;
gOperatorTree = nsnull;
}
if (gComparitor) {
delete gComparitor;
gComparitor = nsnull;
}
}
}
PRBool
nsMathMLOperators::LookupOperator(const nsStr& aOperator,
const nsOperatorFlags aForm,
nsOperatorFlags* aFlags,
float* aLeftSpace,
float* aRightSpace)
{
NS_ASSERTION(gOperatorTree, "no lookup table, needs addref");
if (gOperatorTree) {
OperatorNode node(aOperator, aForm);
OperatorNode* found = (OperatorNode*)gOperatorTree->FindItem(&node);
if (found) {
NS_ASSERTION(found->mStr.Equals(aOperator), "bad tree");
*aFlags = found->mFlags;
*aLeftSpace = found->mLeftSpace;
*aRightSpace = found->mRightSpace;
return PR_TRUE;
}
}
return PR_FALSE;
}
#if 0
// DEBUG
// BEGIN TEST CODE:
// code used to test the dictionary
//#include <stdio.h>
void DEBUG_PrintString(const nsString aString)
{
for (PRInt32 i = 0; i<aString.Length(); i++) {
PRUnichar ch = aString.CharAt(i);
if (ch < 0x00FF)
printf("%c", char(ch));
else
printf("[0x%04X]", ch);
}
}
static const char* kJunkOperator[] = {
nsnull,
"",
")(",
"#",
"<!",
"<@>"
};
// define an array of all the flags
#define MATHML_OPERATOR(_i,_operator,_flags,_lspace,_rspace) nsOperatorFlags(_flags),
const nsOperatorFlags kMathMLOperatorFlags[] = {
#include "nsMathMLOperatorList.h"
};
#undef MATHML_OPERATOR
int
TestOperators() {
AddRefTable();
int rv = 0;
// First make sure we can find all of the operators that are supposed to
// be in the table.
extern const PRUnichar kMathMLOperator[];
PRBool found;
nsOperatorFlags flags, form;
float lspace, rspace;
printf("\nChecking the operator dictionary...\n");
nsAutoString aOperator;
nsStr::Initialize(aOperator, eTwoByte);
int i = 0;
const PRUnichar* cp = &kMathMLOperator[0];
while (i < NS_MATHML_OPERATOR_COUNT) {
aOperator = *cp++;
while (*cp) { aOperator.Append(*cp++); }
cp++; // skip null separator
form = NS_MATHML_OPERATOR_GET_FORM(kMathMLOperatorFlags[i]);
found = nsMathMLOperators::LookupOperator(aOperator, form,
&flags, &lspace, &rspace);
if (!found) {
printf("bug: can't find operator="); DEBUG_PrintString(aOperator);
rv = -1;
}
if (flags != kMathMLOperatorFlags[i]) {
printf("bug: operator="); DEBUG_PrintString(aOperator);
printf(" .... flags are wrong\n");
getchar();
rv = -1;
}
i++;
if (i<10) {
DEBUG_PrintString(aOperator);
printf(" tested. Press return to continue...");
getchar();
}
}
// Now make sure we don't find some garbage
for (int j = 0; j < (int) (sizeof(kJunkOperator) / sizeof(const char*)); j++) {
const char* name = kJunkOperator[j];
found = nsMathMLOperators::LookupOperator(nsCAutoString(name), form,
&flags, &lspace, &rspace);
if (found) {
printf("bug: found '%s'\n", name ? name : "(null)");
rv = -1;
}
}
printf("%d operators.",i);
printf((rv == 0)? " All tests passed!\n" : " ERROR *** Corrupted Dictionary\n");
ReleaseTable();
return rv;
}
// END TEST CODE
#endif

Просмотреть файл

@ -0,0 +1,105 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
*/
#ifndef nsMathMLOperators_h___
#define nsMathMLOperators_h___
#include "nslayout.h"
#include "nsCoord.h"
typedef PRUint32 nsOperatorFlags;
typedef PRUint32 nsStretchDirection;
#define NS_STRETCH_DIRECTION_HORIZONTAL 0
#define NS_STRETCH_DIRECTION_VERTICAL 1
// Structure used for a char's size and alignment information.
struct nsCharMetrics {
// nscoord leading;
nscoord width, height;
nscoord ascent, descent;
};
// define the bits used in the operator dictionary
#define NS_MATHML_OPERATOR_FORM 0x3 // the last two bits tell us the form
#define NS_MATHML_OPERATOR_FORM_INFIX 1
#define NS_MATHML_OPERATOR_FORM_PREFIX 2
#define NS_MATHML_OPERATOR_FORM_POSTFIX 3
#define NS_MATHML_OPERATOR_STRETCHY (1 << 2)
#define NS_MATHML_OPERATOR_FENCE (1 << 3)
#define NS_MATHML_OPERATOR_ACCENT (1 << 4)
#define NS_MATHML_OPERATOR_LARGEOP (1 << 5)
#define NS_MATHML_OPERATOR_SEPARATOR (1 << 6)
#define NS_MATHML_OPERATOR_MOVABLELIMITS (1 << 7)
// Macros that retrieve those bits
#define NS_MATHML_OPERATOR_GET_FORM(_flags) \
((_flags) & NS_MATHML_OPERATOR_FORM)
#define NS_MATHML_OPERATOR_FORM_IS_INFIX(_flags) \
(NS_MATHML_OPERATOR_FORM_INFIX == ((_flags) & NS_MATHML_OPERATOR_FORM_INFIX))
#define NS_MATHML_OPERATOR_FORM_IS_PREFIX(_flags) \
(NS_MATHML_OPERATOR_FORM_PREFIX == ((_flags) & NS_MATHML_OPERATOR_FORM_PREFIX))
#define NS_MATHML_OPERATOR_FORM_IS_POSTFIX(_flags) \
(NS_MATHML_OPERATOR_FORM_POSTFIX == ((_flags) & NS_MATHML_OPERATOR_FORM_POSTFIX ))
#define NS_MATHML_OPERATOR_IS_STRETCHY(_flags) \
(NS_MATHML_OPERATOR_STRETCHY == ((_flags) & NS_MATHML_OPERATOR_STRETCHY))
#define NS_MATHML_OPERATOR_IS_FENCE(_flags) \
(NS_MATHML_OPERATOR_FENCE == ((_flags) & NS_MATHML_OPERATOR_FENCE))
#define NS_MATHML_OPERATOR_IS_ACCENT(_flags) \
(NS_MATHML_OPERATOR_ACCENT == ((_flags) & NS_MATHML_OPERATOR_ACCENT))
#define NS_MATHML_OPERATOR_IS_LARGEOP(_flags) \
(NS_MATHML_OPERATOR_LARGEOP == ((_flags) & NS_MATHML_OPERATOR_LARGEOP))
#define NS_MATHML_OPERATOR_IS_SEPARATOR(_flags) \
(NS_MATHML_OPERATOR_SEPARATOR == ((_flags) & NS_MATHML_OPERATOR_SEPARATOR))
#define NS_MATHML_OPERATOR_IS_MOVABLELIMITS(_flags) \
(NS_MATHML_OPERATOR_MOVABLELIMITS == ((_flags) & NS_MATHML_OPERATOR_MOVABLELIMITS))
class nsMathMLOperators {
public:
static void AddRefTable(void);
static void ReleaseTable(void);
// Given the string value of an operator and its form (last two bits of flags),
// this method returns true if the operator is found in the operator dictionary.
// Attributes of the operator are returned in the output parameters.
static PRBool LookupOperator(const nsStr& aOperator,
const nsOperatorFlags aForm,
nsOperatorFlags* aFlags,
float* aLeftSpace,
float* aRightSpace);
};
#endif /* nsMathMLOperators_h___ */

Просмотреть файл

@ -0,0 +1,89 @@
/* ********************************************************************** */
/* Implementation of the MathML W3C REC http://www.w3.org/TR/REC-MathML */
/* Section 3. Presentation Markup
3.2 Token Elements
3.2.1 Attributes common to token elements
C- 3.2.2 <mi> -- identifier
C 3.2.3 <mn> -- number
C- 3.2.4 <mo> -- operator, fence, or separator
CSS 3.2.5 <mtext> -- text
3.2.6 <mspace/> -- space
CSS 3.2.7 <ms> -- string literal
3.3 General Layout Schemata
C 3.3.1 <mrow> -- horizontally group any number of subexpressions
C 3.3.2 <mfrac> -- form a fraction from two subexpressions
3.3.3 <msqrt> and <mroot> -- form a radical
3.3.4 <mstyle> -- style change
CSS 3.3.5 <merror> -- enclose a syntax error message from a preprocessor
3.3.6 <mpadded> -- adjust space around content
C 3.3.7 <mphantom> -- make content invisible but preserve its size
3.3.8 <mfenced> -- surround content with a pair of fences
3.4 Script and Limit Schemata
C 3.4.1 <msub> -- attach a subscript to a base
C 3.4.2 <msup> -- attach a superscript to a base
C 3.4.3 <msubsup> -- attach a subscript-superscript pair to a base
C 3.4.4 <munder> -- attach an underscript to a base
C 3.4.5 <mover> -- attach an overscript to a base
C 3.4.6 <munderover> -- attach an underscript-overscript pair to a base
C 3.4.7 <mmultiscripts> -- attach prescripts and tensor indices to a base
3.5 Tables and Matrices
CH 3.5.1 <mtable> -- table or matrix
CH 3.5.2 <mtr> -- row in a table or matrix
CH 3.5.3 <mtd> -- one entry in a table or matrix
3.5.4 <maligngroup/> and <malignmark/> -- alignment markers
3.6 Enlivening Expressions
3.6.1 <maction> -- bind actions to a subexpression
Table of argument requirements
------------------------------
tag number of children
------------------------------
<mrow> 0 or more
<mfrac> 2 (numerator denominator)
<msqrt> 1
<mroot> 2 (base index)
<mstyle> 1
<merror> 1
<mpadded> 1
<mphantom> 1
<mfenced> 0 or more
<msub> 2 (base subscript)
<msup> 2 (base superscript)
<msubsup> 3 (base subscript superscript)
<munder> 2 (base underscript)
<mover> 2 (base overscript)
<munderover> 3 (base underscript overscript)
<mmultiscripts> 1 or more
(base ( subscript superscript ) * [ <mprescripts/> ( presubscript
presuperscript ) * ])
<mtable> 0 or more rows (<mtr>s, inferred if necessary)
<mtr> 0 or more table elements (<mtd>s, inferred if necessary)
<mtd> 1
<maction> 1 or more (argument roles depend on actiontype attribute)
*/
/* NOTES:
Since frames are not refCounted, don't use nsCOMPtr with them
*/
#if 0
// NOTES ----
// border and padding -- study nsHTMLButtonControlFrame.cpp ...
// Text size infos
nsCOMPtr<nsIFontMetrics> fm;
const nsStyleFont* aFont =
(const nsStyleFont*)mStyleContext->GetStyleData(eStyleStruct_Font);
aPresContext->GetMetricsFor(aFont->mFont, getter_AddRefs(fm));
nsAutoString text;
fm->GetHeight([height]);
renderingContext->SetFont(fm);
renderingContext->GetWidth( text, [width] );
fm->GetMaxAscent( [baseline] );
fm->GetMaxDescent( [depth] );
#endif

Просмотреть файл

@ -0,0 +1,526 @@
Up: Table of Contents REC-MathML-19980407; revised 19990707
------------------------------------------------------------------------
Operator Dictionary
The following table gives the suggested dictionary of rendering properties
for operators, fences, separators, and accents in MathML, all of which are
represented by <mo> elements. For brevity, all such elements will be called
simply "operators" in this Appendix.
Format of operator dictionary entries
The operators are divided into groups, which are separated by blank lines
in the listing below. The grouping, and the order of the groups, is
significant for the proper grouping of subexpressions using <mrow> (Section
3.3.1); the rule described there is especially relevant to the automatic
generation of MathML by conversion from other formats for displayed math,
such as TeX, which don't always specify how subexpressions nest.
The format of the table entries is: the <mo> element content between double
quotes (start and end tags not shown), followed by the attribute list in
XML format, starting with the form attribute, followed by the default
rendering attributes which should be used for <mo> elements with the given
content and form attribute.
Any attribute not listed for some entry has its default value, which is
given in parentheses in the table of attributes in Section 3.2.4.
Note that the characters "&" and "<" are represented in the following table
entries by the entity references "&amp;" and "&lt;" respectively, as would
be necessary if they appeared in the content of an actual <mo> element (or
any other MathML or XML element).
For example, the first entry,
"(" form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em"
could be expressed as an <mo> element by:
<mo form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em"> ( </mo>
(note the lack of double quotes around the content, and the whitespace
added around the content for readability, which is optional in MathML).
This entry means that, for MathML renderers which use this suggested
operator dictionary, giving the element <mo form="prefix"> ( </mo> alone,
or simply <mo> ( </mo> in a position for which form="prefix" would be
inferred (see below), is equivalent to giving the element with all
attributes as shown above.
Indexing of operator dictionary
Note that the dictionary is indexed not just by the element content, but by
the element content and form attribute value, together. Operators with more
than one possible form have more than one entry. The MathML specification
describes how the renderer chooses ("infers") which form to use when no
form attribute is given; see "Default value of form attribute" in Section
3.2.4.
Having made that choice, or with the form attribute explicitly specified in
the <mo> element's start tag, the MathML renderer uses the remaining
attributes from the dictionary entry for the appropriate single form of
that operator, ignoring the entries for the other possible forms.
Choice of entity names
Extended characters in MathML (and in the operator dictionary below) are
represented by XML-style entity references using the syntax
"&character-name;"; the complete list of characters and character names is
given in Chapter 6. Many characters can be referred to by more than one
name; often, memorable names composed of full words have been provided in
MathML, as well as one or more names used in other standards, such as
Unicode. The characters in the operators in this dictionary are generally
listed under their full-word names when these exist. For example, the
integral operator is named below by the one-character sequence
"&Integral;", but could equally well be named "&int;". The choice of name
for a given character in MathML has no effect on its rendering.
It is intended that every entity named below appears somewhere in Chapter
6. If this is not true, it is an error in this specification. If such an
error exists, Chapter 6 should be taken as definitive, rather than this
appendix.
Notes on lspace and rspace attributes
The values for lspace and rspace given here range from 0 to 6/18 em in
units of 1/18 em. For the invisible operators whose content is
"&InvisibleTimes;" or "&ApplyFunction;", it is suggested that MathML
renderers choose spacing in a context-sensitive way (which is an exception
to the static values given in the following table). For
<mo>&ApplyFunction;</mo>, the total spacing (lspace + rspace) in
expressions such as "sin x" (where the right operand doesn't start with a
fence) should be greater than 0; for <mo>&InvisibleTimes;</mo>, the total
spacing should be greater than 0 when both operands (or the nearest tokens
on either side, if on the baseline) are identifiers displayed in a
non-slanted font (i.e., under the suggested rules, when both operands are
multi-character identifiers).
Some renderers may wish to use no spacing for most operators appearing in
scripts (i.e. when scriptlevel is greater than 0; see Section 3.3.4), as is
the case in TeX.
------------------------------------------------------------------------
Operator dictionary entries
"(" form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em"
")" form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"[" form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"]" form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"{" form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"}" form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&CloseCurlyDoubleQuote;" form="postfix" fence="true" lspace="0em" rspace="0em"
"&CloseCurlyQuote;" form="postfix" fence="true" lspace="0em" rspace="0em"
"&LeftAngleBracket;" form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&LeftBracketingBar;" form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&LeftCeiling;" form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&LeftDoubleBracket;" form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&LeftDoubleBracketingBar;" form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&LeftFloor;" form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&OpenCurlyDoubleQuote;" form="prefix" fence="true" lspace="0em" rspace="0em"
"&OpenCurlyQuote;" form="prefix" fence="true" lspace="0em" rspace="0em"
"&RightAngleBracket;" form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&RightBracketingBar;" form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&RightCeiling;" form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&RightDoubleBracket;" form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&RightDoubleBracketingBar;" form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&RightFloor;" form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&LeftSkeleton;" form="prefix" fence="true" lspace="0em" rspace="0em"
"&RightSkeleton;" form="postfix" fence="true" lspace="0em" rspace="0em"
"&InvisibleComma;" form="infix" separator="true" lspace="0em" rspace="0em"
"," form="infix" separator="true" lspace="0em" rspace=".33333em"
"&HorizontalLine;" form="infix" stretchy="true" minsize="0" lspace="0em" rspace="0em"
"&VerticalLine;" form="infix" stretchy="true" minsize="0" lspace="0em" rspace="0em"
";" form="infix" separator="true" lspace="0em" rspace=".27777em"
";" form="postfix" separator="true" lspace="0em" rspace="0em"
":=" form="infix" lspace=".27777em" rspace=".27777em"
"&Assign;" form="infix" lspace=".27777em" rspace=".27777em"
"&Because;" form="infix" lspace=".27777em" rspace=".27777em"
"&Therefore;" form="infix" lspace=".27777em" rspace=".27777em"
"&VerticalSeparator;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"//" form="infix" lspace=".27777em" rspace=".27777em"
"&Colon;" form="infix" lspace=".27777em" rspace=".27777em"
"&amp;" form="prefix" lspace="0em" rspace=".27777em"
"&amp;" form="postfix" lspace=".27777em" rspace="0em"
"*=" form="infix" lspace=".27777em" rspace=".27777em"
"-=" form="infix" lspace=".27777em" rspace=".27777em"
"+=" form="infix" lspace=".27777em" rspace=".27777em"
"/=" form="infix" lspace=".27777em" rspace=".27777em"
"->" form="infix" lspace=".27777em" rspace=".27777em"
":" form="infix" lspace=".27777em" rspace=".27777em"
".." form="postfix" lspace=".22222em" rspace="0em"
"..." form="postfix" lspace=".22222em" rspace="0em"
"&SuchThat;" form="infix" lspace=".27777em" rspace=".27777em"
"&DoubleLeftTee;" form="infix" lspace=".27777em" rspace=".27777em"
"&DoubleRightTee;" form="infix" lspace=".27777em" rspace=".27777em"
"&DownTee;" form="infix" lspace=".27777em" rspace=".27777em"
"&LeftTee;" form="infix" lspace=".27777em" rspace=".27777em"
"&RightTee;" form="infix" lspace=".27777em" rspace=".27777em"
"&Implies;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&RoundImplies;" form="infix" lspace=".27777em" rspace=".27777em"
"|" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"||" form="infix" lspace=".22222em" rspace=".22222em"
"&Or;" form="infix" stretchy="true" lspace=".22222em" rspace=".22222em"
"&amp;&amp;" form="infix" lspace=".27777em" rspace=".27777em"
"&And;" form="infix" stretchy="true" lspace=".22222em" rspace=".22222em"
"&amp;" form="infix" lspace=".27777em" rspace=".27777em"
"!" form="prefix" lspace="0em" rspace=".27777em"
"&Not;" form="prefix" lspace="0em" rspace=".27777em"
"&Exists;" form="prefix" lspace="0em" rspace=".27777em"
"&ForAll;" form="prefix" lspace="0em" rspace=".27777em"
"&NotExists;" form="prefix" lspace="0em" rspace=".27777em"
"&Element;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotElement;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotReverseElement;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotSquareSubset;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotSquareSubsetEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotSquareSuperset;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotSquareSupersetEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotSubset;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotSubsetEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotSuperset;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotSupersetEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&ReverseElement;" form="infix" lspace=".27777em" rspace=".27777em"
"&SquareSubset;" form="infix" lspace=".27777em" rspace=".27777em"
"&SquareSubsetEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&SquareSuperset;" form="infix" lspace=".27777em" rspace=".27777em"
"&SquareSupersetEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&Subset;" form="infix" lspace=".27777em" rspace=".27777em"
"&SubsetEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&Superset;" form="infix" lspace=".27777em" rspace=".27777em"
"&SupersetEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&DoubleLeftArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&DoubleLeftRightArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&DoubleRightArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&DownLeftRightVector;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&DownLeftTeeVector;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&DownLeftVector;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&DownLeftVectorBar;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&DownRightTeeVector;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&DownRightVector;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&DownRightVectorBar;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&LeftArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&LeftArrowBar;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&LeftArrowRightArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&LeftRightArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&LeftRightVector;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&LeftTeeArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&LeftTeeVector;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&LeftVector;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&LeftVectorBar;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&LowerLeftArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&LowerRightArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&RightArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&RightArrowBar;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&RightArrowLeftArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&RightTeeArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&RightTeeVector;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&RightVector;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&RightVectorBar;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&ShortLeftArrow;" form="infix" lspace=".27777em" rspace=".27777em"
"&ShortRightArrow;" form="infix" lspace=".27777em" rspace=".27777em"
"&UpperLeftArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&UpperRightArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"=" form="infix" lspace=".27777em" rspace=".27777em"
"&lt;" form="infix" lspace=".27777em" rspace=".27777em"
">" form="infix" lspace=".27777em" rspace=".27777em"
"!=" form="infix" lspace=".27777em" rspace=".27777em"
"==" form="infix" lspace=".27777em" rspace=".27777em"
"&lt;=" form="infix" lspace=".27777em" rspace=".27777em"
">=" form="infix" lspace=".27777em" rspace=".27777em"
"&Congruent;" form="infix" lspace=".27777em" rspace=".27777em"
"&CupCap;" form="infix" lspace=".27777em" rspace=".27777em"
"&DotEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&DoubleVerticalBar;" form="infix" lspace=".27777em" rspace=".27777em"
"&Equal;" form="infix" lspace=".27777em" rspace=".27777em"
"&EqualTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&Equilibrium;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&GreaterEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&GreaterEqualLess;" form="infix" lspace=".27777em" rspace=".27777em"
"&GreaterFullEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&GreaterGreater;" form="infix" lspace=".27777em" rspace=".27777em"
"&GreaterLess;" form="infix" lspace=".27777em" rspace=".27777em"
"&GreaterSlantEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&GreaterTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&HumpDownHump;" form="infix" lspace=".27777em" rspace=".27777em"
"&HumpEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&LeftTriangle;" form="infix" lspace=".27777em" rspace=".27777em"
"&LeftTriangleBar;" form="infix" lspace=".27777em" rspace=".27777em"
"&LeftTriangleEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&le;" form="infix" lspace=".27777em" rspace=".27777em"
"&LessEqualGreater;" form="infix" lspace=".27777em" rspace=".27777em"
"&LessFullEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&LessGreater;" form="infix" lspace=".27777em" rspace=".27777em"
"&LessLess;" form="infix" lspace=".27777em" rspace=".27777em"
"&LessSlantEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&LessTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&NestedGreaterGreater;" form="infix" lspace=".27777em" rspace=".27777em"
"&NestedLessLess;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotCongruent;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotCupCap;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotDoubleVerticalBar;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotEqualTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotGreater;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotGreaterEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotGreaterFullEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotGreaterGreater;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotGreaterLess;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotGreaterSlantEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotGreaterTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotHumpDownHump;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotHumpEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotLeftTriangle;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotLeftTriangleBar;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotLeftTriangleEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotLess;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotLessEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotLessFullEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotLessGreater;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotLessLess;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotLessSlantEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotLessTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotNestedGreaterGreater;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotNestedLessLess;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotPrecedes;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotPrecedesEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotPrecedesSlantEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotPrecedesTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotRightTriangle;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotRightTriangleBar;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotRightTriangleEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotSucceeds;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotSucceedsEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotSucceedsSlantEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotSucceedsTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotTildeEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotTildeFullEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotTildeTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotVerticalBar;" form="infix" lspace=".27777em" rspace=".27777em"
"&Precedes;" form="infix" lspace=".27777em" rspace=".27777em"
"&PrecedesEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&PrecedesSlantEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&PrecedesTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&Proportion;" form="infix" lspace=".27777em" rspace=".27777em"
"&Proportional;" form="infix" lspace=".27777em" rspace=".27777em"
"&ReverseEquilibrium;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&RightTriangle;" form="infix" lspace=".27777em" rspace=".27777em"
"&RightTriangleBar;" form="infix" lspace=".27777em" rspace=".27777em"
"&RightTriangleEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&Succeeds;" form="infix" lspace=".27777em" rspace=".27777em"
"&SucceedsEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&SucceedsSlantEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&SucceedsTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&Tilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&TildeEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&TildeFullEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&TildeTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&UpTee;" form="infix" lspace=".27777em" rspace=".27777em"
"&VerticalBar;" form="infix" lspace=".27777em" rspace=".27777em"
"&SquareUnion;" form="infix" stretchy="true" lspace=".22222em" rspace=".22222em"
"&Union;" form="infix" stretchy="true" lspace=".22222em" rspace=".22222em"
"&UnionPlus;" form="infix" stretchy="true" lspace=".22222em" rspace=".22222em"
"-" form="infix" lspace=".22222em" rspace=".22222em"
"+" form="infix" lspace=".22222em" rspace=".22222em"
"&Intersection;" form="infix" stretchy="true" lspace=".22222em" rspace=".22222em"
"&MinusPlus;" form="infix" lspace=".22222em" rspace=".22222em"
"&PlusMinus;" form="infix" lspace=".22222em" rspace=".22222em"
"&SquareIntersection;" form="infix" stretchy="true" lspace=".22222em" rspace=".22222em"
"&Vee;" form="prefix" largeop="true" movablelimits="true" stretchy="true" lspace="0em" rspace=".16666em"
"&CircleMinus;" form="prefix" largeop="true" movablelimits="true" lspace="0em" rspace=".16666em"
"&CirclePlus;" form="prefix" largeop="true" movablelimits="true" lspace="0em" rspace=".16666em"
"&Sum;" form="prefix" largeop="true" movablelimits="true" stretchy="true" lspace="0em" rspace=".16666em"
"&Union;" form="prefix" largeop="true" movablelimits="true" stretchy="true" lspace="0em" rspace=".16666em"
"&UnionPlus;" form="prefix" largeop="true" movablelimits="true" stretchy="true" lspace="0em" rspace=".16666em"
"lim" form="prefix" movablelimits="true" lspace="0em" rspace=".16666em"
"max" form="prefix" movablelimits="true" lspace="0em" rspace=".16666em"
"min" form="prefix" movablelimits="true" lspace="0em" rspace=".16666em"
"&CircleMinus;" form="infix" lspace=".16666em" rspace=".16666em"
"&CirclePlus;" form="infix" lspace=".16666em" rspace=".16666em"
"&ClockwiseContourIntegral;" form="prefix" largeop="true" stretchy="true" lspace="0em" rspace="0em"
"&ContourIntegral;" form="prefix" largeop="true" stretchy="true" lspace="0em" rspace="0em"
"&CounterClockwiseContourIntegral;" form="prefix" largeop="true" stretchy="true" lspace="0em" rspace="0em"
"&DoubleContourIntegral;" form="prefix" largeop="true" stretchy="true" lspace="0em" rspace="0em"
"&Integral;" form="prefix" largeop="true" stretchy="true" lspace="0em" rspace="0em"
"&Cup;" form="infix" lspace=".16666em" rspace=".16666em"
"&Cap;" form="infix" lspace=".16666em" rspace=".16666em"
"&VerticalTilde;" form="infix" lspace=".16666em" rspace=".16666em"
"&Wedge;" form="prefix" largeop="true" movablelimits="true" stretchy="true" lspace="0em" rspace=".16666em"
"&CircleTimes;" form="prefix" largeop="true" movablelimits="true" lspace="0em" rspace=".16666em"
"&Coproduct;" form="prefix" largeop="true" movablelimits="true" stretchy="true" lspace="0em" rspace=".16666em"
"&Product;" form="prefix" largeop="true" movablelimits="true" stretchy="true" lspace="0em" rspace=".16666em"
"&Intersection;" form="prefix" largeop="true" movablelimits="true" stretchy="true" lspace="0em" rspace=".16666em"
"&Coproduct;" form="infix" lspace=".16666em" rspace=".16666em"
"&Star;" form="infix" lspace=".16666em" rspace=".16666em"
"&CircleDot;" form="prefix" largeop="true" movablelimits="true" lspace="0em" rspace=".16666em"
"*" form="infix" lspace=".16666em" rspace=".16666em"
"&InvisibleTimes;" form="infix" lspace="0em" rspace="0em"
"&CenterDot;" form="infix" lspace=".16666em" rspace=".16666em"
"&CircleTimes;" form="infix" lspace=".16666em" rspace=".16666em"
"&Vee;" form="infix" lspace=".16666em" rspace=".16666em"
"&Wedge;" form="infix" lspace=".16666em" rspace=".16666em"
"&Diamond;" form="infix" lspace=".16666em" rspace=".16666em"
"&Backslash;" form="infix" stretchy="true" lspace=".16666em" rspace=".16666em"
"/" form="infix" stretchy="true" lspace=".16666em" rspace=".16666em"
"-" form="prefix" lspace="0em" rspace=".05555em"
"+" form="prefix" lspace="0em" rspace=".05555em"
"&MinusPlus;" form="prefix" lspace="0em" rspace=".05555em"
"&PlusMinus;" form="prefix" lspace="0em" rspace=".05555em"
"." form="infix" lspace="0em" rspace="0em"
"&Cross;" form="infix" lspace=".11111em" rspace=".11111em"
"**" form="infix" lspace=".11111em" rspace=".11111em"
"&CircleDot;" form="infix" lspace=".11111em" rspace=".11111em"
"&SmallCircle;" form="infix" lspace=".11111em" rspace=".11111em"
"&Square;" form="prefix" lspace="0em" rspace=".11111em"
"&Del;" form="prefix" lspace="0em" rspace=".11111em"
"&PartialD;" form="prefix" lspace="0em" rspace=".11111em"
"&CapitalDifferentialD;" form="prefix" lspace="0em" rspace=".11111em"
"&DifferentialD;" form="prefix" lspace="0em" rspace=".11111em"
"&Sqrt;" form="prefix" stretchy="true" lspace="0em" rspace=".11111em"
"&DoubleDownArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&DoubleLongLeftArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&DoubleLongLeftRightArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&DoubleLongRightArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&DoubleUpArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&DoubleUpDownArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&DownArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&DownArrowBar;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&DownArrowUpArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&DownTeeArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&LeftDownTeeVector;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&LeftDownVector;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&LeftDownVectorBar;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&LeftUpDownVector;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&LeftUpTeeVector;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&LeftUpVector;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&LeftUpVectorBar;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&LongLeftArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&LongLeftRightArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&LongRightArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&ReverseUpEquilibrium;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&RightDownTeeVector;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&RightDownVector;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&RightDownVectorBar;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&RightUpDownVector;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&RightUpTeeVector;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&RightUpVector;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&RightUpVectorBar;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&ShortDownArrow;" form="infix" lspace=".11111em" rspace=".11111em"
"&ShortUpArrow;" form="infix" lspace=".11111em" rspace=".11111em"
"&UpArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&UpArrowBar;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&UpArrowDownArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&UpDownArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&UpEquilibrium;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&UpTeeArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"^" form="infix" lspace=".11111em" rspace=".11111em"
"&lt;>" form="infix" lspace=".11111em" rspace=".11111em"
"'" form="postfix" lspace=".11111em" rspace="0em"
"!" form="postfix" lspace=".11111em" rspace="0em"
"!!" form="postfix" lspace=".11111em" rspace="0em"
"~" form="infix" lspace=".11111em" rspace=".11111em"
"@" form="infix" lspace=".11111em" rspace=".11111em"
"--" form="postfix" lspace=".11111em" rspace="0em"
"--" form="prefix" lspace="0em" rspace=".11111em"
"++" form="postfix" lspace=".11111em" rspace="0em"
"++" form="prefix" lspace="0em" rspace=".11111em"
"&ApplyFunction;" form="infix" lspace="0em" rspace="0em"
"?" form="infix" lspace=".11111em" rspace=".11111em"
"_" form="infix" lspace=".11111em" rspace=".11111em"
"&Breve;" form="postfix" accent="true" lspace="0em" rspace="0em"
"&Cedilla;" form="postfix" accent="true" lspace="0em" rspace="0em"
"&DiacriticalGrave;" form="postfix" accent="true" lspace="0em" rspace="0em"
"&DiacriticalDot;" form="postfix" accent="true" lspace="0em" rspace="0em"
"&DiacriticalDoubleAcute;" form="postfix" accent="true" lspace="0em" rspace="0em"
"&DiacriticalLeftArrow;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&DiacriticalLeftRightArrow;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&DiacriticalLeftRightVector;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&DiacriticalLeftVector;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&DiacriticalAcute;" form="postfix" accent="true" lspace="0em" rspace="0em"
"&DiacriticalRightArrow;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&DiacriticalRightVector;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&DiacriticalTilde;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&DoubleDot;" form="postfix" accent="true" lspace="0em" rspace="0em"
"&DownBreve;" form="postfix" accent="true" lspace="0em" rspace="0em"
"&Hacek;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&Hat;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&OverBar;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&OverBrace;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&OverBracket;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&OverParenthesis;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&TripleDot;" form="postfix" accent="true" lspace="0em" rspace="0em"
"&UnderBar;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&UnderBrace;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&UnderBracket;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&UnderParenthesis;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
------------------------------------------------------------------------
Up: Table of Contents

Просмотреть файл

Просмотреть файл

@ -0,0 +1,138 @@
<?xml version="1.0"?>
<?xml-stylesheet href="mathml.css" type="text/css"?>
<!DOCTYPE math SYSTEM "file:///C:\Mozilla/src/mozilla/layout/mathml/tests/mathml.dtd">
<!--
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University of
* Queensland. Portions created by The University of Queensland are
* Copyright (C) The University of Queensland. All
* Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
-->
<para>
Testing tensor indices &lt;mmultiscripts&gt;:
<math xmlns:math="http://www.w3.org/Math/MathML">
<!-- {3 \atop k} R {1 \atop i} {2 \atop j} -->
<math:mmultiscripts><math:mi>R</math:mi><math:mi>i</math:mi><math:mi>1</math:mi><math:mi>j</math:mi><math:mi>2</math:mi><math:mprescripts/><math:mi>k</math:mi><math:mi>3</math:mi></math:mmultiscripts></math>;
This with &lt;none/&gt;,
<math xmlns:math="http://www.w3.org/Math/MathML">
<!-- {{} \atop i} A {p \atop q} -->
<math:mmultiscripts><math:mi>A</math:mi><math:mi>q</math:mi><math:mi>p</math:mi><math:mprescripts/><math:mi>i</math:mi><none/></math:mmultiscripts></math>;
A bit of calculus
<math xmlns:math="http://www.w3.org/Math/MathML">
<!-- \int_a^b f(x)dx -->
<math:msubsup><math:mo>&Integral;</math:mo><math:mi>a</math:mi><math:mi>b</math:mi></math:msubsup><math:mi>f(x)dx</math:mi>
<!-- \frac{\partial}{\partial x}F(x,y) + \frac{\partial}{\partial y}F(x,y) -->
<math:mrow><math:mfrac><math:mo>&PartialD;</math:mo><math:mrow><math:mo>&PartialD;</math:mo><math:mi>x</math:mi></math:mrow></math:mfrac><math:mi>F(x,y)</math:mi><math:mo>
+ </math:mo><math:mfrac><math:mo>&PartialD;</math:mo><math:mrow><math:mo>&PartialD;</math:mo><math:mi>y</math:mi></math:mrow></math:mfrac><math:mi>F(x,y)</math:mi></math:mrow>
</math>;
Here is the alphabet with invisible
portions wrapped by &lt;mphantom&gt; in between:
<math xmlns:math="http://www.w3.org/Math/MathML">
<math:mi>a</math:mi> <math:mi>b</math:mi> <math:mi>c</math:mi> <math:mphantom><math:mi>d</math:mi> <math:mi>e</math:mi> <math:mi>f</math:mi> <math:mi>g</math:mi>
<math:mi>h</math:mi> <math:mi>i</math:mi> <math:mi>j</math:mi></math:mphantom> <math:mi>k</math:mi> <math:mi>l</math:mi> <math:mi>m</math:mi> <math:mi>n</math:mi>
<math:mi>o</math:mi> <math:mphantom><math:mi>p</math:mi> <math:mi>q</math:mi> <math:mi>r</math:mi> <math:mi>s</math:mi></math:mphantom>
<math:mi>t</math:mi> <math:mi>u</math:mi> <math:mi>v</math:mi> <math:mi>w</math:mi> <math:mi>x</math:mi> <math:mi>y</math:mi> <math:mi>z</math:mi></math>.
Testing MathML &lt;msub&gt;:
<math xmlns:math="http://www.w3.org/Math/MathML">
<!-- a_b -->
<math:msub><math:mi>a</math:mi><math:mi>b</math:mi></math:msub></math>;
<!-- a_i -->
<math xmlns:math="http://www.w3.org/Math/MathML"><math:msub><math:mi>a</math:mi><math:mi>i</math:mi></math:msub></math>;
<!-- A_{I_{k}} -->
<math xmlns:math="http://www.w3.org/Math/MathML"><math:msub><math:mi>A</math:mi><math:msub><math:mi>I</math:mi><math:mi>k</math:mi></math:msub></math:msub></math>;
Testing MathML &lt;msup&gt;:
<math xmlns:math="http://www.w3.org/Math/MathML">
<!-- d^b -->
<math:msup><math:mi>d</math:mi><math:mi>b</math:mi></math:msup>
<!-- 2^{a_x} -->
<math:msup><math:mn>2</math:mn><math:msub><math:mi>a</math:mi><math:mi>x</math:mi></math:msub></math:msup>
<!-- 2^{2^x} -->
<math:msup><math:msup><math:mn>2</math:mn><math:mn>2</math:mn></math:msup><math:mi>x</math:mi></math:msup>
<!-- {\frac{1}{2}}^{y^{a_x}} -->
<math:msup><math:mrow><math:mo>(</math:mo><math:mfrac><math:mn>1</math:mn><math:mn>2</math:mn></math:mfrac><math:mo>)</math:mo></math:mrow><math:msup><math:mi>y</math:mi><math:msub><math:mi>a</math:mi><math:mi>x</math:mi></math:msub></math:msup></math:msup>
</math>.
Testing MathML &lt;munder&gt;, &lt;mover&gt;, and &lt;munderover&gt;:
<math xmlns:math="http://www.w3.org/Math/MathML">
<math:munder><math:mi>abcd</math:mi><math:mi>un</math:mi></math:munder>
<math:mover><math:mi>abcd</math:mi><math:mi>ov</math:mi></math:mover>
<math:munderover><math:mi>abcd</math:mi><math:mi>under</math:mi><math:mi>over</math:mi></math:munderover>
</math>.
Testing MathML &lt;msubsup&gt;:
<math xmlns:math="http://www.w3.org/Math/MathML">
<!-- a_b^c -->
<math:msubsup><math:mi>a</math:mi><math:mi>p</math:mi><math:mi>q</math:mi></math:msubsup>
<math:msubsup><math:mi>a</math:mi><math:mi>b+c</math:mi><math:mi>x</math:mi></math:msubsup>
</math>.
Testing MathML &lt;mrow&gt;:
<math xmlns:math="http://www.w3.org/Math/MathML">
<!-- d^{a/b} -->
<math:msup><math:mi>d</math:mi><math:mrow><math:mo>(</math:mo><math:mfrac><math:mi>a</math:mi><math:mi>b</math:mi></math:mfrac><math:mo>)</math:mo></math:mrow></math:msup>
</math>;
<math xmlns:math="http://www.w3.org/Math/MathML">
<!-- x^2 + 4*x + \frac{p}{q} = 0 -->
<math:mrow>
<math:mrow><math:msup><math:mi>x</math:mi><math:mn>2</math:mn></math:msup><math:mo> + </math:mo>
<math:mrow><math:mn>4</math:mn><math:mo>*</math:mo><math:mi>x</math:mi></math:mrow>
<math:mo> + </math:mo><math:mfrac><math:mi>p</math:mi><math:mi>q</math:mi></math:mfrac></math:mrow>
<math:mo> = </math:mo><math:mn>0</math:mn></math:mrow></math>,
with this &lt;mfrac&gt; hanging here
<math xmlns:math="http://www.w3.org/Math/MathML">
<!-- \frac{d*b^{\frac{i+j}{n!}} + p_y*q}
{p^x*b_x + \frac{a+c}{d}} -->
<math:mfrac><math:mrow><math:mi>d</math:mi><math:mo>*</math:mo><math:msup><math:mi>T</math:mi><math:mrow><math:mo>(</math:mo><math:mfrac><math:mi>i + j</math:mi><math:mi>n</math:mi></math:mfrac><math:mo>)</math:mo></math:mrow></math:msup><math:mo>
+ </math:mo><math:msub><math:mi>p</math:mi><math:mi>y</math:mi></math:msub><math:mo>*</math:mo><math:mi>q</math:mi></math:mrow><math:mrow><math:msup><math:mi>p</math:mi><math:mi>x</math:mi></math:msup><math:mo>*</math:mo><math:msub><math:mi>b</math:mi><math:mi>x</math:mi></math:msub><math:mo>
+ </math:mo><math:mfrac><math:mrow><math:mi>a</math:mi><math:mo>
+ </math:mo><math:mi>c</math:mi></math:mrow><math:mi>d</math:mi></math:mfrac></math:mrow></math:mfrac>
</math>
in the middle of a lot of running text to try to explain what this means to those who care
to read.
Testing MathML merror, mtext,
<math xmlns:math="http://www.w3.org/Math/MathML">
<math:mtext>This is a text in mtext</math:mtext>
<math:merror>This is a text in merror</math:merror>
</math>
</para>

Просмотреть файл

@ -0,0 +1,193 @@
<?xml version="1.0"?>
<!--
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University of
* Queensland. Portions created by The University of Queensland are
* Copyright (C) 1999 The University of Queensland. All
* Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
-->
<para>
Testing MathML msub:
<math xmlns:math="http://www.w3.org/Math/MathML">
<!-- a_b -->
<math:msub>
<math:mi>a</math:mi>
<math:mi>b</math:mi>
</math:msub>
</math>
<math xmlns:math="http://www.w3.org/Math/MathML">
<!-- a_i -->
<math:msub>
<math:mi>a</math:mi>
<math:mi>i</math:mi>
</math:msub>
</math>
Testing MathML msup:
<math xmlns:math="http://www.w3.org/Math/MathML">
<!-- d^b -->
<math:msup>
<math:mi>d</math:mi>
<math:mi>b</math:mi>
</math:msup>
<!-- 2^{a_x} -->
<math:msup>
<math:mn>2</math:mn>
<math:msub>
<math:mn>a</math:mn>
<math:mi>x</math:mi>
</math:msub>
</math:msup>
<!-- 2^{2^x} -->
<math:msup>
<math:msup>
<math:mn>2</math:mn>
<math:mn>2</math:mn>
</math:msup>
<math:mi>x</math:mi>
</math:msup>
<!-- 2^{y^{a_x}} -->
<math:msup>
<math:mn>2</math:mn>
<math:msup>
<math:mn>y</math:mn>
<math:msub>
<math:mi>a</math:mi>
<math:mi>x</math:mi>
</math:msub></math:msup>
</math:msup>
</math>
Testing MathML mrow:
<math xmlns:math="http://www.w3.org/Math/MathML">
<!-- d^{a/b} -->
<math:msup>
<math:mi>d</math:mi>
<math:mrow>
<math:mo>(</math:mo>
<math:mfrac>
<math:mi>a</math:mi>
<math:mi>b</math:mi>
</math:mfrac>
<math:mo>)</math:mo>
</math:mrow>
</math:msup>
</math>
<math xmlns:math="http://www.w3.org/Math/MathML">
<!-- x^2 + 4*x + 4 / \frac{p}{q} = 0 -->
<math:mrow>
<math:mrow>
<math:msup>
<math:mi>x</math:mi>
<math:mn>2</math:mn>
</math:msup>
<math:mo> + </math:mo>
<math:mrow>
<math:mn>4</math:mn>
<math:mo>*</math:mo>
<math:mi>x</math:mi>
</math:mrow>
<math:mo> + </math:mo>
<math:mn>4</math:mn>
<math:mo>/</math:mo>
<math:mfrac>
<math:mi>p</math:mi>
<math:mi>q</math:mi>
</math:mfrac>
</math:mrow>
<math:mo> = </math:mo>
<math:mn>0</math:mn>
</math:mrow>
</math>
and then piling fractions with a user-defined line thickness...
<math xmlns:math="http://www.w3.org/Math/MathML">
<math:mfrac linethickness="2">
<math:mfrac>
<math:mi>alpha</math:mi>
<math:mi>a</math:mi>
</math:mfrac>
<math:mfrac>
<math:mi>beta</math:mi>
<math:mi>b</math:mi>
</math:mfrac>
</math:mfrac>
</math>
<!--
<math xmlns:math="http://www.w3.org/Math/MathML">
<math:mfrac>cdefghijkl
d</math:mfrac>
</math>
-->
<!--
<math xmlns:math="http://www.w3.org/Math/MathML">
<math:mfrac><math:mi>Hello</math:mi><math:mi>World!</math:mi></math:mfrac>
</math>
<math xmlns:math="http://www.w3.org/Math/MathML">
<math:mfrac><math:mi>a</math:mi><math:msup><math:mi>b</math:mi><math:mi>x</math:mi></math:msup></math:mfrac>
<math:mi> + </math:mi>
<math:mfrac><math:mi>c</math:mi><math:mi>d</math:mi></math:mfrac>
</math>
<math xmlns:math="http://www.w3.org/Math/MathML">
<math:mfrac>c
d</math:mfrac>
</math>
and then piling fractions...
<math xmlns:math="http://www.w3.org/Math/MathML">
<math:mfrac linethickness="2"><math:mfrac><math:mi>alpha</math:mi><math:mi>a</math:mi></math:mfrac><math:mfrac><math:mi>beta</math:mi><math:mi>b</math:mi></math:mfrac></math:mfrac>
</math>
... getting better, but still a lot to do. The lizard needs to graduate!
-->
, with this mfrac hanging here
<math xmlns:math="http://www.w3.org/Math/MathML">
<!-- \frac{d*b^{\frac{x+y}{z}} + p_y*q}
{p^x*b_x + \frac{a+c}{d}} -->
<math:mfrac><math:mrow><math:mi>d</math:mi><math:mo>*</math:mo><math:msup><math:mi>b</math:mi><math:mrow><math:mo>(</math:mo><math:mfrac><math:mi>x + y</math:mi><math:mi>z</math:mi></math:mfrac><math:mo>)</math:mo></math:mrow></math:msup>
<math:mo> + </math:mo><math:msub><math:mi>p</math:mi><math:mi>y</math:mi></math:msub><math:mo>*</math:mo><math:mi>q</math:mi></math:mrow><math:mrow><math:msup><math:mi>p</math:mi><math:mi>x</math:mi></math:msup><math:mo>*</math:mo><math:msub><math:mi>b</math:mi><math:mi>x</math:mi></math:msub><math:mo> + </math:mo><math:mfrac><math:mrow><math:mi>a</math:mi><math:mo> + </math:mo><math:mi>c</math:mi></math:mrow><math:mi>d</math:mi></math:mfrac></math:mrow></math:mfrac>
</math>
in the middle of a lot of running text to try to explain what this means to those who care
to read.
</para>
<!--
<para>
The lizard should do better than only fractions!
<math xmlns:math="http://www.w3.org/Math/MathML">
<math:mfrac><math:mi>b*b + /- 4ac</math:mi><math:mi>2a</math:mi></math:mfrac>
</math>
</para>
-->

Просмотреть файл

@ -0,0 +1,166 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
*/
p :
{
display: block;
}
math, math[mode="inline"] {
display: inline;
/* font-family: Arial; */
font-style: normal;
/* font-weight: bold; */
font-size: 14pt;
}
math[mode="display"] {
display: block;
text-align: center;
/* font-family: Arial; */
font-style: normal;
/* font-weight: bold; */
/* font-size: 12pt; */
}
/*
mmultiscripts {
background-color: yellow;
}
*/
mtext {
color: purple;
border: 1px solid purple;
}
ms {
color: blue;
}
ms:before {
content: open-quote;
}
ms:after {
content: close-quote;
}
/*
mspace {
}
*/
/*
mrow {
border: 1px solid black;
font-style: italic;
}
*/
/*
mphantom {
}
*/
mfrac {
background-color: blue;
/* font-size: smaller */
/* border: 1px solid black; */
}
msub, msup {
/* background-color: yellow; */
/* border: 1px solid black; */
/* font-size: small; */
}
/*
mn {
}
*/
mi {
color: red;
font-style: italic;
/* border: 1px solid blue; */
}
mo {
font-style: normal;
border: 1px solid black;
background-color: blue;
}
merror {
display: block;
font-family: sans-serif;
font-weight: bold;
white-space: pre;
margin: 1em;
padding: 1em;
border-width: thin;
border-style: inset;
border-color: red;
font-size: 14pt;
background-color: lightyellow;
}
mtable {
/* display: inline-table; */
display: table;
/* border-style: outset; */
/* border-color: #c0c0c0; */
border-spacing: 0;
margin-top: 0;
margin-bottom: 0;
background: transparent;
}
/* must never set padding in td, th */
mtd {
vertical-align: inherit;
background-color: inherit;
text-align: center;
/* border-style: inset; */
border-color: #c0c0c0;
display: table-cell;
}
mtr {
display: table-row;
vertical-align: inherit;
background-color: inherit;
valign: baseline;
}
:-moz-math-font-style-normal {
font-style: normal;
}
:-moz-math-font-size-smaller {
font-size: smaller;
}
:-moz-math-font-size-larger {
font-size: larger;
}

Просмотреть файл

Просмотреть файл

@ -0,0 +1,38 @@
<?xml version="1.0"?>
<?xml-stylesheet href="mathml-doc.css" type="text/css"?>
<!DOCTYPE math SYSTEM "file:///C:\Mozilla/src/mozilla/layout/mathml/tests/mathml.dtd">
<!--
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University of
* Queensland. Portions created by The University of Queensland are
* Copyright (C) 1999 The University of Queensland. All
* Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
-->
<math xmlns="http://www.w3.org/Math/MathML">
<mrow>
<mi>x</mi>
<mo>=</mo>
<mi>y</mi>
<mo>+</mo>
<mfrac>
<mi>a</mi>
<mi>b</mi>
</mfrac>
</mrow>
</math>

Просмотреть файл

@ -0,0 +1,146 @@
<?xml version="1.0"?>
<?xml-stylesheet href="mathml.css" type="text/css"?>
<!--
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University of
* Queensland. Portions created by The University of Queensland are
* Copyright (C) 1999 The University of Queensland. All
* Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
-->
<math xmlns="http://www.w3.org/Math/MathML">
<mn>Testing stretchy parentheses - NOT YET IMPLEMENTED</mn>
<mrow>
<mi>x</mi>
<mo>+</mo>
<mrow>
<mo>(</mo>
<mfrac linethickness="20">
<mi>a</mi>
<mi>b</mi>
</mfrac>
<mo stretchy="false">)</mo>
</mrow>
</mrow>
<mn>in binomial formulas</mn>
<mrow>
<mrow>
<mo>(</mo>
<mfrac linethickness="0">
<mi>n</mi>
<mi>p</mi>
</mfrac>
<mo>)</mo>
</mrow>
<mo>=</mo>
<mrow>
<mo>(</mo>
<mfrac linethickness="0">
<mrow><mi>n</mi><mo>-</mo><mn>1</mn></mrow>
<mi>p</mi>
</mfrac>
<mo>)</mo>
</mrow>
<mo>+</mo>
<mrow>
<mo>(</mo>
<mfrac linethickness="0">
<mrow><mi>n</mi><mo>-</mo><mn>1</mn></mrow>
<mrow><mi>p</mi><mo>-</mo><mn>1</mn></mrow>
</mfrac><mo>)
</mo></mrow>
</mrow>
<mo>;</mo>
<mrow>
<msup>
<mrow>
<mo>(</mo>
<mi>a</mi>
<mo>+</mo>
<mi>b</mi>
<mo>)</mo>
</mrow>
<mi>n</mi>
</msup>
<mo>=</mo>
<msup>
<mi>a</mi>
<mi>n</mi>
</msup>
<mo>+</mo>
<mrow>
<mrow>
<mo>(</mo>
<mfrac linethickness="0">
<mi>n</mi>
<mi>1</mi>
</mfrac>
<mo>)</mo>
</mrow>
<msup>
<mi>a</mi>
<mrow><mi>n</mi><mo>-</mo><mn>1</mn></mrow>
</msup>
<mi>b</mi>
</mrow>
<mo>+</mo>
<mo>...</mo>
<mo>+</mo>
<mrow>
<mrow>
<mo>(</mo>
<mfrac linethickness="0">
<mi>n</mi>
<mi>p</mi>
</mfrac>
<mo>)</mo>
</mrow>
<msup>
<mi>a</mi>
<mrow><mi>n</mi><mo>-</mo><mi>p</mi></mrow>
</msup>
<msup>
<mi>b</mi>
<mi>p</mi>
</msup>
</mrow>
<mo>+</mo>
<mo>...</mo>
<mo>+</mo>
<msup>
<mi>b</mi>
<mi>n</mi>
</msup>
</mrow>
</math>

Просмотреть файл

@ -0,0 +1,43 @@
<?xml version="1.0"?>
<?xml-stylesheet href="mathml.css" type="text/css"?>
<!--
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape Communications are
* Copyright (C) 1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Erik van der Poel <erik@netscape.com>
-->
<table border="1">
<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
<tr><td>&#160;</td><td>&#33;</td><td>&#8704;</td><td>&#35;</td><td>&#8707;</td><td>&#37;</td><td>&#38;</td><td>&#8715;</td><td>&#40;</td><td>&#41;</td><td>&#8727;</td><td>&#43;</td><td>&#44;</td><td>&#8722;</td><td>&#46;</td><td>&#47;</td></tr>
<tr><td>&#48;</td><td>&#49;</td><td>&#50;</td><td>&#51;</td><td>&#52;</td><td>&#53;</td><td>&#54;</td><td>&#55;</td><td>&#56;</td><td>&#57;</td><td>&#58;</td><td>&#59;</td><td>&#60;</td><td>&#61;</td><td>&#62;</td><td>&#63;</td></tr>
<tr><td>&#8773;</td><td>&#913;</td><td>&#914;</td><td>&#935;</td><td>&#8710;</td><td>&#917;</td><td>&#934;</td><td>&#915;</td><td>&#919;</td><td>&#921;</td><td>&#977;</td><td>&#922;</td><td>&#923;</td><td>&#924;</td><td>&#925;</td><td>&#927;</td></tr>
<tr><td>&#928;</td><td>&#920;</td><td>&#929;</td><td>&#931;</td><td>&#932;</td><td>&#933;</td><td>&#962;</td><td>&#8486;</td><td>&#926;</td><td>&#936;</td><td>&#918;</td><td>&#91;</td><td>&#8756;</td><td>&#93;</td><td>&#8869;</td><td>&#95;</td></tr>
<tr><td>&#63717;</td><td>&#945;</td><td>&#946;</td><td>&#967;</td><td>&#948;</td><td>&#949;</td><td>&#966;</td><td>&#947;</td><td>&#951;</td><td>&#953;</td><td>&#981;</td><td>&#954;</td><td>&#955;</td><td>&#956;</td><td>&#957;</td><td>&#959;</td></tr>
<tr><td>&#960;</td><td>&#952;</td><td>&#961;</td><td>&#963;</td><td>&#964;</td><td>&#965;</td><td>&#982;</td><td>&#969;</td><td>&#958;</td><td>&#968;</td><td>&#950;</td><td>&#123;</td><td>&#124;</td><td>&#125;</td><td>&#8764;</td><td>&nbsp;</td></tr>
<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
<tr><td>&#8364;</td><td>&#978;</td><td>&#8242;</td><td>&#8804;</td><td>&#8725;</td><td>&#8734;</td><td>&#402;</td><td>&#9827;</td><td>&#9830;</td><td>&#9829;</td><td>&#9824;</td><td>&#8596;</td><td>&#8592;</td><td>&#8593;</td><td>&#8594;</td><td>&#8595;</td></tr>
<tr><td>&#176;</td><td>&#177;</td><td>&#8243;</td><td>&#8805;</td><td>&#215;</td><td>&#8733;</td><td>&#8706;</td><td>&#8226;</td><td>&#247;</td><td>&#8800;</td><td>&#8801;</td><td>&#8776;</td><td>&#8230;</td><td>&#63718;</td><td>&#63719;</td><td>&#8629;</td></tr>
<tr><td>&#8501;</td><td>&#8465;</td><td>&#8476;</td><td>&#8472;</td><td>&#8855;</td><td>&#8853;</td><td>&#8709;</td><td>&#8745;</td><td>&#8746;</td><td>&#8835;</td><td>&#8839;</td><td>&#8836;</td><td>&#8834;</td><td>&#8838;</td><td>&#8712;</td><td>&#8713;</td></tr>
<tr><td>&#8736;</td><td>&#8711;</td><td>&#63194;</td><td>&#63193;</td><td>&#63195;</td><td>&#8719;</td><td>&#8730;</td><td>&#8901;</td><td>&#172;</td><td>&#8743;</td><td>&#8744;</td><td>&#8660;</td><td>&#8656;</td><td>&#8657;</td><td>&#8658;</td><td>&#8659;</td></tr>
<tr><td>&#9674;</td><td>&#9001;</td><td>&#63720;</td><td>&#63721;</td><td>&#63722;</td><td>&#8721;</td><td>&#63723;</td><td>&#63724;</td><td>&#63725;</td><td>&#63726;</td><td>&#63727;</td><td>&#63728;</td><td>&#63729;</td><td>&#63730;</td><td>&#63731;</td><td>&#63732;</td></tr>
<tr><td>&nbsp;</td><td>&#9002;</td><td>&#8747;</td><td>&#8992;</td><td>&#63733;</td><td>&#8993;</td><td>&#63734;</td><td>&#63735;</td><td>&#63736;</td><td>&#63737;</td><td>&#63738;</td><td>&#63739;</td><td>&#63740;</td><td>&#63741;</td><td>&#63742;</td><td>&nbsp;</td></tr>
</table>

Просмотреть файл

@ -0,0 +1,480 @@
<?xml version="1.0"?>
<?xml-stylesheet href="mathml-doc.css" type="text/css"?>
<!DOCTYPE math SYSTEM "file:///C:\Mozilla/src/mozilla/layout/mathml/tests/mathml.dtd">
<!--
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University of
* Queensland. Portions created by The University of Queensland are
* Copyright (C) The University of Queensland. All
* Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
-->
<para>
<math xmlns="http://www.w3.org/Math/MathML">
<!-- {3 \atop k} R {1 \atop i} {2 \atop j} -->
<mmultiscripts>
<mi>R</mi>
<mi>i</mi><mi>1</mi>
<mi>j</mi><mi>2</mi>
<mprescripts/>
<mi>k</mi><mi>3</mi>
</mmultiscripts>
<!-- {{} \atop i} A {p \atop q} -->
<mmultiscripts>
<mi>A</mi>
<mi>q</mi><mi>p</mi>
<mprescripts/>
<mi>i</mi><none/>
</mmultiscripts>
<!-- \int_a^b f(x)dx -->
<msubsup>
<mo>&Integral;</mo>
<mi>a</mi>
<mi>b</mi>
</msubsup>
<mrow>
<mi>f</mi>
<mo>(</mo>
<mi>x</mi>
<mo>)</mo>
<mo>d</mo>
<mi>x</mi>
</mrow>
<!-- \frac{\partial}{\partial x}F(x,y) + \frac{\partial}{\partial y}F(x,y) -->
<mrow>
<mfrac>
<mo>&PartialD;</mo>
<mrow>
<mo>&PartialD;</mo>
<mi>x</mi>
</mrow>
</mfrac>
<mrow>
<mi>F</mi>
<mo>(</mo>
<mi>x</mi>
<mo>,</mo>
<mi>y</mi>
<mo>)</mo>
</mrow>
<mo>+</mo>
<mfrac>
<mo>&PartialD;</mo>
<mrow>
<mo>&PartialD;</mo>
<mi>y</mi>
</mrow>
</mfrac>
<mrow>
<mi>F</mi>
<mo>(</mo>
<mi>x</mi>
<mo>,</mo>
<mi>y</mi>
<mo>)</mo>
</mrow>
</mrow>
<mo>&Exists;</mo>
<mi>a</mi>
<mi>b</mi> <mi>c</mi>
<mphantom>
<mi>d</mi> <mi>e</mi> <mi>f</mi> <mi>g</mi>
<mi>h</mi> <mi>i</mi> <mi>j</mi> <mi>k</mi>
</mphantom>
<mi>l</mi> <mi>m</mi>
<mi>n</mi> <mi>o</mi>
<mphantom>
<mi>p</mi> <mi>q</mi> <mi>r</mi> <mi>s</mi>
</mphantom>
<mi>t</mi> <mi>u</mi> <mi>v</mi> <mi>w</mi>
<mi>x</mi> <mi>y</mi> <mi>z</mi>
<!-- a_b -->
<msub>
<mi>a</mi>
<mi>b</mi>
</msub>
<!-- a_i -->
<msub>
<mi>a</mi>
<mi>i</mi>
</msub>
<!-- A_{I_{k}} -->
<mrow>
<mi>A</mi>
<mi>A</mi>
</mrow>
<msub>
<mi>A</mi>
<msub>
<mi>A</mi>
<msub>
<mi>A</mi>
<mi>A</mi>
</msub>
</msub>
</msub>
<!-- d^b -->
<msup>
<mi>d</mi>
<mi>b</mi>
</msup>
<!-- 2^{a_x} -->
<msup>
<mn>2</mn>
<msub>
<mi>a</mi>
<mi>x</mi>
</msub>
</msup>
<!-- 2^{2^x} -->
<msup>
<msup>
<mn>2</mn>
<mn>2</mn>
</msup>
<mi>x</mi>
</msup>
<!-- {\left( \frac{1}{2} \right) }^{y^{a_x}} -->
<msup>
<mrow>
<mo>(</mo>
<mfrac>
<mn>1</mn>
<mn>2</mn>
</mfrac>
<mo>)</mo>
</mrow>
<msup>
<mi>y</mi>
<msub>
<mi>a</mi>
<mi>x</mi>
</msub>
</msup>
</msup>
<munder>
<mi>abcd</mi>
<mi>un</mi>
</munder>
<mover>
<mi>abcd</mi>
<mi>ov</mi>
</mover>
<munderover>
<mi>abcd</mi>
<mi>under</mi>
<mi>over</mi>
</munderover>
<!-- a_b^c -->
<msubsup>
<mi>a</mi>
<mi>p</mi>
<mi>q</mi>
</msubsup>
<!-- a_{b+c}^x -->
<msubsup>
<mi>a</mi>
<mrow>
<mi>a</mi>
<mo>+</mo>
<mi>b</mi>
</mrow>
<mi>x</mi>
</msubsup>
<!-- d^{ \left( \frac{a}{b} \right) } -->
<msup>
<mi>d</mi>
<mrow>
<mo>(</mo>
<mfrac>
<mi>a</mi>
<mi>b</mi>
</mfrac>
<mo>)</mo>
</mrow>
</msup>
<!-- \frac{d*b^{ \left( \frac{i+j}{n!} \right) } + p_y*q}
{p^x*b_x + \frac{a+c}{d}} -->
<mfrac>
<mrow>
<mi>d</mi>
<mo>*</mo>
<msup>
<mi>T</mi>
<mrow>
<mo>(</mo>
<mfrac>
<mrow>
<mi>i</mi>
<mo>+</mo>
<mi>j</mi>
</mrow>
<mi>n</mi>
</mfrac>
<mo>)</mo>
</mrow>
</msup>
<mo>+</mo>
<msub>
<mi>p</mi>
<mi>y</mi>
</msub>
<mo>*</mo>
<mi>q</mi>
</mrow>
<mrow>
<msup>
<mi>p</mi>
<mi>x</mi>
</msup>
<mo>*</mo>
<msub>
<mi>b</mi>
<mi>x</mi>
</msub>
<mo>+</mo>
<mfrac>
<mrow>
<mi>a</mi>
<mo>+</mo>
<mi>c</mi>
</mrow>
<mi>d</mi>
</mfrac>
</mrow>
</mfrac>
<ms>This is a text in ms</ms>
<!-- x^2 + 4*x + \frac{p}{q} = 0 -->
<mrow>
<mrow>
<msup>
<mi>x</mi>
<mn>2</mn>
</msup>
<mo>+</mo>
<mrow>
<mn>4</mn>
<mo>*</mo>
<mi>x</mi>
</mrow>
<mo>+</mo>
<mfrac>
<mi>p</mi>
<mi>q</mi>
</mfrac>
</mrow>
<mo>=</mo>
<mn>0</mn>
</mrow>
<mtext>This is a text in mtext</mtext>
<merror>This is a text in merror</merror>
<mrow>
<msub>
<mi>a</mi>
<mn>0</mn>
</msub>
<mo>+</mo>
<mfrac>
<mstyle scriptlevel="0">
<mn>1</mn>
</mstyle>
<mstyle scriptlevel="0">
<mrow>
<msub>
<mi>a</mi>
<mn>1</mn>
</msub>
<mo>+</mo>
<mfrac>
<mstyle scriptlevel="0">
<mn>1</mn>
</mstyle>
<mstyle scriptlevel="0">
<mrow>
<msub>
<mi>a</mi>
<mn>2</mn>
</msub>
<mo>+</mo>
<mfrac>
<mstyle scriptlevel="0">
<mn>1</mn>
</mstyle>
<mstyle scriptlevel="0">
<msub>
<mi>a</mi>
<mn>3</mn>
</msub>
</mstyle>
</mfrac>
</mrow>
</mstyle>
</mfrac>
</mrow>
</mstyle>
</mfrac>
</mrow>
<mo>;</mo>
<mrow>
<msub>
<mi>c</mi>
<mrow>
<mi>i</mi><mo>+</mo><mi>j</mi>
</mrow>
</msub>
<mo>&LeftArrow;</mo>
<mrow>
<msub><mi>a</mi><mi>i</mi></msub>
<mo>*</mo>
<msub><mi>b</mi><mi>j</mi></msub>
</mrow>
</mrow>
<p/>
<mrow>
<msup>
<mi>e</mi>
<mrow>
<mi>i</mi>
<mo>&pi;</mo>
</mrow>
</msup>
<mo>+</mo>
<mn>1</mn>
<mo>=</mo>
<mn>0</mn>
<mo>;</mo>
</mrow>
<mrow>
<mi>G</mi>
<mo>=</mo>
<mfrac>
<mrow>
<mi>F</mi>
<msup><mi>d</mi><mn>2</mn></msup>
</mrow>
<mrow>
<msub><mi>m</mi><mn>1</mn></msub>
<msub><mi>m</mi><mn>2</mn></msub>
</mrow>
</mfrac>
</mrow>
<mo>;</mo>
<mrow>
<mi>t</mi><mo>+=</mo><mi>dt</mi>
</mrow>
<p/>
<mrow>
<mi>x</mi>
<mo>=</mo>
<mi>a</mi>
<mo>*</mo>
<mi>b</mi>
<mo>+</mo>
<mrow>
<mo stretchy="false">(</mo>
<mfrac linethickness="2">
<mrow>
<mi>aa</mi>
<mo>+</mo>
<mi>b</mi>
</mrow>
<mfrac>
<mi>xy</mi>
<mi>z</mi>
</mfrac>
</mfrac>
<mo>)</mo>
</mrow>
</mrow>
<mfrac>
<mfrac>
<mi>x</mi>
<mi>z</mi>
</mfrac>
<mstyle scriptlevel="-3">
<mfrac>
<mi>dy</mi>
<mstyle scriptlevel="1">
<mi>z</mi>
</mstyle>
</mfrac>
</mstyle>
</mfrac>
<mfrac>
<mstyle scriptlevel="-2">
<mi>x</mi>
</mstyle>
<mi>z</mi>
</mfrac>
</math>
</para>

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -0,0 +1,774 @@
#!/bin/perl
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Mozilla MathML Project.
#
# The Initial Developer of the Original Code is The University Of
# Queensland. Portions created by The University Of Queensland are
# Copyright (C) 1999 The University Of Queensland. All
# Rights Reserved.
#
# Contributor(s):
# Roger B. Sidje <rbs@maths.uq.edu.au>
#
# Purpose:
# This script produces data for the operator dictionary
# RBS - Aug 28, 1999.
# Output: the file $operator_file contains the dictionary in suitable
# format for inclusion with C++ macros.
# $operator_file = '..\content\src\nsMathMLOperatorList.h';
$operator_file = 'operator.list';
$unicode_file = "byalpha.txt";
&getUnicode($unicode_file); # $unicode_file = "byalpha.txt" or "bycodes.txt"
# byalpha.txt, bycodes.txt are simply the Save as text of
# http://www.w3.org/TR/REC-MathML/chap6/byalpha.html
# http://www.w3.org/TR/REC-MathML/chap6/bycodes.html
&getMathMLOperators(); # Get the MathML Operators - exact *copy-paste* from
# http://www.w3.org/TR/REC-MathML/appendixC.html
print "\n***** Saving into the file ***** $operator_file *****\n";
open(OUTPUT_FILE, ">$operator_file") || die("can't open $operator_file");
print OUTPUT_FILE <<HEADER_DATA;
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is The University Of
* Queensland. Portions created by The University Of Queensland are
* Copyright (C) 1999 The University Of Queensland. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs\@maths.uq.edu.au>
*/
/* MathML Operator Dictionary - Auto-generated by operator.pl. Do not edit! */
/* FORMAT
MATHML_OPERATOR(_rank,
_operator,= string value of the operator
_flags, = bitwise: movablelimits|separator|largeop|accent|fence|stretchy|form
_lspace, = leftspace in em
_rspace) = rightspace in em
*/
HEADER_DATA
# There are three global variables available here:
# $MACRO_LIST_UNICHAR - list of unicode that make the operator names
# $MACRO_LIST_UNIDATA - dictionary with the name of the operator as unicode
# $MACRO_LIST_ENTDATA - dictionary with the name of the operator as entity
print OUTPUT_FILE <<CONTENT;
#ifdef WANT_MATHML_OPERATOR_COUNT
#define NS_MATHML_OPERATOR_COUNT $count
#else
#ifdef WANT_MATHML_OPERATOR_UNICHAR
//Unicode(s),\\0// group symbol form
$MACRO_LIST_UNICHAR
#else
$MACRO_LIST_ENTDATA
#endif
#endif
CONTENT
close(OUTPUT_FILE);
print "Done $count operators.\n";
exit(0);
################################
# All outputs are global variables ...
#
# extract all the symbols of the MathML REC byalpha.txt or bycodes.txt (the
# name of the file is passed as argument)
# INPUT: "byalpha.txt" or "bycodes.txt"
# OUTPUT: - hash array %UNICODE such that $UNICODE{$entity} = $unicode
# - array @ENTITY such that $ENTITY[$i] is an entity name
# - hash array %ENTITY_LAST_ALIAS such that
# $ENTITY_LAST_ALIAS{$unicode} = last entity with that unicode
sub getUnicode {
local($infile) = @_[0];
$byalpha = $infile =~ /byalpha/;
print "\nScanning $infile ...";
open (INFILE, $infile) || die("Can't open $infile");
$count = 0;
while (<INFILE>) {
#pattern byalpha: entity isolat2 377 unicode =capital Z, acute accent
if ($byalpha) { # byalpha -- ALIASES ARE INCLUDED
if ( /^([a-z\.]\S+)\s+\S+\s+\d+\s+(\S+)\s+.*/i ) {
($entity,$unicode) = ($1,$2);
if ($UNICODE{$entity}) { #conflicting mapping ?
next if $UNICODE{$entity} eq $unicode;
print "\nWARNING! Found: $entity -> $unicode <> $UNICODE{$entity}";
}
$UNICODE{$entity} = $unicode;
$ENTITY_LAST_ALIAS{$unicode} = $entity;
++$count;
}
}
else { # bycodes -- ALIASES ARE NOT INCLUDED
#pattern bycode: unicode 9 entity mmlextra tabulator stop; horizontal tabulation
if ( /^(\S+)\s+\d+\s+([a-z\.]+)\s+\S+\s+.*/i ) {
($unicode,$entity) = ($1,$2);
# print "\n$entity $unicode";
$UNICODE{$entity} = $unicode;
$ENTITY_LAST_ALIAS{$unicode} = $entity;
++$count;
}
}
}
@ENTITY = (keys %UNICODE);
print "\nFound: $count unicode points, " . ($#ENTITY+1) . " entities\n";
}
#Make the MathML Operator dictionary
# INPUT:
# OUTPUT:
# $MACRO_LIST_UNICHAR - list of unicode that make the operator names
# $MACRO_LIST_UNIDATA - dictionary with the name of the operator as unicode
# $MACRO_LIST_ENTDATA - dictionary with the name of the operator as entity
sub getMathMLOperators {
#Operator attributes:
# values <-- default -->
# form prefix |infix | postfix determined by position in mrow
# fence true | false set by dictionary
# accent true | false set by dictionary
# lspace number h-unit set by dictionary
# rspace number h-unit set by dictionary
# largeop true | false set by dictionary
# stretchy true | false set by dictionary
# separator true | false set by dictionary
# movablelimits true | false set by dictionary
# symmetric true | false true
# minzize number [h-unit | v-unit] 0
# maxsize number [h-unit | v-unit] | infinity infinity
$DATA = <<MathMLOperatorDictionary;
"(" form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em"
")" form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"[" form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"]" form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"{" form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"}" form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&CloseCurlyDoubleQuote;" form="postfix" fence="true" lspace="0em" rspace="0em"
"&CloseCurlyQuote;" form="postfix" fence="true" lspace="0em" rspace="0em"
"&LeftAngleBracket;" form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&LeftBracketingBar;" form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&LeftCeiling;" form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&LeftDoubleBracket;" form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&LeftDoubleBracketingBar;" form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&LeftFloor;" form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&OpenCurlyDoubleQuote;" form="prefix" fence="true" lspace="0em" rspace="0em"
"&OpenCurlyQuote;" form="prefix" fence="true" lspace="0em" rspace="0em"
"&RightAngleBracket;" form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&RightBracketingBar;" form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&RightCeiling;" form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&RightDoubleBracket;" form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&RightDoubleBracketingBar;" form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&RightFloor;" form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em"
"&LeftSkeleton;" form="prefix" fence="true" lspace="0em" rspace="0em"
"&RightSkeleton;" form="postfix" fence="true" lspace="0em" rspace="0em"
"&InvisibleComma;" form="infix" separator="true" lspace="0em" rspace="0em"
"," form="infix" separator="true" lspace="0em" rspace=".33333em"
"&HorizontalLine;" form="infix" stretchy="true" minsize="0" lspace="0em" rspace="0em"
"&VerticalLine;" form="infix" stretchy="true" minsize="0" lspace="0em" rspace="0em"
";" form="infix" separator="true" lspace="0em" rspace=".27777em"
";" form="postfix" separator="true" lspace="0em" rspace="0em"
":=" form="infix" lspace=".27777em" rspace=".27777em"
"&Assign;" form="infix" lspace=".27777em" rspace=".27777em"
"&Because;" form="infix" lspace=".27777em" rspace=".27777em"
"&Therefore;" form="infix" lspace=".27777em" rspace=".27777em"
"&VerticalSeparator;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"//" form="infix" lspace=".27777em" rspace=".27777em"
"&Colon;" form="infix" lspace=".27777em" rspace=".27777em"
"&amp;" form="prefix" lspace="0em" rspace=".27777em"
"&amp;" form="postfix" lspace=".27777em" rspace="0em"
"*=" form="infix" lspace=".27777em" rspace=".27777em"
"-=" form="infix" lspace=".27777em" rspace=".27777em"
"+=" form="infix" lspace=".27777em" rspace=".27777em"
"/=" form="infix" lspace=".27777em" rspace=".27777em"
"-&gt;" form="infix" lspace=".27777em" rspace=".27777em"
":" form="infix" lspace=".27777em" rspace=".27777em"
".." form="postfix" lspace=".22222em" rspace="0em"
"..." form="postfix" lspace=".22222em" rspace="0em"
"&SuchThat;" form="infix" lspace=".27777em" rspace=".27777em"
"&DoubleLeftTee;" form="infix" lspace=".27777em" rspace=".27777em"
"&DoubleRightTee;" form="infix" lspace=".27777em" rspace=".27777em"
"&DownTee;" form="infix" lspace=".27777em" rspace=".27777em"
"&LeftTee;" form="infix" lspace=".27777em" rspace=".27777em"
"&RightTee;" form="infix" lspace=".27777em" rspace=".27777em"
"&Implies;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&RoundImplies;" form="infix" lspace=".27777em" rspace=".27777em"
"|" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"||" form="infix" lspace=".22222em" rspace=".22222em"
"&Or;" form="infix" stretchy="true" lspace=".22222em" rspace=".22222em"
"&amp;&amp;" form="infix" lspace=".27777em" rspace=".27777em"
"&And;" form="infix" stretchy="true" lspace=".22222em" rspace=".22222em"
"&amp;" form="infix" lspace=".27777em" rspace=".27777em"
"!" form="prefix" lspace="0em" rspace=".27777em"
"&Not;" form="prefix" lspace="0em" rspace=".27777em"
"&Exists;" form="prefix" lspace="0em" rspace=".27777em"
"&ForAll;" form="prefix" lspace="0em" rspace=".27777em"
"&NotExists;" form="prefix" lspace="0em" rspace=".27777em"
"&Element;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotElement;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotReverseElement;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotSquareSubset;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotSquareSubsetEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotSquareSuperset;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotSquareSupersetEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotSubset;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotSubsetEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotSuperset;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotSupersetEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&ReverseElement;" form="infix" lspace=".27777em" rspace=".27777em"
"&SquareSubset;" form="infix" lspace=".27777em" rspace=".27777em"
"&SquareSubsetEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&SquareSuperset;" form="infix" lspace=".27777em" rspace=".27777em"
"&SquareSupersetEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&Subset;" form="infix" lspace=".27777em" rspace=".27777em"
"&SubsetEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&Superset;" form="infix" lspace=".27777em" rspace=".27777em"
"&SupersetEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&DoubleLeftArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&DoubleLeftRightArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&DoubleRightArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&DownLeftRightVector;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&DownLeftTeeVector;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&DownLeftVector;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&DownLeftVectorBar;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&DownRightTeeVector;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&DownRightVector;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&DownRightVectorBar;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&LeftArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&LeftArrowBar;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&LeftArrowRightArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&LeftRightArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&LeftRightVector;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&LeftTeeArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&LeftTeeVector;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&LeftVector;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&LeftVectorBar;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&LowerLeftArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&LowerRightArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&RightArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&RightArrowBar;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&RightArrowLeftArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&RightTeeArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&RightTeeVector;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&RightVector;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&RightVectorBar;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&ShortLeftArrow;" form="infix" lspace=".27777em" rspace=".27777em"
"&ShortRightArrow;" form="infix" lspace=".27777em" rspace=".27777em"
"&UpperLeftArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&UpperRightArrow;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"=" form="infix" lspace=".27777em" rspace=".27777em"
"&lt;" form="infix" lspace=".27777em" rspace=".27777em"
"&gt;" form="infix" lspace=".27777em" rspace=".27777em"
"!=" form="infix" lspace=".27777em" rspace=".27777em"
"==" form="infix" lspace=".27777em" rspace=".27777em"
"&lt;=" form="infix" lspace=".27777em" rspace=".27777em"
"&gt;=" form="infix" lspace=".27777em" rspace=".27777em"
"&Congruent;" form="infix" lspace=".27777em" rspace=".27777em"
"&CupCap;" form="infix" lspace=".27777em" rspace=".27777em"
"&DotEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&DoubleVerticalBar;" form="infix" lspace=".27777em" rspace=".27777em"
"&Equal;" form="infix" lspace=".27777em" rspace=".27777em"
"&EqualTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&Equilibrium;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&GreaterEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&GreaterEqualLess;" form="infix" lspace=".27777em" rspace=".27777em"
"&GreaterFullEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&GreaterGreater;" form="infix" lspace=".27777em" rspace=".27777em"
"&GreaterLess;" form="infix" lspace=".27777em" rspace=".27777em"
"&GreaterSlantEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&GreaterTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&HumpDownHump;" form="infix" lspace=".27777em" rspace=".27777em"
"&HumpEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&LeftTriangle;" form="infix" lspace=".27777em" rspace=".27777em"
"&LeftTriangleBar;" form="infix" lspace=".27777em" rspace=".27777em"
"&LeftTriangleEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&le;" form="infix" lspace=".27777em" rspace=".27777em"
"&LessEqualGreater;" form="infix" lspace=".27777em" rspace=".27777em"
"&LessFullEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&LessGreater;" form="infix" lspace=".27777em" rspace=".27777em"
"&LessLess;" form="infix" lspace=".27777em" rspace=".27777em"
"&LessSlantEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&LessTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&NestedGreaterGreater;" form="infix" lspace=".27777em" rspace=".27777em"
"&NestedLessLess;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotCongruent;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotCupCap;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotDoubleVerticalBar;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotEqualTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotGreater;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotGreaterEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotGreaterFullEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotGreaterGreater;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotGreaterLess;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotGreaterSlantEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotGreaterTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotHumpDownHump;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotHumpEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotLeftTriangle;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotLeftTriangleBar;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotLeftTriangleEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotLess;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotLessEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotLessFullEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotLessGreater;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotLessLess;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotLessSlantEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotLessTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotNestedGreaterGreater;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotNestedLessLess;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotPrecedes;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotPrecedesEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotPrecedesSlantEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotPrecedesTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotRightTriangle;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotRightTriangleBar;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotRightTriangleEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotSucceeds;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotSucceedsEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotSucceedsSlantEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotSucceedsTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotTildeEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotTildeFullEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotTildeTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&NotVerticalBar;" form="infix" lspace=".27777em" rspace=".27777em"
"&Precedes;" form="infix" lspace=".27777em" rspace=".27777em"
"&PrecedesEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&PrecedesSlantEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&PrecedesTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&Proportion;" form="infix" lspace=".27777em" rspace=".27777em"
"&Proportional;" form="infix" lspace=".27777em" rspace=".27777em"
"&ReverseEquilibrium;" form="infix" stretchy="true" lspace=".27777em" rspace=".27777em"
"&RightTriangle;" form="infix" lspace=".27777em" rspace=".27777em"
"&RightTriangleBar;" form="infix" lspace=".27777em" rspace=".27777em"
"&RightTriangleEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&Succeeds;" form="infix" lspace=".27777em" rspace=".27777em"
"&SucceedsEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&SucceedsSlantEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&SucceedsTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&Tilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&TildeEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&TildeFullEqual;" form="infix" lspace=".27777em" rspace=".27777em"
"&TildeTilde;" form="infix" lspace=".27777em" rspace=".27777em"
"&UpTee;" form="infix" lspace=".27777em" rspace=".27777em"
"&VerticalBar;" form="infix" lspace=".27777em" rspace=".27777em"
"&SquareUnion;" form="infix" stretchy="true" lspace=".22222em" rspace=".22222em"
"&Union;" form="infix" stretchy="true" lspace=".22222em" rspace=".22222em"
"&UnionPlus;" form="infix" stretchy="true" lspace=".22222em" rspace=".22222em"
"-" form="infix" lspace=".22222em" rspace=".22222em"
"+" form="infix" lspace=".22222em" rspace=".22222em"
"&Intersection;" form="infix" stretchy="true" lspace=".22222em" rspace=".22222em"
"&MinusPlus;" form="infix" lspace=".22222em" rspace=".22222em"
"&PlusMinus;" form="infix" lspace=".22222em" rspace=".22222em"
"&SquareIntersection;" form="infix" stretchy="true" lspace=".22222em" rspace=".22222em"
"&Vee;" form="prefix" largeop="true" movablelimits="true" stretchy="true" lspace="0em" rspace=".16666em"
"&CircleMinus;" form="prefix" largeop="true" movablelimits="true" lspace="0em" rspace=".16666em"
"&CirclePlus;" form="prefix" largeop="true" movablelimits="true" lspace="0em" rspace=".16666em"
"&Sum;" form="prefix" largeop="true" movablelimits="true" stretchy="true" lspace="0em" rspace=".16666em"
"&Union;" form="prefix" largeop="true" movablelimits="true" stretchy="true" lspace="0em" rspace=".16666em"
"&UnionPlus;" form="prefix" largeop="true" movablelimits="true" stretchy="true" lspace="0em" rspace=".16666em"
"lim" form="prefix" movablelimits="true" lspace="0em" rspace=".16666em"
"max" form="prefix" movablelimits="true" lspace="0em" rspace=".16666em"
"min" form="prefix" movablelimits="true" lspace="0em" rspace=".16666em"
"&CircleMinus;" form="infix" lspace=".16666em" rspace=".16666em"
"&CirclePlus;" form="infix" lspace=".16666em" rspace=".16666em"
"&ClockwiseContourIntegral;" form="prefix" largeop="true" stretchy="true" lspace="0em" rspace="0em"
"&ContourIntegral;" form="prefix" largeop="true" stretchy="true" lspace="0em" rspace="0em"
"&CounterClockwiseContourIntegral;" form="prefix" largeop="true" stretchy="true" lspace="0em" rspace="0em"
"&DoubleContourIntegral;" form="prefix" largeop="true" stretchy="true" lspace="0em" rspace="0em"
"&Integral;" form="prefix" largeop="true" stretchy="true" lspace="0em" rspace="0em"
"&Cup;" form="infix" lspace=".16666em" rspace=".16666em"
"&Cap;" form="infix" lspace=".16666em" rspace=".16666em"
"&VerticalTilde;" form="infix" lspace=".16666em" rspace=".16666em"
"&Wedge;" form="prefix" largeop="true" movablelimits="true" stretchy="true" lspace="0em" rspace=".16666em"
"&CircleTimes;" form="prefix" largeop="true" movablelimits="true" lspace="0em" rspace=".16666em"
"&Coproduct;" form="prefix" largeop="true" movablelimits="true" stretchy="true" lspace="0em" rspace=".16666em"
"&Product;" form="prefix" largeop="true" movablelimits="true" stretchy="true" lspace="0em" rspace=".16666em"
"&Intersection;" form="prefix" largeop="true" movablelimits="true" stretchy="true" lspace="0em" rspace=".16666em"
"&Coproduct;" form="infix" lspace=".16666em" rspace=".16666em"
"&Star;" form="infix" lspace=".16666em" rspace=".16666em"
"&CircleDot;" form="prefix" largeop="true" movablelimits="true" lspace="0em" rspace=".16666em"
"*" form="infix" lspace=".16666em" rspace=".16666em"
"&InvisibleTimes;" form="infix" lspace="0em" rspace="0em"
"&CenterDot;" form="infix" lspace=".16666em" rspace=".16666em"
"&CircleTimes;" form="infix" lspace=".16666em" rspace=".16666em"
"&Vee;" form="infix" lspace=".16666em" rspace=".16666em"
"&Wedge;" form="infix" lspace=".16666em" rspace=".16666em"
"&Diamond;" form="infix" lspace=".16666em" rspace=".16666em"
"&Backslash;" form="infix" stretchy="true" lspace=".16666em" rspace=".16666em"
"/" form="infix" stretchy="true" lspace=".16666em" rspace=".16666em"
"-" form="prefix" lspace="0em" rspace=".05555em"
"+" form="prefix" lspace="0em" rspace=".05555em"
"&MinusPlus;" form="prefix" lspace="0em" rspace=".05555em"
"&PlusMinus;" form="prefix" lspace="0em" rspace=".05555em"
"." form="infix" lspace="0em" rspace="0em"
"&Cross;" form="infix" lspace=".11111em" rspace=".11111em"
"**" form="infix" lspace=".11111em" rspace=".11111em"
"&CircleDot;" form="infix" lspace=".11111em" rspace=".11111em"
"&SmallCircle;" form="infix" lspace=".11111em" rspace=".11111em"
"&Square;" form="prefix" lspace="0em" rspace=".11111em"
"&Del;" form="prefix" lspace="0em" rspace=".11111em"
"&PartialD;" form="prefix" lspace="0em" rspace=".11111em"
"&CapitalDifferentialD;" form="prefix" lspace="0em" rspace=".11111em"
"&DifferentialD;" form="prefix" lspace="0em" rspace=".11111em"
"&Sqrt;" form="prefix" stretchy="true" lspace="0em" rspace=".11111em"
"&DoubleDownArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&DoubleLongLeftArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&DoubleLongLeftRightArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&DoubleLongRightArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&DoubleUpArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&DoubleUpDownArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&DownArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&DownArrowBar;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&DownArrowUpArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&DownTeeArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&LeftDownTeeVector;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&LeftDownVector;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&LeftDownVectorBar;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&LeftUpDownVector;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&LeftUpTeeVector;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&LeftUpVector;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&LeftUpVectorBar;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&LongLeftArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&LongLeftRightArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&LongRightArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&ReverseUpEquilibrium;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&RightDownTeeVector;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&RightDownVector;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&RightDownVectorBar;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&RightUpDownVector;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&RightUpTeeVector;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&RightUpVector;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&RightUpVectorBar;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&ShortDownArrow;" form="infix" lspace=".11111em" rspace=".11111em"
"&ShortUpArrow;" form="infix" lspace=".11111em" rspace=".11111em"
"&UpArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&UpArrowBar;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&UpArrowDownArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&UpDownArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&UpEquilibrium;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"&UpTeeArrow;" form="infix" stretchy="true" lspace=".11111em" rspace=".11111em"
"^" form="infix" lspace=".11111em" rspace=".11111em"
"&lt;&gt;" form="infix" lspace=".11111em" rspace=".11111em"
"'" form="postfix" lspace=".11111em" rspace="0em"
"!" form="postfix" lspace=".11111em" rspace="0em"
"!!" form="postfix" lspace=".11111em" rspace="0em"
"~" form="infix" lspace=".11111em" rspace=".11111em"
"@" form="infix" lspace=".11111em" rspace=".11111em"
"--" form="postfix" lspace=".11111em" rspace="0em"
"--" form="prefix" lspace="0em" rspace=".11111em"
"++" form="postfix" lspace=".11111em" rspace="0em"
"++" form="prefix" lspace="0em" rspace=".11111em"
"&ApplyFunction;" form="infix" lspace="0em" rspace="0em"
"?" form="infix" lspace=".11111em" rspace=".11111em"
"_" form="infix" lspace=".11111em" rspace=".11111em"
"&Breve;" form="postfix" accent="true" lspace="0em" rspace="0em"
"&Cedilla;" form="postfix" accent="true" lspace="0em" rspace="0em"
"&DiacriticalGrave;" form="postfix" accent="true" lspace="0em" rspace="0em"
"&DiacriticalDot;" form="postfix" accent="true" lspace="0em" rspace="0em"
"&DiacriticalDoubleAcute;" form="postfix" accent="true" lspace="0em" rspace="0em"
"&DiacriticalLeftArrow;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&DiacriticalLeftRightArrow;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&DiacriticalLeftRightVector;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&DiacriticalLeftVector;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&DiacriticalAcute;" form="postfix" accent="true" lspace="0em" rspace="0em"
"&DiacriticalRightArrow;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&DiacriticalRightVector;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&DiacriticalTilde;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&DoubleDot;" form="postfix" accent="true" lspace="0em" rspace="0em"
"&DownBreve;" form="postfix" accent="true" lspace="0em" rspace="0em"
"&Hacek;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&Hat;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&OverBar;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&OverBrace;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&OverBracket;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&OverParenthesis;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&TripleDot;" form="postfix" accent="true" lspace="0em" rspace="0em"
"&UnderBar;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&UnderBrace;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&UnderBracket;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
"&UnderParenthesis;" form="postfix" accent="true" stretchy="true" lspace="0em" rspace="0em"
MathMLOperatorDictionary
for (0..255) {
# $escapes{chr($_)} = sprintf("%%%02X", $_);
# $escapes{pack("c",$_)} = sprintf("%%%02X", $_);
$escapes{pack("c",$_)} = sprintf("%04X", $_);
}
#The bit flags that will be used
$NS_MATHML_OPERATOR_FORM_INFIX = '1';
$NS_MATHML_OPERATOR_FORM_PREFIX = '2';
$NS_MATHML_OPERATOR_FORM_POSTFIX = '3';
$NS_MATHML_OPERATOR_STRETCHY = '(1<<2)';
$NS_MATHML_OPERATOR_FENCE = '(1<<3)';
$NS_MATHML_OPERATOR_ACCENT = '(1<<4)';
$NS_MATHML_OPERATOR_LARGEOP = '(1<<5)';
$NS_MATHML_OPERATOR_SEPARATOR = '(1<<6)';
$NS_MATHML_OPERATOR_MOVABLELIMITS = '(1<<7)';
@ATTRIBUTE = ("form",
"stretchy",
"fence",
"accent",
"largeop",
"separator",
"movablelimits",
"lspace",
"rpace");
$NUMFLAGS = 7;
%FLAGS = ("", '0',
"0", '0',
"form=infix", $NS_MATHML_OPERATOR_FORM_INFIX,
"form=prefix", $NS_MATHML_OPERATOR_FORM_PREFIX,
"form=postfix", $NS_MATHML_OPERATOR_FORM_POSTFIX,
"stretchy=true", $NS_MATHML_OPERATOR_STRETCHY,
"fence=true", $NS_MATHML_OPERATOR_FENCE,
"accent=true", $NS_MATHML_OPERATOR_ACCENT,
"largeop=true", $NS_MATHML_OPERATOR_LARGEOP,
"separator=true", $NS_MATHML_OPERATOR_SEPARATOR,
"movablelimits=true", $NS_MATHML_OPERATOR_MOVEABLELIMITS);
# build the macro lists
print "\n\nBuilding the operator list...\n";
$MACRO_LIST_UNICHAR = $MACRO_LIST_UNIDATA = $MACRO_LIST_ENTDATA = "";
$count = 0;
@OPERATOR = split("\n",$DATA);
$group = 0;
for ($rank=0; $rank<=$#OPERATOR; ++$rank) {
$data = $OPERATOR[$rank];
$data =~ s#^\s+##;
if ($data eq "") {
++$group;
next;
}
delete @KEY{keys %KEY};
delete @VALUES{keys %VALUES};
# Initialize with default values set by the REC :
$VALUE{'fence'} = 'false';
$VALUE{'separator'} = 'false';
$VALUE{'lspace'} = '.27777em';
$VALUE{'rspace'} = '.27777em';
$VALUE{'stretchy'} = 'false';
# $VALUE{'symmetric'} = 'true';
# $VALUE{'maxsize'} = 'infinity';
# $VALUE{'minsize'} = '1';
$VALUE{'largeop'} = 'false';
$VALUE{'movablelimits'} = 'false';
$VALUE{'accent'} = 'false';
($operator,$attributes) = ($1,$2) if $data =~ /(\S+)\s*(.*)\s*$/;
while ($attributes =~ /(\S+)=\"([^"]*)\"/g) {
($name,$value) = ($1,$2);
$VALUE{$name} = $value;
$KEY{$name} = $name . '=' . $value;
}
$lspace = $VALUE{"lspace"}; $lspace =~ s/em//;
$rspace = $VALUE{"rspace"}; $rspace =~ s/em//;
$lspace .= ($lspace =~ m#\.#)? "f" : ".0f";
$rspace .= ($rspace =~ m#\.#)? "f" : ".0f";
# put all the flags together in an OR-list
$enclose = 0;
$flags = $FLAGS{$KEY{"form"}};
for ($i=1; $i<$NUMFLAGS; ++$i) {
$key = $KEY{$ATTRIBUTE[$i]};
next if !$FLAGS{$key};
$flags .= '|' . $FLAGS{$key};
++$enclose;
}
$flags = '(' . $flags . ')' if $enclose;
$operator =~ s#[\"]##g;
$string = $operator;
$unichar = "";
#go over each entity and find its unicode point - collate the results in unichar
$unicodemissed = 0;
$i = 0;
$unistring = '';
while ($string ne "" && $i < 5) { # there could be &ent1;&ent2; and Perl is greedy...
$entity = ($string =~ m#^\&(.*?)\;#)? $1:""; # so here ue use the non-greedy modifier '?'
if ($entity ne "") {
$string =~ s#^\&${entity}\;##;
$unicode = $UNICODE{$entity};
$unicodemissed = 1 if $unicode eq "";
$unichar .= '\x' . $unicode;
$unistring .= '0x' . $unicode . ',';
$PUA{$unicode} = $entity if ($unicode ge "E000" && $unicode le "F8FF");
}
else {
$entity = $1 if $string =~ m#^(.)#;
$string =~ s#\S##;
$entity =~ s/([\x00-\xFF])/$escapes{$1}/g;
$unichar .= '\x' . $entity;
$unistring .= '0x' . $entity . ',';
}
++$i;
}
#some operators do not have unicode points, skip them !
if ($unicodemissed) {
print "Missing unicode for $operator... removing it from the dictionary...\n";
next;
}
#global outputs:
#UNICHAR is zero-separated list of unicode points
$unistring .= '0x0000';
$MACRO_LIST_UNICHAR .= $unistring . ', // ' . "$group $operator $VALUE{'form'}\n";
#UNIDATA is the table based on unicode points
$MACRO_LIST_UNIDATA .= 'MATHML_OPERATOR(' . $count . ',"' . $unichar . '",';
$MACRO_LIST_UNIDATA .= "$flags,$lspace,$rspace" . ') // ' . "$operator $VALUE{'form'}\n";
#ENTDATA is the table based on &entity; names
#little swap here to get a listing based on the entity
$string = $operator;
$operator = $unichar; $operator =~ s#\\x# #g;
$unichar = $string;
$MACRO_LIST_ENTDATA .= 'MATHML_OPERATOR(' . $count . ',"' . $unichar . '",';
$MACRO_LIST_ENTDATA .= "$flags,$lspace,$rspace" . ') // ' . "$operator $VALUE{'form'}\n";
++$count;
}
# $puacount = 0;
# foreach $pua (keys %PUA) {
# ++$puacount;
# print "$puacount $pua $PUA{$pua}\n";
# }
}