Title: [151807] trunk
Revision
151807
Author
[email protected]
Date
2013-06-20 15:15:34 -0700 (Thu, 20 Jun 2013)

Log Message

Initial advance on the first glyph of the run is not correctly set for rtl text.
https://bugs.webkit.org/show_bug.cgi?id=117839
<rdar://problem/13860717>

Reviewed by Sam Weinig.

Source/WebCore: 

We need to set the initial advance to the glyphBuffer, using the
initial advance of the complex run that will be drawn first.
In order to choose the run correctly we must consider the text direction.

Test: fast/text/complex-first-glyph-with-initial-advance.html

* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::advance):

LayoutTests: 

* fast/text/complex-first-glyph-with-initial-advance-expected.html: Added.
* fast/text/complex-first-glyph-with-initial-advance.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (151806 => 151807)


--- trunk/LayoutTests/ChangeLog	2013-06-20 21:42:51 UTC (rev 151806)
+++ trunk/LayoutTests/ChangeLog	2013-06-20 22:15:34 UTC (rev 151807)
@@ -1,3 +1,14 @@
+2013-06-20  Enrica Casucci  <[email protected]>
+
+        Initial advance on the first glyph of the run is not correctly set for rtl text.
+        https://bugs.webkit.org/show_bug.cgi?id=117839
+        <rdar://problem/13860717>
+
+        Reviewed by Sam Weinig.
+
+        * fast/text/complex-first-glyph-with-initial-advance-expected.html: Added.
+        * fast/text/complex-first-glyph-with-initial-advance.html: Added.
+
 2013-06-20  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r151463.

Added: trunk/LayoutTests/fast/text/complex-first-glyph-with-initial-advance-expected.html (0 => 151807)


--- trunk/LayoutTests/fast/text/complex-first-glyph-with-initial-advance-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/complex-first-glyph-with-initial-advance-expected.html	2013-06-20 22:15:34 UTC (rev 151807)
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+<style> span {background: yellow; outline: none; font-size: 48px;} </style>
+</head>
+<body>
+
+<h2>The first glyph has initial advance.</h2>
+<section style="text-rendering: optimizeLegibility;">
+<span>&#1587; <span>&#1575;&#1616;</span></span>
+</section>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/complex-first-glyph-with-initial-advance.html (0 => 151807)


--- trunk/LayoutTests/fast/text/complex-first-glyph-with-initial-advance.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/complex-first-glyph-with-initial-advance.html	2013-06-20 22:15:34 UTC (rev 151807)
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+<style> span {background: yellow; outline: none; font-size: 48px;} </style>
+</head>
+<body>
+
+<h2>The first glyph has initial advance.</h2>
+<section style="text-rendering: optimizeLegibility;">
+<span>&#1587; &#1575;&#1616;</span>
+</section>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (151806 => 151807)


--- trunk/Source/WebCore/ChangeLog	2013-06-20 21:42:51 UTC (rev 151806)
+++ trunk/Source/WebCore/ChangeLog	2013-06-20 22:15:34 UTC (rev 151807)
@@ -1,3 +1,20 @@
+2013-06-20  Enrica Casucci  <[email protected]>
+
+        Initial advance on the first glyph of the run is not correctly set for rtl text.
+        https://bugs.webkit.org/show_bug.cgi?id=117839
+        <rdar://problem/13860717>
+
+        Reviewed by Sam Weinig.
+
+        We need to set the initial advance to the glyphBuffer, using the
+        initial advance of the complex run that will be drawn first.
+        In order to choose the run correctly we must consider the text direction.
+
+        Test: fast/text/complex-first-glyph-with-initial-advance.html
+
+        * platform/graphics/mac/ComplexTextController.cpp:
+        (WebCore::ComplexTextController::advance):
+
 2013-06-20  Alex Christensen  <[email protected]>
 
         Fixed WebGL compile errors on Windows.

Modified: trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp (151806 => 151807)


--- trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp	2013-06-20 21:42:51 UTC (rev 151806)
+++ trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp	2013-06-20 22:15:34 UTC (rev 151807)
@@ -496,7 +496,10 @@
         if (fallbackFonts && complexTextRun.fontData() != m_font.primaryFont())
             fallbackFonts->add(complexTextRun.fontData());
 
-        if (glyphBuffer && glyphBuffer->isEmpty())
+        // We must store the initial advance for the first glyph we are going to draw.
+        // When leftmostGlyph is 0, it represents the first glyph to draw, taking into
+        // account the text direction.
+        if (glyphBuffer && !leftmostGlyph)
             glyphBuffer->setInitialAdvance(complexTextRun.initialAdvance());
 
         while (m_glyphInCurrentRun < glyphCount) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to