[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

hyatt hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:35:52 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 1d9e29b02fe99a815e36f003ebb7e444f41840aa
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Apr 10 01:48:53 2003 +0000

            This first fix is a refinement of the patch I produced to fix <nobr>
    	on cnn.com recently.  It wasn't quite good enough to plug the
    	regression on other sites.  This fix just checks the object
    	we're currently breaking on (which is what I meant to do) and
    	not the last object examined (which will always just be the
    	previous object you looked at).
    
    	The code currently in the tree would work if you had two objects
    	like this:
    
    	[Normal Whitespace] [Nowrap Whitespace]
    
    	but not if you had three:
    
    	[Normal][Nowrap][Nowrap]
    
    	Since when you looked at the third object, |last| would be the
    	previous nowrap object and not the normal object.  The line break
    	properly stays at the normal object as long as nowrap objects are
    	encountered, so this patch basically does what the original was
    	intended to do.
    
    	This fixes the line break problems on 1800flowers.com, a line break
    	problem on the bugzilla.mozilla.org layout test, a problem
    	on the zdnet layout test, and 3207196 a regression on livejournal.
    
    	The second fix in this patch is a simple reversal of
    	containsOnlyWhitespace.  The method on RenderText was
    	backwards!  No logical changes have been made... I just inverted
    	all the callers, and then I patched the method.
    
            The third fix is to make images check for == normal instead of != nowrap
            in a few places, thus preventing incorrect line break points from being
            set up.
    
            Reviewed by gramps
    
            * khtml/rendering/bidi.cpp:
            * khtml/rendering/render_text.cpp:
            (RenderText::calcMinMaxWidth):
            (RenderText::containsOnlyWhitespace):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4056 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 9d82212..449fd01 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,47 @@
+2003-04-09  David Hyatt  <hyatt at apple.com>
+
+        This first fix is a refinement of the patch I produced to fix <nobr>
+	on cnn.com recently.  It wasn't quite good enough to plug the
+	regression on other sites.  This fix just checks the object
+	we're currently breaking on (which is what I meant to do) and
+	not the last object examined (which will always just be the
+	previous object you looked at).
+
+	The code currently in the tree would work if you had two objects
+	like this:
+
+	[Normal Whitespace] [Nowrap Whitespace]
+
+	but not if you had three:
+
+	[Normal][Nowrap][Nowrap]
+
+	Since when you looked at the third object, |last| would be the
+	previous nowrap object and not the normal object.  The line break
+	properly stays at the normal object as long as nowrap objects are
+	encountered, so this patch basically does what the original was
+	intended to do.
+
+	This fixes the line break problems on 1800flowers.com, a line break
+	problem on the bugzilla.mozilla.org layout test, a problem
+	on the zdnet layout test, and 3207196 a regression on livejournal.
+
+	The second fix in this patch is a simple reversal of 
+	containsOnlyWhitespace.  The method on RenderText was 
+	backwards!  No logical changes have been made... I just inverted
+	all the callers, and then I patched the method.
+        
+        The third fix is to make images check for == normal instead of != nowrap
+        in a few places, thus preventing incorrect line break points from being
+        set up.
+        
+        Reviewed by gramps
+
+        * khtml/rendering/bidi.cpp:
+        * khtml/rendering/render_text.cpp:
+        (RenderText::calcMinMaxWidth):
+        (RenderText::containsOnlyWhitespace):
+
 2003-04-09  Darin Adler  <darin at apple.com>
 
         Reviewed by Maciej.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 9d82212..449fd01 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,47 @@
+2003-04-09  David Hyatt  <hyatt at apple.com>
+
+        This first fix is a refinement of the patch I produced to fix <nobr>
+	on cnn.com recently.  It wasn't quite good enough to plug the
+	regression on other sites.  This fix just checks the object
+	we're currently breaking on (which is what I meant to do) and
+	not the last object examined (which will always just be the
+	previous object you looked at).
+
+	The code currently in the tree would work if you had two objects
+	like this:
+
+	[Normal Whitespace] [Nowrap Whitespace]
+
+	but not if you had three:
+
+	[Normal][Nowrap][Nowrap]
+
+	Since when you looked at the third object, |last| would be the
+	previous nowrap object and not the normal object.  The line break
+	properly stays at the normal object as long as nowrap objects are
+	encountered, so this patch basically does what the original was
+	intended to do.
+
+	This fixes the line break problems on 1800flowers.com, a line break
+	problem on the bugzilla.mozilla.org layout test, a problem
+	on the zdnet layout test, and 3207196 a regression on livejournal.
+
+	The second fix in this patch is a simple reversal of 
+	containsOnlyWhitespace.  The method on RenderText was 
+	backwards!  No logical changes have been made... I just inverted
+	all the callers, and then I patched the method.
+        
+        The third fix is to make images check for == normal instead of != nowrap
+        in a few places, thus preventing incorrect line break points from being
+        set up.
+        
+        Reviewed by gramps
+
+        * khtml/rendering/bidi.cpp:
+        * khtml/rendering/render_text.cpp:
+        (RenderText::calcMinMaxWidth):
+        (RenderText::containsOnlyWhitespace):
+
 2003-04-09  Darin Adler  <darin at apple.com>
 
         Reviewed by Maciej.
diff --git a/WebCore/khtml/rendering/bidi.cpp b/WebCore/khtml/rendering/bidi.cpp
index 3a03b1c..5a3ff9a 100644
--- a/WebCore/khtml/rendering/bidi.cpp
+++ b/WebCore/khtml/rendering/bidi.cpp
@@ -1490,7 +1490,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start)
             tmpW += o->marginLeft()+o->borderLeft()+o->paddingLeft()+
                     o->marginRight()+o->borderRight()+o->paddingRight();
         } else if ( o->isReplaced() ) {
-            if (o->style()->whiteSpace() != NOWRAP || last->style()->whiteSpace() != NOWRAP) {
+            if (o->style()->whiteSpace() == NORMAL || last->style()->whiteSpace() == NORMAL) {
                 w += tmpW;
                 tmpW = 0;
                 lBreak.obj = o;
@@ -1587,7 +1587,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start)
                     }
                     
                     applyWordSpacing = (wordSpacing && currentCharacterIsSpace && !previousCharacterIsSpace &&
-                        t->containsOnlyWhitespace(pos+1, strlen-(pos+1)));
+                        !t->containsOnlyWhitespace(pos+1, strlen-(pos+1)));
 
 #ifdef DEBUG_LINEBREAKS
                     kdDebug(6041) << "found space at " << pos << " in string '" << QString( str, strlen ).latin1() << "' adding " << tmpW << " new width = " << w << endl;
@@ -1696,10 +1696,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start)
         RenderObject* next = Bidinext(start.par, o);
         bool isNormal = o->style()->whiteSpace() == NORMAL;
         bool checkForBreak = isNormal;
-        if (o->style()->whiteSpace() == NOWRAP && last &&
-            last->style()->whiteSpace() == NORMAL &&
-            w + tmpW > width+1 &&
-            lBreak.obj == last)
+        if (w && w + tmpW > width+1 && lBreak.obj && o->style()->whiteSpace() == NOWRAP)
             checkForBreak = true;
         else if (next && o->isText() && next->isText() && !next->isBR()) {
             if (isNormal || (next->style()->whiteSpace() == NORMAL)) {
@@ -1761,11 +1758,11 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start)
             if (w + tmpW > width+1)
                 goto end;
         }
-        
+
         last = o;
         o = next;
 
-        if (!last->isFloatingOrPositioned() && last->isReplaced() && last->style()->whiteSpace() != NOWRAP) {
+        if (!last->isFloatingOrPositioned() && last->isReplaced() && last->style()->whiteSpace() == NORMAL) {
             // Go ahead and add in tmpW.
             w += tmpW;
             tmpW = 0;
diff --git a/WebCore/khtml/rendering/render_text.cpp b/WebCore/khtml/rendering/render_text.cpp
index 752a5de..93c39f8 100644
--- a/WebCore/khtml/rendering/render_text.cpp
+++ b/WebCore/khtml/rendering/render_text.cpp
@@ -1020,9 +1020,8 @@ void RenderText::calcMinMaxWidth()
             currMinWidth += w;
             currMaxWidth += w;
             
-            // Add in wordspacing to our maxwidth, but not if this is the last word, or if we hit
-            // a breakable character that is not a space.
-            if (wordSpacing && containsOnlyWhitespace(i+wordlen, len-(i+wordlen)))
+            // Add in wordspacing to our maxwidth, but not if this is the last word.
+            if (wordSpacing && !containsOnlyWhitespace(i+wordlen, len-(i+wordlen)))
                 currMaxWidth += wordSpacing;
 
             if (firstWord) {
@@ -1073,7 +1072,7 @@ bool RenderText::containsOnlyWhitespace(unsigned int from, unsigned int len) con
     for (currPos = from; 
          currPos < from+len && (str->s[currPos] == '\n' || str->s[currPos].direction() == QChar::DirWS); 
          currPos++);
-    return currPos < (from+len);
+    return currPos >= (from+len);
 }
 
 int RenderText::minXPos() const

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list