[webkit-dev] RenderObject is-a boolean methods
alex at milowski.org
Mon Jan 4 15:21:13 PST 2010
On Mon, Jan 4, 2010 at 1:02 PM, Eric Seidel <eric at webkit.org> wrote:
> My understanding is that RenderObject::isRenderMathMLBlock() is the
> right approach, yes. Although if MathML base renderer (like
> RenderBoxModelObject or RenderSVGModelObject), then an
> isMathMLModelObject() would be even better. Then you only add one
> method to RenderObject and the rest can go on your base renderer.
The base for all my objects is currently RenderBlock as I use the line
layout for its interior. Most of the time they are set to display as
If the line layout was more of a generic algorithm, I could reuse it
without having to inherit from RenderBlock. I suspect there are times
where I may not want RenderBlock as a parent. In other cases, I
use other render objects directly (e.g. RenderTable for mtable).
In MathML, even simple elements like "mo" (math operator) can
have complex content. For example, a stretchable operator like
a left bracket is made from stacking left-to-right glyphs vertically. I
currently use a sequence of blocks stacked vertically to handle
this and it seems to work quite nicely.
While I have some reservations about inheriting from RenderBlock, for
now this seems like the right thing to do. My only other option
would be somehow "duplicate" the line layout--which is something
I have no justification for right now.
"The excellence of grammar as a guide is proportional to the paucity of the
inflexions, i.e. to the degree of analysis effected by the language
Bertrand Russell in a footnote of Principles of Mathematics
More information about the webkit-dev