2009-09-15 Jungshik Shin <jshin@chromium.org>
authorjshin@chromium.org <jshin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Sep 2009 18:36:44 +0000 (18:36 +0000)
committerjshin@chromium.org <jshin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Sep 2009 18:36:44 +0000 (18:36 +0000)
        Reviewed by Eric Seidel

        http://bugs.webkit.org/show_bug.cgi?id=26660

        Chromium Windows: When rotated, the baseline for a span of complex
        script is completely misaligned with that of the adjacent
        simple script text. It's fixed by not applying the baseline offset for
        the Skia code path.

        Test: transforms/2d/hindi-rotated.html

        * platform/graphics/chromium/UniscribeHelper.cpp:
        (WebCore::UniscribeHelper::draw):

2009-09-15  Jungshik Shin  <jshin@chromium.org>

        Reviewed by Eric Seidel

        http://bugs.webkit.org/show_bug.cgi?id=26660

        Chromium Windows: When rotated, the baseline for a span of complex
        script is completely misaligned with that of the adjacent simple
        script text.

        * transforms/2d/hindi-rotated.html: Added.
        * platform/mac/transforms/2d/hindi-rotated-expected.checksum: Added.
        * platform/mac/transforms/2d/hindi-rotated-expected.png: Added.
        * platform/mac/transforms/2d/hindi-rotated-expected.txt: Added.
        * platform/win/transforms: Added.
        * platform/win/transforms/2d: Added.
        * platform/win/transforms/2d/hindi-rotated-expected.checksum: Added.
        * platform/win/transforms/2d/hindi-rotated-expected.png: Added.
        * platform/win/transforms/2d/hindi-rotated-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@48397 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/mac/transforms/2d/hindi-rotated-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/transforms/2d/hindi-rotated-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/transforms/2d/hindi-rotated-expected.txt [new file with mode: 0644]
LayoutTests/platform/win/transforms/2d/hindi-rotated-expected.checksum [new file with mode: 0755]
LayoutTests/platform/win/transforms/2d/hindi-rotated-expected.png [new file with mode: 0755]
LayoutTests/platform/win/transforms/2d/hindi-rotated-expected.txt [new file with mode: 0755]
LayoutTests/transforms/2d/hindi-rotated.html [new file with mode: 0755]
WebCore/ChangeLog
WebCore/platform/graphics/chromium/UniscribeHelper.cpp

index 70b8424..71ea024 100644 (file)
@@ -1,3 +1,23 @@
+2009-09-15  Jungshik Shin  <jshin@chromium.org>
+
+        Reviewed by Eric Seidel
+
+        http://bugs.webkit.org/show_bug.cgi?id=26660
+
+        Chromium Windows: When rotated, the baseline for a span of complex
+        script is completely misaligned with that of the adjacent simple
+        script text.
+
+        * transforms/2d/hindi-rotated.html: Added.
+        * platform/mac/transforms/2d/hindi-rotated-expected.checksum: Added.
+        * platform/mac/transforms/2d/hindi-rotated-expected.png: Added.
+        * platform/mac/transforms/2d/hindi-rotated-expected.txt: Added.
+        * platform/win/transforms: Added.
+        * platform/win/transforms/2d: Added.
+        * platform/win/transforms/2d/hindi-rotated-expected.checksum: Added.
+        * platform/win/transforms/2d/hindi-rotated-expected.png: Added.
+        * platform/win/transforms/2d/hindi-rotated-expected.txt: Added.
+
 2009-09-15  Drew Wilson  <atwilson@google.com>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/platform/mac/transforms/2d/hindi-rotated-expected.checksum b/LayoutTests/platform/mac/transforms/2d/hindi-rotated-expected.checksum
new file mode 100644 (file)
index 0000000..20b0878
--- /dev/null
@@ -0,0 +1 @@
+8c64d67f8cc40853c1c988cb399d0dc9
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/transforms/2d/hindi-rotated-expected.png b/LayoutTests/platform/mac/transforms/2d/hindi-rotated-expected.png
new file mode 100644 (file)
index 0000000..73d743d
Binary files /dev/null and b/LayoutTests/platform/mac/transforms/2d/hindi-rotated-expected.png differ
diff --git a/LayoutTests/platform/mac/transforms/2d/hindi-rotated-expected.txt b/LayoutTests/platform/mac/transforms/2d/hindi-rotated-expected.txt
new file mode 100644 (file)
index 0000000..949f2ad
--- /dev/null
@@ -0,0 +1,35 @@
+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 784x18
+        RenderText {#text} at (0,0) size 141x18
+          text run at (0,0) width 141: "This is to test a fix for "
+        RenderInline {A} at (0,0) size 68x18 [color=#0000EE]
+          RenderText {#text} at (141,0) size 68x18
+            text run at (141,0) width 68: "bug 26660"
+        RenderText {#text} at (209,0) size 4x18
+          text run at (209,0) width 4: "."
+      RenderBlock {P} at (0,508) size 784x0
+layer at (8,101) size 252x40
+  RenderBlock {DIV} at (0,93) size 252x40 [border: (1px solid #008000)]
+    RenderText {#text} at (1,2) size 239x37
+      text run at (1,2) width 239: "Straight \x{916}\x{94B}\x{91C}\x{947}\x{902} \x{92C}\x{941}\x{927}\x{935}\x{93E}\x{930} \x{915}\x{940} \x{938}\x{941}\x{92C}\x{939} \x{939}\x{94B}\x{928}\x{947} \x{935}\x{93E}\x{932}\x{93E}"
+      text run at (1,21) width 74: "\x{92A}\x{942}\x{930}\x{94D}\x{923} 123 abc"
+layer at (8,216) size 252x40
+  RenderBlock {DIV} at (0,208) size 252x40 [border: (1px solid #008000)]
+    RenderText {#text} at (1,2) size 235x37
+      text run at (1,2) width 235: "Now rotated \x{916}\x{94B}\x{91C}\x{947}\x{902} \x{92C}\x{941}\x{927}\x{935}\x{93E}\x{930} \x{915}\x{940} \x{938}\x{941}\x{92C}\x{939} \x{939}\x{94B}\x{928}\x{947}"
+      text run at (1,21) width 108: "\x{935}\x{93E}\x{932}\x{93E} \x{92A}\x{942}\x{930}\x{94D}\x{923} 123 abc"
+layer at (8,331) size 252x54
+  RenderBlock {DIV} at (0,323) size 252x54 [border: (1px solid #008000)]
+    RenderText {#text} at (1,1) size 241x52
+      text run at (1,1) width 241: "Now rotated \x{916}\x{94B}\x{91C}\x{947}\x{902} \x{92C}\x{941}\x{927}\x{935}\x{93E}\x{930} \x{915}\x{940} \x{938}\x{941}\x{92C}\x{939} \x{939}\x{94B}\x{928}\x{947}"
+      text run at (1,27) width 111: "\x{935}\x{93E}\x{932}\x{93E} \x{92A}\x{942}\x{930}\x{94D}\x{923} 123 abc"
+layer at (8,460) size 252x40
+  RenderBlock {DIV} at (0,452) size 252x40 [border: (1px solid #008000)]
+    RenderText {#text} at (1,2) size 235x37
+      text run at (1,2) width 115: "Now rotated \x{916}\x{94B}\x{91C}\x{947}\x{902} "
+      text run at (116,2) width 120: "\x{92C}\x{941}\x{927}\x{935}\x{93E}\x{930} \x{915}\x{940} \x{938}\x{941}\x{92C}\x{939} \x{939}\x{94B}\x{928}\x{947}"
+      text run at (1,21) width 108: "\x{935}\x{93E}\x{932}\x{93E} \x{92A}\x{942}\x{930}\x{94D}\x{923} 123 abc"
diff --git a/LayoutTests/platform/win/transforms/2d/hindi-rotated-expected.checksum b/LayoutTests/platform/win/transforms/2d/hindi-rotated-expected.checksum
new file mode 100755 (executable)
index 0000000..39a71c5
--- /dev/null
@@ -0,0 +1 @@
+fba1b6ecb99717690368122ee75c0fca
\ No newline at end of file
diff --git a/LayoutTests/platform/win/transforms/2d/hindi-rotated-expected.png b/LayoutTests/platform/win/transforms/2d/hindi-rotated-expected.png
new file mode 100755 (executable)
index 0000000..0e7810b
Binary files /dev/null and b/LayoutTests/platform/win/transforms/2d/hindi-rotated-expected.png differ
diff --git a/LayoutTests/platform/win/transforms/2d/hindi-rotated-expected.txt b/LayoutTests/platform/win/transforms/2d/hindi-rotated-expected.txt
new file mode 100755 (executable)
index 0000000..1dae7ac
--- /dev/null
@@ -0,0 +1,35 @@
+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 784x21
+        RenderText {#text} at (0,0) size 141x20
+          text run at (0,0) width 141: "This is to test a fix for "
+        RenderInline {A} at (0,0) size 68x20 [color=#0000EE]
+          RenderText {#text} at (141,0) size 68x20
+            text run at (141,0) width 68: "bug 26660"
+        RenderText {#text} at (209,0) size 4x20
+          text run at (209,0) width 4: "."
+      RenderBlock {P} at (0,543) size 784x0
+layer at (8,104) size 252x50
+  RenderBlock {DIV} at (0,96) size 252x50 [border: (1px solid #008000)]
+    RenderText {#text} at (1,4) size 248x44
+      text run at (1,4) width 248: "Straight \x{916}\x{94B}\x{91C}\x{947}\x{902} \x{92C}\x{941}\x{927}\x{935}\x{93E}\x{930} \x{915}\x{940} \x{938}\x{941}\x{92C}\x{939} \x{939}\x{94B}\x{928}\x{947} \x{935}\x{93E}\x{932}\x{93E}"
+      text run at (1,28) width 77: "\x{92A}\x{942}\x{930}\x{94D}\x{923} 123 abc"
+layer at (8,229) size 252x50
+  RenderBlock {DIV} at (0,221) size 252x50 [border: (1px solid #008000)]
+    RenderText {#text} at (1,4) size 244x44
+      text run at (1,4) width 244: "Now rotated \x{916}\x{94B}\x{91C}\x{947}\x{902} \x{92C}\x{941}\x{927}\x{935}\x{93E}\x{930} \x{915}\x{940} \x{938}\x{941}\x{92C}\x{939} \x{939}\x{94B}\x{928}\x{947}"
+      text run at (1,28) width 111: "\x{935}\x{93E}\x{932}\x{93E} \x{92A}\x{942}\x{930}\x{94D}\x{923} 123 abc"
+layer at (8,354) size 252x56
+  RenderBlock {DIV} at (0,346) size 252x56 [border: (1px solid #008000)]
+    RenderText {#text} at (1,1) size 236x54
+      text run at (1,1) width 236: "Now rotated \x{916}\x{94B}\x{91C}\x{947}\x{902} \x{92C}\x{941}\x{927}\x{935}\x{93E}\x{930} \x{915}\x{940} \x{938}\x{941}\x{92C}\x{939}"
+      text run at (1,28) width 156: "\x{939}\x{94B}\x{928}\x{947} \x{935}\x{93E}\x{932}\x{93E} \x{92A}\x{942}\x{930}\x{94D}\x{923} 123 abc"
+layer at (8,485) size 252x50
+  RenderBlock {DIV} at (0,477) size 252x50 [border: (1px solid #008000)]
+    RenderText {#text} at (1,4) size 244x44
+      text run at (1,4) width 117: "Now rotated \x{916}\x{94B}\x{91C}\x{947}\x{902} "
+      text run at (118,4) width 127: "\x{92C}\x{941}\x{927}\x{935}\x{93E}\x{930} \x{915}\x{940} \x{938}\x{941}\x{92C}\x{939} \x{939}\x{94B}\x{928}\x{947}"
+      text run at (1,28) width 111: "\x{935}\x{93E}\x{932}\x{93E} \x{92A}\x{942}\x{930}\x{94D}\x{923} 123 abc"
diff --git a/LayoutTests/transforms/2d/hindi-rotated.html b/LayoutTests/transforms/2d/hindi-rotated.html
new file mode 100755 (executable)
index 0000000..c688f23
--- /dev/null
@@ -0,0 +1,29 @@
+<html>
+<head>
+<meta charset="UTF-8">
+<title>Test for webkit bug 26660</title>
+</head>
+<body>
+<p>This is to test a fix for <a href="http://bugs.webkit.org/show_bug.cgi?id=26660">bug 26660</a>.</p>
+
+<div style="border:1px solid green; margin-top:75px; width:250px; opacity:0.5; font-size:16px;"> 
+Straight खोजें
+बुधवार की सुबह होने वाला पूर्ण 123 abc
+</div> 
+<div style="border:1px solid green; margin-top:75px; width:250px; -webkit-transform:rotate(30deg); opacity:0.5; font-size:16px;"> 
+Now rotated खोजें
+बुधवार की सुबह होने वाला पूर्ण 123 abc
+</div> 
+<div style="font-family: devanagari mt, mangal, times, times new roman; border:1px solid green; margin-top:75px; width:250px; -webkit-transform:rotate(30deg); opacity:0.5; font-size:16px;"> 
+Now rotated खोजें
+बुधवार की सुबह होने वाला पूर्ण 123 abc
+</div> 
+<div style="font-family: times, times new roman; border:1px solid green; margin-top:75px; width:250px; -webkit-transform:rotate(30deg); opacity:0.5; font-size:16px;"> 
+Now rotated खोजें 
+बुधवार की सुबह होने वाला पूर्ण 123 abc
+</div> 
+</p>
+
+
+</body>
+</html>
index db83ec6..7d4dac0 100644 (file)
@@ -1,3 +1,19 @@
+2009-09-15  Jungshik Shin  <jshin@chromium.org>
+
+        Reviewed by Eric Seidel
+
+        http://bugs.webkit.org/show_bug.cgi?id=26660
+
+        Chromium Windows: When rotated, the baseline for a span of complex
+        script is completely misaligned with that of the adjacent 
+        simple script text. It's fixed by not applying the baseline offset for
+        the Skia code path.
+
+        Test: transforms/2d/hindi-rotated.html
+
+        * platform/graphics/chromium/UniscribeHelper.cpp:
+        (WebCore::UniscribeHelper::draw):
+
 2009-09-15  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Adam Roben.
index bcf5a76..10fcdf6 100644 (file)
@@ -403,7 +403,7 @@ void UniscribeHelper::draw(GraphicsContext* graphicsContext,
                 } else {
                     SkPoint origin;
                     origin.fX = curX + + innerOffset;
-                    origin.fY = y + m_ascent - shaping.m_ascentOffset;
+                    origin.fY = y + m_ascent;
                     textOutOk = paintSkiaText(graphicsContext,
                                               shaping.m_hfont,
                                               glyphCount,