MathML widget : XML or HTML elements?
Ellis Whitehead
kde at ellisw.net
Mon Apr 8 01:41:44 BST 2002
I have a MathML widget working in khtml now. Currently all the text between
the <math> & </math> tags gets passed to the KMathMLView widget, which parses
it using the QDom-classes. There are a couple major short-comings here: 1)
style settings aren't handled and 2) the nodes aren't externally accessable
(e.g. via javascript).
How should I make the MathML nodes javascript accessable?
One possibility would be to use the ElementImpl class as a parent for the
(currently internal) KMathML node classes so that each child node is made a
part of the khtml DOM tree, but then do I need to create both XML & HTML
element implementations? So far, I've created HTMLMathElement* and
RenderMath classes, added ID_MATH the tokens list, and edited htmlparser.cpp
and htmltokenizer.cpp to handle the <math> tag. I'm betting that this is the
wrong way to go about it. MathML is, after all, an XML spec, so there must
be some way to make khtml aware of the XML definition? In order to get full
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?
Thanks,
Ellis
More information about the kde-core-devel
mailing list