[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:44 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 9a78b274fa2892ed43694e5d7d676ade340d9b15
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 24 22:32:58 2003 +0000

    	Fix for 3133375, the minwidth computation for pres is wrong.  There were a couple of bugs here.
    	One is that pres only should have a breakable character if they contain a newline.  Otherwise they're
    	treated essentially like nowrap.  The other was that m_beginMinWidth and m_endMinWidth needed to be
    	set to the maxwidth of the first line and the maxwidth of the last line respectively for pres instead of
    	being only the first and last words.
    
            Reviewed by mjs
    
            * khtml/rendering/render_text.cpp:
            (RenderText::calcMinMaxWidth):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5257 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 9f6bb2e..5b24276 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,18 @@
 2003-10-24  David Hyatt  <hyatt at apple.com>
 
+	Fix for 3133375, the minwidth computation for pres is wrong.  There were a couple of bugs here.
+	One is that pres only should have a breakable character if they contain a newline.  Otherwise they're
+	treated essentially like nowrap.  The other was that m_beginMinWidth and m_endMinWidth needed to be
+	set to the maxwidth of the first line and the maxwidth of the last line respectively for pres instead of
+	being only the first and last words.
+	
+        Reviewed by mjs
+
+        * khtml/rendering/render_text.cpp:
+        (RenderText::calcMinMaxWidth):
+
+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).
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 9f6bb2e..5b24276 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,18 @@
 2003-10-24  David Hyatt  <hyatt at apple.com>
 
+	Fix for 3133375, the minwidth computation for pres is wrong.  There were a couple of bugs here.
+	One is that pres only should have a breakable character if they contain a newline.  Otherwise they're
+	treated essentially like nowrap.  The other was that m_beginMinWidth and m_endMinWidth needed to be
+	set to the maxwidth of the first line and the maxwidth of the last line respectively for pres instead of
+	being only the first and last words.
+	
+        Reviewed by mjs
+
+        * khtml/rendering/render_text.cpp:
+        (RenderText::calcMinMaxWidth):
+
+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).
diff --git a/WebCore/khtml/rendering/render_text.cpp b/WebCore/khtml/rendering/render_text.cpp
index 0f4b096..2579e2a 100644
--- a/WebCore/khtml/rendering/render_text.cpp
+++ b/WebCore/khtml/rendering/render_text.cpp
@@ -1031,6 +1031,7 @@ void RenderText::calcMinMaxWidth()
     bool isSpace = false;
     bool isPre = style()->whiteSpace() == PRE;
     bool firstWord = true;
+    bool firstLine = true;
     for(int i = 0; i < len; i++)
     {
         const QChar c = str->s[i];
@@ -1095,13 +1096,13 @@ void RenderText::calcMinMaxWidth()
             
             if (currMinWidth > m_minWidth) m_minWidth = currMinWidth;
             currMinWidth = 0;
-                
+            
             i += wordlen-1;
         }
         else {
             // Nowrap can never be broken, so don't bother setting the
-            // breakable character boolean.
-            if (style()->whiteSpace() != NOWRAP)
+            // breakable character boolean. Pre can only be broken if we encounter a newline.
+            if (style()->whiteSpace() == NORMAL || isNewline)
                 m_hasBreakableChar = true;
 
             if (currMinWidth > m_minWidth) m_minWidth = currMinWidth;
@@ -1109,6 +1110,11 @@ void RenderText::calcMinMaxWidth()
             
             if (isNewline) // Only set if isPre was true and we saw a newline.
             {
+                if (firstLine) {
+                    firstLine = false;
+                    m_beginMinWidth = currMaxWidth;
+                }
+                
                 if (currMaxWidth > m_maxWidth) m_maxWidth = currMaxWidth;
                 currMaxWidth = 0;
             }
@@ -1122,9 +1128,15 @@ void RenderText::calcMinMaxWidth()
     if(currMinWidth > m_minWidth) m_minWidth = currMinWidth;
     if(currMaxWidth > m_maxWidth) m_maxWidth = currMaxWidth;
 
-    if (style()->whiteSpace() == NOWRAP)
+    if (style()->whiteSpace() != NORMAL)
         m_minWidth = m_maxWidth;
 
+    if (isPre) {
+        if (firstLine)
+            m_beginMinWidth = m_maxWidth;
+        m_endMinWidth = currMaxWidth;
+    }
+    
     setMinMaxKnown();
     //kdDebug( 6040 ) << "Text::calcMinMaxWidth(): min = " << m_minWidth << " max = " << m_maxWidth << endl;
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list