Sync the handling of stretchy MathML frames with the new ::-moz notation, b=214989, r+sr=dbaron

This commit is contained in:
rbs%maths.uq.edu.au 2003-08-05 02:07:14 +00:00
Родитель 0e1fa2dc76
Коммит 408bf58f3f
8 изменённых файлов: 28 добавлений и 18 удалений

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

@ -103,3 +103,9 @@ CSS_ANON_BOX(moztreeseparator, ":-moz-tree-separator")
CSS_ANON_BOX(moztreedropfeedback, ":-moz-tree-drop-feedback")
CSS_ANON_BOX(moztreeprogressmeter, ":-moz-tree-progressmeter")
#endif
#ifdef MOZ_MATHML
CSS_ANON_BOX(mozMathStretchy, ":-moz-math-stretchy")
CSS_ANON_BOX(mozMathAnonymous, ":-moz-math-anonymous")
CSS_ANON_BOX(mozMathInline, ":-moz-math-inline")
#endif

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

@ -6732,7 +6732,7 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsIPresShell* aPresShell,
if (NS_FAILED(rv)) return rv;
nsRefPtr<nsStyleContext> mrowContext;
mrowContext = aPresContext->ResolvePseudoStyleContextFor(aContent,
nsMathMLAtoms::mozMathInline,
nsCSSAnonBoxes::mozMathInline,
parentContext);
InitAndRestoreFrame(aPresContext, aState, aContent, aParentFrame,
mrowContext, nsnull, newFrame);

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

@ -6732,7 +6732,7 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsIPresShell* aPresShell,
if (NS_FAILED(rv)) return rv;
nsRefPtr<nsStyleContext> mrowContext;
mrowContext = aPresContext->ResolvePseudoStyleContextFor(aContent,
nsMathMLAtoms::mozMathInline,
nsCSSAnonBoxes::mozMathInline,
parentContext);
InitAndRestoreFrame(aPresContext, aState, aContent, aParentFrame,
mrowContext, nsnull, newFrame);

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

@ -897,7 +897,7 @@ nsGlyphTableList::GetListFor(nsIPresContext* aPresContext,
nsFont* aFont,
nsVoidArray* aGlyphTableList)
{
// @see the documentation of -moz-math-font-style-stretchy in mathml.css
// @see the documentation of -moz-math-stretchy in mathml.css
// for how this work
aGlyphTableList->Clear();
PRBool useDocumentFonts = PR_TRUE;
@ -905,7 +905,7 @@ nsGlyphTableList::GetListFor(nsIPresContext* aPresContext,
// Check to honor the pref("browser.display.use_document_fonts", 0)
// Only include fonts from CSS if the pref to disallow authors' fonts isn't set
if (useDocumentFonts) {
// Convert the list of fonts in aFont (from -moz-math-font-style-stretchy)
// Convert the list of fonts in aFont (from -moz-math-stretchy)
// to an ordered list of corresponding glyph extension tables
StretchyFontEnumContext context = {aPresContext, aChar, aGlyphTableList};
aFont->EnumerateFamilies(StretchyFontEnumCallback, &context);
@ -1373,7 +1373,7 @@ nsMathMLChar::SetData(nsIPresContext* aPresContext,
2) We search for the first larger variant of the char that fits the
container' size. We search fonts for larger variants in the order
specified in the list of stretchy fonts held by the leaf style
context (from -moz-math-font-style-stretchy in mathml.css).
context (from -moz-math-stretchy in mathml.css).
Issues :
a) the largeop and display settings determine the starting
size when we do the above search, regardless of whether

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

@ -22,6 +22,7 @@
#include "nsINameSpaceManager.h"
#include "nsMathMLFrame.h"
#include "nsMathMLChar.h"
#include "nsCSSAnonBoxes.h"
// used to map attributes into CSS rules
#include "nsIDocument.h"
@ -112,11 +113,11 @@ nsMathMLFrame::ResolveMathMLCharStyle(nsIPresContext* aPresContext,
nsMathMLChar* aMathMLChar,
PRBool aIsMutableChar)
{
nsIAtom* fontAtom = (aIsMutableChar) ?
nsMathMLAtoms::fontstyle_stretchy :
nsMathMLAtoms::fontstyle_anonymous; // savings
nsIAtom* pseudoStyle = (aIsMutableChar) ?
nsCSSAnonBoxes::mozMathStretchy :
nsCSSAnonBoxes::mozMathAnonymous; // savings
nsRefPtr<nsStyleContext> newStyleContext;
newStyleContext = aPresContext->ResolvePseudoStyleContextFor(aContent, fontAtom,
newStyleContext = aPresContext->ResolvePseudoStyleContextFor(aContent, pseudoStyle,
aParentStyleContext);
if (newStyleContext)
aMathMLChar->SetStyleContext(newStyleContext);

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

@ -44,7 +44,7 @@ math[mode="display"], math[display="block"] {
display: block;
text-align: -moz-center;
}
:-moz-math-inline {
::-moz-math-inline {
display: inline;
}
@ -390,19 +390,19 @@ mtd[-moz-math-columnline="dashed"] {
To request the use of TeX fonts, you can add a <style>...</style> with:
<mo myfonts="tex">...</mo> with the associated CSS declaration
mo[myfonts="tex"]:-moz-math-font-style-stretchy {
mo[myfonts="tex"]::-moz-math-stretchy {
font-family: CMSY10, CMEX10;
}
To request the use of Mathematica fonts, you can add a <style>...</style> with:
<mo myfonts="mathematica">...</mo> with the associated CSS declaration
mo[myfonts="mathematica"]:-moz-math-font-style-stretchy {
mo[myfonts="mathematica"]::-moz-math-stretchy {
font-family: Math1, Math2, Math4;
}
Of course, if you just want all of the stretchy characters in your
document to be stretched with your preferred list, you can just do:
:-moz-math-font-style-stretchy {
::-moz-math-stretchy {
font-family: [your-particular-list]
}
@ -410,12 +410,12 @@ mtd[-moz-math-columnline="dashed"] {
clicking the pref to override document fonts.
/**************************************************************************/
:-moz-math-font-style-stretchy {
::-moz-math-stretchy {
font-style: normal;
font-family: serif;
/* background-color: #3C6; */
}
:-moz-math-font-style-anonymous {
::-moz-math-anonymous {
}
/**********************************************************************/

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

@ -40,15 +40,12 @@
MATHML_ATOM(fontsize, "-moz-math-font-size") // different from fontsize_
MATHML_ATOM(fontstyle, "-moz-math-font-style") // different from fontstyle_
MATHML_ATOM(fontstyle_stretchy, ":-moz-math-font-style-stretchy")
MATHML_ATOM(fontstyle_anonymous, ":-moz-math-font-style-anonymous")
MATHML_ATOM(rowline, "-moz-math-rowline") // different from rowlines_
MATHML_ATOM(columnline, "-moz-math-columnline") // different from columnlines_
MATHML_ATOM(firstrow, "-moz-math-firstrow")
MATHML_ATOM(lastrow, "-moz-math-lastrow")
MATHML_ATOM(firstcolumn, "-moz-math-firstcolumn")
MATHML_ATOM(lastcolumn, "-moz-math-lastcolumn")
MATHML_ATOM(mozMathInline, ":-moz-math-inline")
// Alphabetical list of MathML frame types
MATHML_ATOM(operatorVisibleMathMLFrame, "OperatorVisibleMathMLFrame")

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

@ -103,3 +103,9 @@ CSS_ANON_BOX(moztreeseparator, ":-moz-tree-separator")
CSS_ANON_BOX(moztreedropfeedback, ":-moz-tree-drop-feedback")
CSS_ANON_BOX(moztreeprogressmeter, ":-moz-tree-progressmeter")
#endif
#ifdef MOZ_MATHML
CSS_ANON_BOX(mozMathStretchy, ":-moz-math-stretchy")
CSS_ANON_BOX(mozMathAnonymous, ":-moz-math-anonymous")
CSS_ANON_BOX(mozMathInline, ":-moz-math-inline")
#endif