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


The following commit has been merged in the debian/unstable branch:
commit fe99c879d9f7121dc5152c727031bcd7bacdbbea
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jul 31 22:25:29 2003 +0000

    	Fix for "The Matrix" stylesheet on meyerweb.com and for 26(!) of the
    	layout tests.  Basically when laying out a line, you have a beginning, and end,
    	and midpoints in between that tell you what whitespace to skip over.  It was
    	possible to end up with the last midpoint being a start point that was past the
    	end of the line, and in that case, we would sometimes not strip off the trailing
    	space at the end of the line like we should.
    
    	This patch adds a simple function to check for this condition.  It strips off the
    	out-of-bounds midpoint, and then shaves off the trailing space from the previous
    	midpoint if it's necessary to do so.
    
    	Also fix the way spaces are counted so that we don't add in spaces for text that
    	is not part of any bidi runs.
    
            Reviewed by john
    
            * khtml/rendering/bidi.cpp:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4749 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 4e904e0..4bbca24 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,23 @@
+2003-07-31  Dave Hyatt  <hyatt at apple.com>
+
+	Fix for "The Matrix" stylesheet on meyerweb.com and for 26(!) of the
+	layout tests.  Basically when laying out a line, you have a beginning, and end,
+	and midpoints in between that tell you what whitespace to skip over.  It was
+	possible to end up with the last midpoint being a start point that was past the
+	end of the line, and in that case, we would sometimes not strip off the trailing
+	space at the end of the line like we should.
+
+	This patch adds a simple function to check for this condition.  It strips off the
+	out-of-bounds midpoint, and then shaves off the trailing space from the previous
+	midpoint if it's necessary to do so.
+
+	Also fix the way spaces are counted so that we don't add in spaces for text that 
+	is not part of any bidi runs.
+	
+        Reviewed by john
+
+        * khtml/rendering/bidi.cpp:
+
 2003-07-30  Richard Williamson   <rjw at apple.com>
 
 	Preparation for 3095376.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 4e904e0..4bbca24 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,23 @@
+2003-07-31  Dave Hyatt  <hyatt at apple.com>
+
+	Fix for "The Matrix" stylesheet on meyerweb.com and for 26(!) of the
+	layout tests.  Basically when laying out a line, you have a beginning, and end,
+	and midpoints in between that tell you what whitespace to skip over.  It was
+	possible to end up with the last midpoint being a start point that was past the
+	end of the line, and in that case, we would sometimes not strip off the trailing
+	space at the end of the line like we should.
+
+	This patch adds a simple function to check for this condition.  It strips off the
+	out-of-bounds midpoint, and then shaves off the trailing space from the previous
+	midpoint if it's necessary to do so.
+
+	Also fix the way spaces are counted so that we don't add in spaces for text that 
+	is not part of any bidi runs.
+	
+        Reviewed by john
+
+        * khtml/rendering/bidi.cpp:
+
 2003-07-30  Richard Williamson   <rjw at apple.com>
 
 	Preparation for 3095376.
diff --git a/WebCore/khtml/rendering/bidi.cpp b/WebCore/khtml/rendering/bidi.cpp
index 4743756..88aae21 100644
--- a/WebCore/khtml/rendering/bidi.cpp
+++ b/WebCore/khtml/rendering/bidi.cpp
@@ -333,6 +333,14 @@ static void addRun(BidiRun* bidiRun)
     }
     sBidiRunCount++;
     bidiRun->compact = sBuildingCompactRuns;
+
+    // Compute the number of spaces in this run,
+    if (bidiRun->obj && bidiRun->obj->isText()) {
+        RenderText* text = static_cast<RenderText*>(bidiRun->obj);
+        for (int i = bidiRun->start; i < bidiRun->stop; i++)
+            if (text->text()[i].direction() == QChar::DirWS)
+                numSpaces++;
+    }
 }
 
 static void reverseRuns(int start, int end)
@@ -384,6 +392,27 @@ static void reverseRuns(int start, int end)
         sLastBidiRun = startRun;
 }
 
+static void checkMidpoints(BidiIterator& lBreak)
+{
+    // Check to see if our last midpoint is a start point beyond the line break.  If so,
+    // shave it off the list, and shave off a trailing space if the previous end point isn't
+    // white-space: pre.
+    if (lBreak.obj && sNumMidpoints && sNumMidpoints%2 == 0) {
+        BidiIterator* midpoints = smidpoints->data();
+        BidiIterator& endpoint = midpoints[sNumMidpoints-2];
+        const BidiIterator& startpoint = midpoints[sNumMidpoints-1];
+        BidiIterator currpoint = endpoint;
+        while (!currpoint.atEnd() && currpoint != startpoint && currpoint != lBreak)
+            ++currpoint;
+        if (currpoint == lBreak) {
+            // We hit the line break before the start point.  Shave off the start point.
+            sNumMidpoints--;
+            if (endpoint.obj->style()->whiteSpace() != PRE)
+                endpoint.pos--;
+        }
+    }    
+}
+
 static void addMidpoint(const BidiIterator& midpoint)
 {
     if (!smidpoints)
@@ -1023,7 +1052,7 @@ void RenderBlock::bidiReorderLine(const BidiIterator &start, const BidiIterator
             // ### implement rule L1
             break;
         case QChar::DirWS:
-	    numSpaces++;
+            break;
         case QChar::DirON:
             break;
         default:
@@ -1829,6 +1858,9 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start)
     kdDebug(6041) << "regular break sol: " << start.obj << " " << start.pos << "   end: " << lBreak.obj << " " << lBreak.pos << "   width=" << w << endl;
 #endif
 
+    // Sanity check our midpoints.
+    checkMidpoints(lBreak);
+        
     if (trailingSpaceObject) {
         // This object is either going to be part of the last midpoint, or it is going
         // to be the actual endpoint.  In both cases we just decrease our pos by 1 level to

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list