[webkit-dev] Strange Behavior with Anonymous Render Objects

Alex Milowski alex at milowski.org
Thu Dec 17 20:40:20 PST 2009


I have two different rendering objects, one for rendering math rows and one
for rendering fenced math--which is just a special kind of row.  The fenced
math wraps the row with brackets of some kind and puts separators between
the elements.

For example, these are equivalent:

   <mfenced><mi>x</mi><mi>y</mi><mfenced>

   <mrow><mo>(</mo><mi>x</mi><mo>,</mo><mi>y</mi><mo>)</mo></mrow>

The inserted parenthesis and commas for the implementation of mfenced
are all anonymous render objects.  Given the above example, in my code
the both end up with the exact same width for each of the contained
inline blocks (how I render them).

In the case of the mrow example, everything works fine.  For mfenced, it
does not and the last element wraps to the next line.

I've looked at the box metrics and they are the same in both cases.  Something
seems to be strange in the layout of the inline blocks when there are anonymous
render objects.  If I change the layout of mfenced to explicitly add
exactly one
pixel to the width, the mfenced does its layout correctly.

Any ideas as to what is going on?

-- 
--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


More information about the webkit-dev mailing list