MathML widget : XML or HTML elements?
Ellis Whitehead
kde at ellisw.net
Wed Apr 10 14:27:56 BST 2002
First a quick baseline question: how do you let khtml know what the baseline
of an element's rendering should be? Currently, if the mathml object's
baseline is not the same as its y-max, the formula doesn't get painted in
line with surrounding text.
On Wednesday 10 April 2002 07:58, Lars Knoll wrote:
> All this would probably mean a partly rewrite of KMathMLView, moving over
> to khtml DOM classes, and maybe putting all that in a seperate subdir in
> khtml.
Is ElementImpl then the best parent class for mathml nodes?
> You might still need to hack the html/xml parsers to create your MathML
> elements in this case and add the list of math tags to the taglist, but you
> should not need to do much more.
My only concern is that this would then dominate the taglist: there are around
200 MathML tags, in contrast to the ~100 tags that it currently consists of.
Would this cause a performance hit? I don't think it would actually, since
the switch() statements will only check for them when there's an ID_MATH
parent... so if this is acceptable (?) then it sounds like the solution to
the problem.
> > Furthermore, I currently have formatting defaults hardcoded into the
> > widget (such as the % font size of superscripts). I'd rather have this
> > defined by a CSS style sheet. How do you read in a style sheet?
>
> If you use khtml this gets automatically done for you. You get a style
> element for every node in the DOM (a RenderStyle object) containing all the
> definitions you need
I think we may ultimately want to have a default MathML stylesheet that <math>
rendering is based on. A w3c.org example is at:
http://www.w3.org/TR/MathML2/appendixg.html
Can the MATH node trigger a reading in of some kmathml.css style sheet, or
maybe I should just use that to base the defaults on?
Cheers,
Ellis
More information about the kde-core-devel
mailing list