EVALUATION
To partially address problem with ParagraphView
I suggest to change breakWeight for GlyphView and all descendants.
Breaking on the View boundary is better than splitting it.
*** /tmp/geta27065 Mon May 8 22:29:38 2006
--- GlyphView.java Mon May 8 20:06:05 2006
***************
*** 670,676 ****
return View.ExcellentBreakWeight;
}
// Nothing good to break on.
! return View.GoodBreakWeight;
}
return super.getBreakWeight(axis, pos, len);
}
--- 670,681 ----
return View.ExcellentBreakWeight;
}
// Nothing good to break on.
! // breaking on the View boundary is better than splitting it
! if (p1 == getEndOffset()) {
! return View.GoodBreakWeight;
! } else {
! return View.GoodBreakWeight - 1;
! }
}
return super.getBreakWeight(axis, pos, len);
}
For example : <b>bold</b><i>italic</i>
After this change will be split only:
<b>bold</b>
<i>italic</i>
It is not correct since it should not be wrapped at all but it is much better
than splitting "bold" or "italic" across two rows.
New bug has been created to address ParagraphView minimum span problem:
6423287 [PargraphView returns wrong minimum span]
|
|
|
EVALUATION
There is one more problem with the bug.
Some times we wrap words on character boundaries when we should not.
There are two reasons for that :
1. InlineView returns calculateLonegestWordSpan as the smallest span possible.
It uses word BreakIterator for that. However the length of the longest word is not necessarily the smallest span possible for the InlineView.
For example for " test" calculateLonegestWordSpan returns width of word "test" instead of " test".
solution :
calculateLonegestWordSpan needs to use the same algorithm which is used in GlyphView to break it: spaces or line BreakIterator
2. PargraphView minimum span returns maximum of minimum spans for the views it contains.
That is wrong since we not necessarily break rows on the View boundaries.
For example :
<b>bold</b><i>italic</i>
The minimum width for this should be the width of
<b>bold</b><i>italic</i> but not the
max(width(<b>bold</b>), width(<i>italic</i>))
|
|
|
EVALUATION
There are a few unrelated problems with table implementation which cause this bug:
1. IE and Mozilla give percentage width preference over anything else.
In our implementation for the column preferred width we use Math.max(percentages[col], columnRequirements[col].preferred);
To mimic what other renderers do we should use
Math.max(percentages[col], columnRequirements[col].minimum);
2. When there are images in the table we use default image for loading-image while images are getting loaded.
If the size of the actual image is different than the size of the default image the table should be updated to accommodate it when all images are loaded.
There is a bug in TableView.calculateColumnRequirements implementation. It does not clean old requirements when calculating the new ones.
The algorithm is implemented in such a way that it uses maximum of current values and the one it calculates. Because it does not clean the old requirements
the current values are the old ones. Because it uses maximum the values for the color requirements could not get smaller than the old ones.
If the size of the actual image is smaller than the size of the default one the table column will not get smaller because of that error.
To fix it it we need to clean current columnRequirements in calculateColumnRequirements method.
|
|
|
EVALUATION
Here is stripped down version of the test html file:
--
<TABLE CLASS='LIST' BORDER=1 CELLPADDING=0 CELLSPACING=0 border=1>
<TR>
<TD></TD>
<TD style='width:25px;'>
</TD>
<TD valign=top style='padding-top:0px;padding-left:5px;padding-right:5px;width:1%;'>
<DIV CLASS='pitem'><NOBR><IMG BORDER="0" SRC="_triangle.gif"></NOBR>
</DIV>
</TD>
<TD valign=top COLSPAN=2>
<DIV CLASS='pitem'>
Mit den Funktionen des 'Vertriebsmanagements' binden Sie alle vertrieblichen Aspekte in ein umfassendes Management ein. Sie erhöhen die Effizienz in allen Phasen$
</DIV>
</TD>
</TR>
<TR>
<TD>
</TD>
<TD style='width:25px;'>
</TD>
<TD valign=top style='padding-top:0px;padding-left:5px;padding-right:5px;width:1%;'><DIV CLASS='pitem'><NOBR></NOBR></DIV>
</TD>
<TD valign=top style='padding-top:0px;padding-left:5px;padding-right:5px;width:1%;'><DIV CLASS='pitem'><NOBR><IMG BORDER="0" SRC="_dash.gif"></NOBR></DIV>
</TD>
<TD valign=top COLSPAN=1><DIV CLASS='pitem'>das Definieren von Vorlagen für Aktivitäten, Anlässe und Kundenbenachrichtigungen,</DIV></TD>
</TR>
</TABLE>
--
As a workaround I can suggest to fix html a bit.
remove width:1% from the style for <td>
add width=99% or style width:99% to the <td> with the content.
Tweaked html
--
<TABLE CLASS='LIST' BORDER=1 CELLPADDING=0 CELLSPACING=0 border=1>
<TR>
<TD></TD>
<TD style='width:25px;'>
</TD>
<TD valign=top style='padding-top:0px;padding-left:5px;padding-right:5px;'>
<DIV CLASS='pitem'><NOBR><IMG BORDER="0" SRC="_triangle.gif"></NOBR>
</DIV>
</TD>
<TD valign=top COLSPAN=2>
<DIV CLASS='pitem'>
Mit den Funktionen des 'Vertriebsmanagements' binden Sie alle vertrieblichen Aspekte in ein umfassendes Management ein. Sie erhöhen die Effizienz in allen Phasen$
</DIV>
</TD>
</TR>
<TR>
<TD>
</TD>
<TD style='width:25px;'>
</TD>
<TD valign=top style='padding-top:0px;padding-left:5px;padding-right:5px;'><DIV CLASS='pitem'><NOBR></NOBR></DIV>
</TD>
<TD valign=top style='padding-top:0px;padding-left:5px;padding-right:5px;'><DIV CLASS='pitem'><NOBR><IMG BORDER="0" SRC="_dash.gif"></NOBR></DIV>
</TD>
<TD width=99% valign=top COLSPAN=1><DIV CLASS='pitem'>das Definieren von Vorlagen für Aktivitäten, Anlässe und Kundenbenachrichtigungen,</DIV></TD>
</TR>
</TABLE>
--
|
|
|
|