<title>Debugging facilities in HTML-Table code</title>
</head>
<body>
<h1>Debugging facilities in HTML-table code</h1>
<h2>Reflow</h2>
<p>The most efficient tool to claim that html-table code is the victim and not the source of layout bugs is a <ahref="http://lxr.mozilla.org/seamonkey/source/layout/doc/frame_reflow_debug.html">frame reflow debug log</a>. Look there especially how the maxElementsize (MES) and desired size are propagated.
<h2>Block Reflow</h2>
<p>
Another way to debug the reflow process is implemented inside <ahref="http://lxr.mozilla.org/seamonkey/source/layout/html/base/src/nsBlockFrame.cpp">nsBlockFrame.cpp</a>. It can be invoked by<p>
<code>set GECKO_BLOCK_DEBUG_FLAGS=reflow</code>
<p>
The available options are:
<ul>
<li><code>reflow</code>
<li><code>really-noisy-reflow</code>
<li><code>max-element-size</code>
<li><code> space-manager</code>
<li><code>verify-lines</code>
<li><code>damage-repair</code>
<li><code>lame-paint-metrics</code>
<li><code>lame-reflow-metrics</code>
<li><code>disable-resize-opt</code>
</ul>
<p>
These options can be combined with a comma separated list
Messages generated by the <code>reflow</code> switch:
<li>and then the computed width and Height from the HTMLReflowState.
</ul>
</ul>
<h2>DEBUG_TABLE_STRATEGY</h2>
<p>
The table layout strategy can be visualized by defining in the <ahref="http://lxr.mozilla.org/seamonkey/source/layout/html/table/src/Makefile.in">makefiles</a> the constant DEBUG_TABLE_STRATEGY.
The <spanclass="log">en</span> stands for entrance (<spanclass="log">ex</span> for leaving a routine). The first line of the data dump shows that no width has yet been assigned to the columns <spanclass="log">mColWidths=-1 -1 -1 -1</span>, <code>-1</code> stands for:
<pre>
#define WIDTH_NOT_SET -1
</pre>
<p>
This is followed by a reference to the column frame pointers:
<p>
<preclass="log">
col frame cache ->
0=00B93138 1=00B931F0 2=024DD728 3=024DD780
</pre>
<p>
This is followed by the information which width has been set for each column. The index of the column, whether it is anonymous and what kind of constrained has been applied<spanclass="log">colIndex=0 isAnonymous=0 constraint=0</span>. The following constraint types are known:
The first column has already the minimum content width, the table column can't shrink below that, the desired content width of <spanclass="log">540</span> twips, that's the space to layout <code>cell 1</code> without wrapping the text and the <spanclass="log">1230</span> which correspond to the <code>style="width:80px"</code> at the first cell. At this step the final size is <spanclass="log">360</span> twips.