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

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:20:53 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 46d36471e27376c4a86e646a1fe84a974f57f42c
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jan 5 22:52:28 2004 +0000

    	Fix for 3514454.  Work-around added for 3521759.
    
    	Filed 3521781 to cover deeper problem.
    
            Reviewed by Kocienda.
    
            * WebCoreSupport.subproj/WebTextRenderer.m:
            (-[WebTextRenderer _ATSU_drawHighlightForRun:style:atPoint:]):
            (-[WebTextRenderer _ATSU_pointToOffset:style:position:reversed:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5856 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index f532846..8048ab9 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,15 @@
+2004-01-05  Richard Williamson   <rjw at apple.com>
+
+	Fix for 3514454.  Work-around added for 3521759.
+
+	Filed 3521781 to cover deeper problem.
+
+        Reviewed by Kocienda.
+
+        * WebCoreSupport.subproj/WebTextRenderer.m:
+        (-[WebTextRenderer _ATSU_drawHighlightForRun:style:atPoint:]):
+        (-[WebTextRenderer _ATSU_pointToOffset:style:position:reversed:]):
+
 2003-12-22  John Sullivan  <sullivan at apple.com>
 
 	- WebKit part of fix for <rdar://problem/3515706>: 
diff --git a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
index 65e5b68..810fb6c 100644
--- a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
+++ b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
@@ -1496,9 +1496,9 @@ static WebCoreTextRun reverseCharactersInRun(const WebCoreTextRun *run)
         selectedLeftX = MIN(FixedToFloat(leadingTrapezoid.upperRight.x), FixedToFloat(leadingTrapezoid.lowerRight.x));
     
     [style->backgroundColor set];
-    
+
     float yPos = point.y - [self ascent];
-    if (style->rtl){
+    if (style->rtl || style->visuallyOrdered){
         WebCoreTextRun completeRun = *aRun;
         completeRun.from = 0;
         completeRun.to = aRun->length;
@@ -1581,11 +1581,33 @@ static WebCoreTextRun reverseCharactersInRun(const WebCoreTextRun *run)
     const WebCoreTextRun *aRun = run;
     WebCoreTextRun swappedRun;
     
+    // Reverse the visually ordered characters.  ATSU will re-reverse.  Ick!
     if (style->visuallyOrdered) {
         swappedRun = reverseCharactersInRun(run);
         aRun = &swappedRun;
     }
 
+    // Work-around for bug (352175) in ATSUPositionToOffset().  ATSUPositionToOffset will
+    // always return a zero offset if a ATSUTextLayout is created with a non-zero
+    // starting character offset.
+    // The work-around creates a 'sub' run from the run with a starting position
+    // of 0 and creates a ATSUTextLayout with that 'sub' run.
+#define WORKAROUND_3521759 1
+#if WORKAROUND_3521759
+    WebCoreTextRun subRun;
+    if (run->from != 0) {
+        subRun.length = (aRun->length - aRun->from);
+        subRun.from = 0;
+        subRun.to = aRun->to - aRun->from;
+        subRun.characters = (UniChar *)malloc(sizeof(UniChar) * subRun.length);
+        memcpy ((void *)subRun.characters, &aRun->characters[aRun->from], sizeof(UniChar) * subRun.length);
+        aRun = &subRun;
+    }
+    else {
+        subRun.characters = 0;
+    }
+#endif
+    
     layout = [self _createATSUTextLayoutForRun:aRun];
 
     status = ATSUPositionToOffset(layout, FloatToFixed(x), FloatToFixed(-1), &primaryOffset, &isLeading, &secondaryOffset);
@@ -1595,9 +1617,15 @@ static WebCoreTextRun reverseCharactersInRun(const WebCoreTextRun *run)
     else {
         // Failed to find offset!  Return 0 offset.
     }
-    
-    if (style->visuallyOrdered)
+       
+    if (style->visuallyOrdered) {
         free ((void *)swappedRun.characters);
+    }
+
+#if WORKAROUND_3521759
+    if (subRun.characters != run->characters)
+        free ((void *)subRun.characters);
+#endif
 
     return offset;
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list