[webkit-dev] Showing Baseline and Container Box

Alex Milowski alex at milowski.org
Mon Jan 25 10:40:03 PST 2010

On Mon, Jan 25, 2010 at 10:31 AM, Maciej Stachowiak <mjs at apple.com> wrote:
> On Jan 25, 2010, at 10:01 AM, Alex Milowski wrote:
>> For all of my MathML rendering objects I've optionally compiled in a
>> simple override to the paint() method to provide a visual representation
>> of the containing box's boundary and the baseline position.  I've been
>> using this to debug the layout of the Mathematics.
>> What is the proper way to wrap this kind of code when I go to create
>> a patch?  Right now it is a compile time feature that I turn on with
>> a define.
> It's reasonable to use an ENABLE() flag for debugging features like this, in my opinion. I don't know if we have any direct precedent. (OTOH couldn't you get the boundary just using a style rule with a 1px border?)

Using styles doesn't work because I generate a lot of internal rendering objects
that do not map to a specific element.

For example, when doing an mover element, there is an instance of
for the whole mover element but there are anonymous wrappers that
are also instances of RenderMathMLBlock for the base and over constructs.  When
either contains a simple identifier (e.g. mi), the contained render object is
that of a simple inline flow.  As such, the vertical placement is controlled by
this anonymous rendering object whose properties I cannot explore using
the web inspector and whose style is generated internally.

Also, you can't draw the baseline for a box using CSS.

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

Bertrand Russell in a footnote of Principles of Mathematics

More information about the webkit-dev mailing list