[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

mitz at apple.com mitz at apple.com
Wed Apr 7 23:15:39 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 8f64980de73e7faff1f526ab389d092cfa463bd9
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 30 00:49:42 2009 +0000

    WebCore: Complete the fix for hit-testing and selection highlighting in ligatures for the ATSUI
    code path.
    
    Reviewed by Sam Weinig.
    
    * platform/graphics/mac/ComplexTextController.h: Added m_ltr member to ComplexTextRun.
    * platform/graphics/mac/ComplexTextControllerATSUI.cpp:
    (WebCore::ComplexTextController::ComplexTextRun::overrideLayoutOperation): Skip over deleted
    glyphs, but update indexes and advances correctly.
    (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Initialize m_ltr.
    
    LayoutTests: Updated a test to account for font metric differences between Mac OS X versions. Removed
    Leopard-specific results for another test now that Leopard matches current behavior.
    
    Reviewed by Sam Weinig.
    
    * platform/mac-leopard/fast/text/atsui-multiple-renderers-expected.checksum: Removed.
    * platform/mac-leopard/fast/text/atsui-multiple-renderers-expected.png: Removed.
    * platform/mac-leopard/fast/text/atsui-multiple-renderers-expected.txt: Removed.
    * platform/mac/fast/text/ligature-subdivision-expected.txt:
    * platform/mac/fast/text/script-tests/ligature-subdivision.js:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50312 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index c2388ec..aef787d 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2009-10-29  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Updated a test to account for font metric differences between Mac OS X versions. Removed
+        Leopard-specific results for another test now that Leopard matches current behavior.
+
+        * platform/mac-leopard/fast/text/atsui-multiple-renderers-expected.checksum: Removed.
+        * platform/mac-leopard/fast/text/atsui-multiple-renderers-expected.png: Removed.
+        * platform/mac-leopard/fast/text/atsui-multiple-renderers-expected.txt: Removed.
+        * platform/mac/fast/text/ligature-subdivision-expected.txt:
+        * platform/mac/fast/text/script-tests/ligature-subdivision.js:
+
 2009-10-29  Enrica Casucci  <enrica at apple.com>
 
         REGRESSION(3.2.3 - 4.0.2): Message composing: when I undo a color change to text in Mail, undo/redo behaves strangely
diff --git a/LayoutTests/platform/mac-leopard/fast/text/atsui-multiple-renderers-expected.checksum b/LayoutTests/platform/mac-leopard/fast/text/atsui-multiple-renderers-expected.checksum
deleted file mode 100644
index 1c11a29..0000000
--- a/LayoutTests/platform/mac-leopard/fast/text/atsui-multiple-renderers-expected.checksum
+++ /dev/null
@@ -1 +0,0 @@
-d4858966e87999f6d441f740531e1919
\ No newline at end of file
diff --git a/LayoutTests/platform/mac-leopard/fast/text/atsui-multiple-renderers-expected.png b/LayoutTests/platform/mac-leopard/fast/text/atsui-multiple-renderers-expected.png
deleted file mode 100644
index b63f8d9..0000000
Binary files a/LayoutTests/platform/mac-leopard/fast/text/atsui-multiple-renderers-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/mac-leopard/fast/text/atsui-multiple-renderers-expected.txt b/LayoutTests/platform/mac-leopard/fast/text/atsui-multiple-renderers-expected.txt
deleted file mode 100644
index 3d9df34..0000000
--- a/LayoutTests/platform/mac-leopard/fast/text/atsui-multiple-renderers-expected.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x576
-      RenderBlock {P} at (0,0) size 784x36
-        RenderText {#text} at (0,0) size 104x18
-          text run at (0,0) width 104: "This is a test for "
-        RenderInline {I} at (0,0) size 757x36
-          RenderText {#text} at (104,0) size 757x36
-            text run at (104,0) width 653: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6139 ATSUI code path should implement small caps,"
-            text run at (0,18) width 403: "synthetic bold and oblique and correct metrics for fallback fonts"
-        RenderText {#text} at (403,18) size 4x18
-          text run at (403,18) width 4: "."
-      RenderBlock {HR} at (0,52) size 784x2 [border: (1px inset #000000)]
-      RenderBlock {P} at (0,70) size 784x18
-        RenderText {#text} at (0,0) size 600x18
-          text run at (0,0) width 600: "The two columns should be identical except for the accent over the e and the umlaut over the u."
-      RenderTable {TABLE} at (0,104) size 264x147 [border: none]
-        RenderTableSection {TBODY} at (0,0) size 263x146
-          RenderTableRow {TR} at (0,0) size 263x30
-            RenderTableCell {TD} at (0,0) size 132x30 [border: (1px solid #008000)] [r=0 c=0 rs=1 cs=1]
-              RenderText {#text} at (2,3) size 69x25
-                text run at (2,3) width 69: "Lore\x{300}m "
-              RenderInline {SPAN} at (0,0) size 50x23
-                RenderText {#text} at (71,5) size 50x23
-                  text run at (71,5) width 50: "ipsu\x{308}m"
-              RenderText {#text} at (0,0) size 0x0
-            RenderTableCell {TD} at (132,0) size 131x30 [border: (1px solid #008000)] [r=0 c=1 rs=1 cs=1]
-              RenderText {#text} at (2,3) size 69x25
-                text run at (2,3) width 69: "Lorem "
-              RenderInline {SPAN} at (0,0) size 50x23
-                RenderText {#text} at (71,5) size 50x23
-                  text run at (71,5) width 50: "ipsum"
-              RenderText {#text} at (0,0) size 0x0
-          RenderTableRow {TR} at (0,30) size 263x30
-            RenderTableCell {TD} at (0,30) size 132x30 [border: (1px solid #008000)] [r=1 c=0 rs=1 cs=1]
-              RenderText {#text} at (2,3) size 76x25
-                text run at (2,3) width 76: "Lore\x{300}m "
-              RenderInline {SPAN} at (0,0) size 53x23
-                RenderText {#text} at (78,5) size 53x23
-                  text run at (78,5) width 53: "ipsu\x{308}m"
-              RenderText {#text} at (0,0) size 0x0
-            RenderTableCell {TD} at (132,30) size 131x30 [border: (1px solid #008000)] [r=1 c=1 rs=1 cs=1]
-              RenderText {#text} at (2,3) size 75x25
-                text run at (2,3) width 75: "Lorem "
-              RenderInline {SPAN} at (0,0) size 53x23
-                RenderText {#text} at (77,5) size 53x23
-                  text run at (77,5) width 53: "ipsum"
-              RenderText {#text} at (0,0) size 0x0
-          RenderTableRow {TR} at (0,60) size 263x30
-            RenderTableCell {TD} at (0,60) size 132x30 [border: (1px solid #008000)] [r=2 c=0 rs=1 cs=1]
-              RenderText {#text} at (2,3) size 69x25
-                text run at (2,3) width 69: "Lore\x{300}m "
-              RenderInline {SPAN} at (0,0) size 48x23
-                RenderText {#text} at (71,5) size 48x23
-                  text run at (71,5) width 48: "ipsu\x{308}m"
-              RenderText {#text} at (0,0) size 0x0
-            RenderTableCell {TD} at (132,60) size 131x30 [border: (1px solid #008000)] [r=2 c=1 rs=1 cs=1]
-              RenderText {#text} at (2,3) size 69x25
-                text run at (2,3) width 69: "Lorem "
-              RenderInline {SPAN} at (0,0) size 48x23
-                RenderText {#text} at (71,5) size 48x23
-                  text run at (71,5) width 48: "ipsum"
-              RenderText {#text} at (0,0) size 0x0
-          RenderTableRow {TR} at (0,90) size 263x30
-            RenderTableCell {TD} at (0,90) size 132x30 [border: (1px solid #008000)] [r=3 c=0 rs=1 cs=1]
-              RenderText {#text} at (2,3) size 76x25
-                text run at (2,3) width 76: "Lore\x{300}m "
-              RenderInline {SPAN} at (0,0) size 51x23
-                RenderText {#text} at (78,5) size 51x23
-                  text run at (78,5) width 51: "ipsu\x{308}m"
-              RenderText {#text} at (0,0) size 0x0
-            RenderTableCell {TD} at (132,90) size 131x30 [border: (1px solid #008000)] [r=3 c=1 rs=1 cs=1]
-              RenderText {#text} at (2,3) size 75x25
-                text run at (2,3) width 75: "Lorem "
-              RenderInline {SPAN} at (0,0) size 51x23
-                RenderText {#text} at (77,5) size 51x23
-                  text run at (77,5) width 51: "ipsum"
-              RenderText {#text} at (0,0) size 0x0
-          RenderTableRow {TR} at (0,120) size 263x26
-            RenderTableCell {TD} at (0,120) size 132x26 [border: (1px solid #008000)] [r=4 c=0 rs=1 cs=1]
-              RenderText {#text} at (2,2) size 100x23
-                text run at (2,2) width 100: "Lore\x{300}m ipsu\x{308}m"
-            RenderTableCell {TD} at (132,120) size 131x26 [border: (1px solid #008000)] [r=4 c=1 rs=1 cs=1]
-              RenderText {#text} at (2,2) size 100x23
-                text run at (2,2) width 100: "Lorem ipsum"
-      RenderBlock {HR} at (0,259) size 784x2 [border: (1px inset #000000)]
-      RenderBlock {P} at (0,277) size 784x18
-        RenderText {#text} at (0,0) size 277x18
-          text run at (0,0) width 277: "The following two lines should be identical."
-      RenderBlock {P} at (0,311) size 784x24
-        RenderInline {SPAN} at (0,0) size 334x24 [border: (1px solid #008000)]
-          RenderText {#text} at (1,2) size 332x22
-            text run at (1,2) width 332: "\x{E01}\x{E02}\x{E03}\x{E04}\x{E05}\x{E06}\x{E07}\x{E08}\x{E01}\x{E02}\x{E03}\x{E04}\x{E05}\x{E06}\x{E07}\x{E08}\x{E01}\x{E02}\x{E03}\x{E04}\x{E05}\x{E06}\x{E07}\x{E08}\x{E01}\x{E02}\x{E03}\x{E04}\x{E05}\x{E06}\x{E07}\x{E08}"
-        RenderText {#text} at (0,0) size 0x0
-      RenderBlock {P} at (0,351) size 784x23
-        RenderInline {SPAN} at (0,0) size 334x23 [border: (1px solid #008000)]
-          RenderText {#text} at (1,2) size 332x21
-            text run at (1,2) width 332: "\x{E01}\x{E02}\x{E03}\x{E04}\x{E05}\x{E06}\x{E07}\x{E08}\x{E01}\x{E02}\x{E03}\x{E04}\x{E05}\x{E06}\x{E07}\x{E08}\x{E01}\x{E02}\x{E03}\x{E04}\x{E05}\x{E06}\x{E07}\x{E08}\x{E01}\x{E02}\x{E03}\x{E04}\x{E05}\x{E06}\x{E07}\x{E08}"
-        RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/platform/mac/fast/text/ligature-subdivision-expected.txt b/LayoutTests/platform/mac/fast/text/ligature-subdivision-expected.txt
index 1f2456f..a24561d 100644
--- a/LayoutTests/platform/mac/fast/text/ligature-subdivision-expected.txt
+++ b/LayoutTests/platform/mac/fast/text/ligature-subdivision-expected.txt
@@ -14,7 +14,7 @@ PASS document.caretRangeFromPoint(x - 20, y).startOffset is 0
 PASS document.caretRangeFromPoint(x - 50, y).startOffset is 1
 PASS document.caretRangeFromPoint(x - 64, y).startOffset is 2
 PASS document.caretRangeFromPoint(x - 90, y).startOffset is 3
-PASS range.getBoundingClientRect().width is 65
+PASS w === 65 || w === 61 is true
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/LayoutTests/platform/mac/fast/text/script-tests/ligature-subdivision.js b/LayoutTests/platform/mac/fast/text/script-tests/ligature-subdivision.js
index c1d7f73..7fbb941 100644
--- a/LayoutTests/platform/mac/fast/text/script-tests/ligature-subdivision.js
+++ b/LayoutTests/platform/mac/fast/text/script-tests/ligature-subdivision.js
@@ -47,7 +47,9 @@ shouldBe('document.caretRangeFromPoint(x - 90, y).startOffset', '3');
 
 range.setStart(arabic.firstChild, 0);
 range.setEnd(arabic.firstChild, 2);
-shouldBe('range.getBoundingClientRect().width', '65');
+var w = range.getBoundingClientRect().width;
+// Widths vary between Mac OS X Leopard and current Mac OS X.
+shouldBeTrue('w === 65 || w === 61');
 
 document.body.removeChild(arabic);
 
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d40ad23..ff910c3 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2009-10-29  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Complete the fix for hit-testing and selection highlighting in ligatures for the ATSUI
+        code path.
+
+        * platform/graphics/mac/ComplexTextController.h: Added m_ltr member to ComplexTextRun.
+        * platform/graphics/mac/ComplexTextControllerATSUI.cpp:
+        (WebCore::ComplexTextController::ComplexTextRun::overrideLayoutOperation): Skip over deleted
+        glyphs, but update indexes and advances correctly.
+        (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Initialize m_ltr.
+
 2009-10-29  Enrica Casucci  <enrica at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/platform/graphics/mac/ComplexTextController.h b/WebCore/platform/graphics/mac/ComplexTextController.h
index 0beb108..7a915e2 100644
--- a/WebCore/platform/graphics/mac/ComplexTextController.h
+++ b/WebCore/platform/graphics/mac/ComplexTextController.h
@@ -118,7 +118,10 @@ private:
         const CGGlyph* m_glyphs;
         Vector<CGSize, 64> m_advancesVector;
         const CGSize* m_advances;
+#if USE(ATSUI)
+        bool m_ltr;
         bool m_directionalOverride;
+#endif
     };
 
     void collectComplexTextRuns();
diff --git a/WebCore/platform/graphics/mac/ComplexTextControllerATSUI.cpp b/WebCore/platform/graphics/mac/ComplexTextControllerATSUI.cpp
index dc4961f..2d060c7 100644
--- a/WebCore/platform/graphics/mac/ComplexTextControllerATSUI.cpp
+++ b/WebCore/platform/graphics/mac/ComplexTextControllerATSUI.cpp
@@ -64,22 +64,34 @@ OSStatus ComplexTextController::ComplexTextRun::overrideLayoutOperation(ATSULayo
     }
 
     complexTextRun->m_glyphCount = count;
-    complexTextRun->m_glyphsVector.grow(count);
-    complexTextRun->m_glyphs = complexTextRun->m_glyphsVector.data();
-    complexTextRun->m_advancesVector.grow(count);
-    complexTextRun->m_advances = complexTextRun->m_advancesVector.data();
-    complexTextRun->m_indices.grow(count);
+    complexTextRun->m_glyphsVector.reserveCapacity(count);
+    complexTextRun->m_advancesVector.reserveCapacity(count);
+    complexTextRun->m_indices.reserveCapacity(count);
 
-    CGFloat lastX = FixedToFloat(layoutRecords[j].realPos);
+    bool atBeginning = true;
+    CGFloat lastX = 0;
 
     for (ItemCount i = 0; i < count; ++i, ++j) {
-        complexTextRun->m_glyphsVector[i] = layoutRecords[j].glyphID;
-        complexTextRun->m_indices[i] = layoutRecords[j].originalOffset / 2 + indexOffset;
-        CGFloat x = FixedToFloat(layoutRecords[j + 1].realPos);
-        complexTextRun->m_advancesVector[i] = CGSizeMake(x - lastX, 0);
+        if (layoutRecords[j].glyphID == kATSDeletedGlyphcode) {
+            if (!complexTextRun->m_ltr && !(layoutRecords[j].flags & 0x800))
+                complexTextRun->m_indices[complexTextRun->m_indices.size() - 1] = layoutRecords[j].originalOffset / 2 + indexOffset;
+            complexTextRun->m_glyphCount--;
+            continue;
+        }
+        complexTextRun->m_glyphsVector.uncheckedAppend(layoutRecords[j].glyphID);
+        complexTextRun->m_indices.uncheckedAppend(layoutRecords[j].originalOffset / 2 + indexOffset);
+        CGFloat x = FixedToFloat(layoutRecords[j].realPos);
+        if (!atBeginning)
+            complexTextRun->m_advancesVector.uncheckedAppend(CGSizeMake(x - lastX, 0));
         lastX = x;
+        atBeginning = false;
     }
 
+    complexTextRun->m_advancesVector.uncheckedAppend(CGSizeMake(FixedToFloat(layoutRecords[j].realPos) - lastX, 0));
+
+    complexTextRun->m_glyphs = complexTextRun->m_glyphsVector.data();
+    complexTextRun->m_advances = complexTextRun->m_advancesVector.data();
+
     status = ATSUDirectReleaseLayoutDataArrayPtr(atsuLineRef, kATSUDirectDataLayoutRecordATSLayoutRecordCurrent, reinterpret_cast<void**>(&layoutRecords));
     *callbackStatus = kATSULayoutOperationCallbackStatusContinue;
     return noErr;
@@ -135,6 +147,7 @@ ComplexTextController::ComplexTextRun::ComplexTextRun(ATSUTextLayout atsuTextLay
     , m_characters(characters)
     , m_stringLocation(stringLocation)
     , m_stringLength(stringLength)
+    , m_ltr(ltr)
     , m_directionalOverride(directionalOverride)
 {
     OSStatus status;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list