[webkit-dev] Showing Baseline and Container Box

2010-01-25 Thread Alex Milowski
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.

Also, what I'd really like is the ability to inspect the full rendering
tree associated with the MathML and turn on this outlining of the
box and baseline for every rendering object in that subtree that reduces
to a RenderBoxModelObject instance.

Is there some tool that could do this already or via some modification?

-- 
--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@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] Showing Baseline and Container Box

2010-01-25 Thread Maciej Stachowiak

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

 
 Also, what I'd really like is the ability to inspect the full rendering
 tree associated with the MathML and turn on this outlining of the
 box and baseline for every rendering object in that subtree that reduces
 to a RenderBoxModelObject instance.
 
 Is there some tool that could do this already or via some modification?

Not that I know of. I think when people want to debug the box model visually 
they usually just rely on style rules to set borders or backgrounds.

Regards,
Maciej

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] Showing Baseline and Container Box

2010-01-25 Thread Alex Milowski
On Mon, Jan 25, 2010 at 10:31 AM, Maciej Stachowiak m...@apple.com wrote:

 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.

Doesn't ENABLE() require a feature define?

-- 
--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@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] Showing Baseline and Container Box

2010-01-25 Thread David Kilzer
On Mon, January 25, 2010 10:42:56 AM, Alex Milowski wrote:

 On Mon, Jan 25, 2010 at 10:31 AM, Maciej Stachowiak wrote:
 
  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.
 
 Doesn't ENABLE() require a feature define?


No, not necessarily.  If the ENABLE() macro doesn't require something like a 
different set of export symbols on Mac OS X builds, then you don't have to do 
the whole feature define thing.  Some ENABLE() macros are only defined in 
JavaScriptCore/wtf/Platform.h.

If the macro resides in just one source file, I've seen render tree debugging 
macros added to just the source file and defined at the top.  (If you can get 
by with putting the macro in one header file, that would work as well.)

Dave

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev