[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 08:04:38 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 1673bee79f36989ec0abdd7b9f1e3e50fea04916
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 24 21:07:51 2003 +0000

    	Two fixes to the computation of min/max width for text runs.
    	(1) Make sure that pre runs don't add in word-spacing to the last word on a line (e.g., when a newline explicitly
    	breaks a pre).
    	(2) Fix a bug where breakable characters weren't getting factored into minwidth properly.  When a word got broken
    	because of a breakable character, we were treating the breakable character like a space, and not including its
    	width as part of the minimum width of the text run.
    
            Reviewed by john
    
            * khtml/rendering/render_text.cpp:
            (RenderText::calcMinMaxWidth):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5254 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 1a7411d..9f6bb2e 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,17 @@
+2003-10-24  David Hyatt  <hyatt at apple.com>
+
+	Two fixes to the computation of min/max width for text runs.
+	(1) Make sure that pre runs don't add in word-spacing to the last word on a line (e.g., when a newline explicitly
+	breaks a pre).
+	(2) Fix a bug where breakable characters weren't getting factored into minwidth properly.  When a word got broken
+	because of a breakable character, we were treating the breakable character like a space, and not including its
+	width as part of the minimum width of the text run.
+	
+        Reviewed by john
+
+        * khtml/rendering/render_text.cpp:
+        (RenderText::calcMinMaxWidth):
+
 2003-10-23  David Hyatt  <hyatt at apple.com>
 
 	This patch fixes the pseudo-elements ::first-line and ::first-letter to inherit styles properly.  More
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 1a7411d..9f6bb2e 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,17 @@
+2003-10-24  David Hyatt  <hyatt at apple.com>
+
+	Two fixes to the computation of min/max width for text runs.
+	(1) Make sure that pre runs don't add in word-spacing to the last word on a line (e.g., when a newline explicitly
+	breaks a pre).
+	(2) Fix a bug where breakable characters weren't getting factored into minwidth properly.  When a word got broken
+	because of a breakable character, we were treating the breakable character like a space, and not including its
+	width as part of the minimum width of the text run.
+	
+        Reviewed by john
+
+        * khtml/rendering/render_text.cpp:
+        (RenderText::calcMinMaxWidth):
+
 2003-10-23  David Hyatt  <hyatt at apple.com>
 
 	This patch fixes the pseudo-elements ::first-line and ::first-letter to inherit styles properly.  More
diff --git a/WebCore/khtml/rendering/render_text.cpp b/WebCore/khtml/rendering/render_text.cpp
index d6f4453..0f4b096 100644
--- a/WebCore/khtml/rendering/render_text.cpp
+++ b/WebCore/khtml/rendering/render_text.cpp
@@ -1065,7 +1065,8 @@ void RenderText::calcMinMaxWidth()
             continue;
         
         int wordlen = 0;
-        while( i+wordlen < len && !(isBreakable( str->s, i+wordlen, str->l )) )
+        while (i+wordlen < len && str->s[i+wordlen] != '\n' && str->s[i+wordlen] != ' ' &&
+               (wordlen == 0 || !isBreakable( str->s, i+wordlen, str->l)))
             wordlen++;
             
         if (wordlen)
@@ -1078,8 +1079,12 @@ void RenderText::calcMinMaxWidth()
             currMinWidth += w;
             currMaxWidth += w;
             
-            // Add in wordspacing to our maxwidth, but not if this is the last word.
-            if (wordSpacing && !containsOnlyWhitespace(i+wordlen, len-(i+wordlen)))
+            bool isBreakableCharSpace = (i+wordlen < len) ? ((!isPre && str->s[i+wordlen] == '\n') || 
+                                                             str->s[i+wordlen] == ' ') : false;
+
+            // Add in wordspacing to our maxwidth, but not if this is the last word on a line or the
+            // last word in the run.
+            if (wordSpacing && isBreakableCharSpace && !containsOnlyWhitespace(i+wordlen, len-(i+wordlen)))
                 currMaxWidth += wordSpacing;
 
             if (firstWord) {
@@ -1088,7 +1093,7 @@ void RenderText::calcMinMaxWidth()
             }
             m_endMinWidth = w;
             
-            if(currMinWidth > m_minWidth) m_minWidth = currMinWidth;
+            if (currMinWidth > m_minWidth) m_minWidth = currMinWidth;
             currMinWidth = 0;
                 
             i += wordlen-1;
@@ -1099,12 +1104,12 @@ void RenderText::calcMinMaxWidth()
             if (style()->whiteSpace() != NOWRAP)
                 m_hasBreakableChar = true;
 
-            if(currMinWidth > m_minWidth) m_minWidth = currMinWidth;
+            if (currMinWidth > m_minWidth) m_minWidth = currMinWidth;
             currMinWidth = 0;
-                
-            if (str->s[i] == '\n' && isPre)
+            
+            if (isNewline) // Only set if isPre was true and we saw a newline.
             {
-                if(currMaxWidth > m_maxWidth) m_maxWidth = currMaxWidth;
+                if (currMaxWidth > m_maxWidth) m_maxWidth = currMaxWidth;
                 currMaxWidth = 0;
             }
             else

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list