Bug 76464 - list rendering: lines don't break (3.2.1 regression?)
Summary: list rendering: lines don't break (3.2.1 regression?)
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-01 00:10 UTC by Daniel Naber
Modified: 2004-03-01 02:34 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Naber 2004-03-01 00:10:11 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

Lines in <ul><li>...</li></ul> don't break anymore, e.g. in this example:

<HTML>
<HEAD>
  <TITLE>test</TITLE>
</HEAD>
<BODY>

<ul>
<li>You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.</li>
</ul>

</BODY>
</HTML>
Comment 1 Maksim Orlovich 2004-03-01 01:44:28 UTC
Confirm broken in HEAD, too.
Comment 2 Dirk Mueller 2004-03-01 02:34:10 UTC
CVS commit by mueller: 

grrrr... 
CCMAIL: 76464-done@bugs.kde.org


  M +46 -37    bidi.cpp   1.186


--- kdelibs/khtml/rendering/bidi.cpp  #1.185:1.186
@@ -1347,6 +1347,7 @@ BidiIterator RenderBlock::findNextLineBr
                 int lastSpace = pos;
                 bool isPre = style()->whiteSpace() == PRE;
-                currentCharacterIsSpace = str[pos] == ' ' || (!isPre && str[pos] == '\n');
+
                 while(len) {
+                    currentCharacterIsSpace = str[pos] == ' ' || (!isPre && str[pos] == '\n');
                     if( (isPre && str[pos] == '\n') ||
                         (!isPre && isBreakable( str, pos, strlen ) ) ) {
@@ -1360,6 +1363,13 @@ BidiIterator RenderBlock::findNextLineBr
 #endif
                     if ( !isPre && w + tmpW > width && w == 0 ) {
-                        int fb = floatBottom();
+                            int fb = nearestFloatBottom(m_height);
                         int newLineWidth = lineWidth(fb);
+                            int lastFloatBottom = m_height;
+                            while ( lastFloatBottom < fb && tmpW > newLineWidth ) {
+                                lastFloatBottom = fb;
+                                fb = nearestFloatBottom( fb );
+                                newLineWidth = lineWidth( fb );
+                            }
+
                         if(!w && m_height < fb && width < newLineWidth) {
                             m_height = fb;
@@ -1370,18 +1380,21 @@ BidiIterator RenderBlock::findNextLineBr
                         }
                     }
-                    if ( !isPre && w + tmpW > width )
+
+                        if ( w + tmpW > width && o->style()->whiteSpace() == NORMAL )
                         goto end;
 
+                        if ( isPre && str[pos] == '\n' ) {
                     lBreak.obj = o;
                     lBreak.pos = pos;
-
-                    if( str[pos] == '\n' ) {
-#ifdef DEBUG_LINEBREAKS
-                        kdDebug(6041) << "forced break sol: " << start.obj << " " << start.pos << "   end: " << lBreak.obj << " " << lBreak.pos << "   width=" << w << endl;
-#endif
                         return lBreak;
                     }
+
+                        if ( o->style()->whiteSpace() == NORMAL ) {
                     w += tmpW;
                     tmpW = 0;
+                            lBreak.obj = o;
+                            lBreak.pos = pos;
+                        }
+
                     lastSpace = pos;
                 }
@@ -1528,8 +1541,4 @@ BidiIterator RenderBlock::findNextLineBr
     // of the next object instead to avoid confusing the rest of the
     // code.
-    if (lBreak.pos > 0) {
-        lBreak.pos--;
-        ++lBreak;
-    }
 
 #ifdef DEBUG_LINEBREAKS