[webkit-dev] RenderObject is-a boolean methods

Eric Seidel eric at webkit.org
Mon Jan 4 15:24:53 PST 2010


I agree that line-layout logic could be split out of RenderBlock at
some point.  RenderSVGBlock inherits from RenderBlock in order to get
line layout logic, yet it probably doesn't want to be a real
RenderBlock long term.

-eric

On Mon, Jan 4, 2010 at 3:21 PM, Alex Milowski <alex at milowski.org> wrote:
> 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
> "inline-block".
>
> 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.
>
>
> --
> --Alex Milowski
> "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
> considered."
>
> Bertrand Russell in a footnote of Principles of Mathematics
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>


More information about the webkit-dev mailing list