Title: [254911] releases/WebKitGTK/webkit-2.26
Revision
254911
Author
[email protected]
Date
2020-01-22 02:42:29 -0800 (Wed, 22 Jan 2020)

Log Message

Merge r254190 - [HarfBuzz][GTK] fast/text/complex-first-glyph-with-initial-advance.html is failing
https://bugs.webkit.org/show_bug.cgi?id=118221

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Arabic diacritics made glyphs vertically unaligned if the first
glyph had a vertical offset.

The initial advance should be same with the first glyph origin for
HarfBuzz. See the diagram in ComplexTextController.h for details.
<https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/platform/graphics/ComplexTextController.h?rev=224007#L109>

drawGlyphs of Cairo port was assuming upward y-axis for glyph
advances even though those of Mac and AppleWin port are assuming
downward y-axis. This is a problem for Windows ports because
AppleWin and WinCairo port are sharing the code calculating
advances.

Covered by existing tests.

* platform/graphics/cairo/FontCairo.cpp:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/cairo/GraphicsContextImplCairo.cpp:
(WebCore::GraphicsContextImplCairo::drawGlyphs):
Sum up the height of advances into yOffset instead of subtraction.

* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
Don't negate offsetY. Set m_initialAdvance as the first item of
m_glyphOrigins.

LayoutTests:

* platform/gtk/TestExpectations: Unmarked
fast/text/complex-first-glyph-with-initial-advance.html and
fast/text/initial-advance-in-intermediate-run-complex.html.
* platform/wincairo/TestExpectations: Unmarked
fast/text/complex-first-glyph-with-initial-advance.html and
fast/text/complex-initial-advance.html.

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.26/LayoutTests/ChangeLog (254910 => 254911)


--- releases/WebKitGTK/webkit-2.26/LayoutTests/ChangeLog	2020-01-22 10:42:23 UTC (rev 254910)
+++ releases/WebKitGTK/webkit-2.26/LayoutTests/ChangeLog	2020-01-22 10:42:29 UTC (rev 254911)
@@ -1,3 +1,17 @@
+2020-01-08  Fujii Hironori  <[email protected]>
+
+        [HarfBuzz][GTK] fast/text/complex-first-glyph-with-initial-advance.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=118221
+
+        Reviewed by Carlos Garcia Campos.
+
+        * platform/gtk/TestExpectations: Unmarked
+        fast/text/complex-first-glyph-with-initial-advance.html and
+        fast/text/initial-advance-in-intermediate-run-complex.html.
+        * platform/wincairo/TestExpectations: Unmarked
+        fast/text/complex-first-glyph-with-initial-advance.html and
+        fast/text/complex-initial-advance.html.
+
 2019-11-01  Said Abou-Hallawa  <[email protected]>
 
         SVG pair properties must be detached from their owner before it's deleted

Modified: releases/WebKitGTK/webkit-2.26/LayoutTests/platform/gtk/TestExpectations (254910 => 254911)


--- releases/WebKitGTK/webkit-2.26/LayoutTests/platform/gtk/TestExpectations	2020-01-22 10:42:23 UTC (rev 254910)
+++ releases/WebKitGTK/webkit-2.26/LayoutTests/platform/gtk/TestExpectations	2020-01-22 10:42:29 UTC (rev 254911)
@@ -2908,8 +2908,6 @@
 webkit.org/b/118220 http/tests/cache/partitioned-cache.html [ Failure ]
 webkit.org/b/118220 http/tests/cache/partitioned-cache-iframe.html [ Failure ]
 
-webkit.org/b/118221 fast/text/complex-first-glyph-with-initial-advance.html [ ImageOnlyFailure ]
-
 webkit.org/b/118416 storage/websql/sql-error-codes.html [ Failure ]
 
 webkit.org/b/120105 http/tests/navigation/post-frames-goback1-uncached.html [ Failure ]
@@ -3277,8 +3275,6 @@
 
 webkit.org/b/168552 fast/text/hyphenate-locale.html [ Failure ]
 
-webkit.org/b/168555 fast/text/initial-advance-in-intermediate-run-complex.html [ ImageOnlyFailure ]
-
 webkit.org/b/168719 fast/css/paint-order-shadow.html [ ImageOnlyFailure ]
 
 webkit.org/b/169075 editing/deleting/skip-virama-001.html [ Failure ]

Modified: releases/WebKitGTK/webkit-2.26/Source/WebCore/ChangeLog (254910 => 254911)


--- releases/WebKitGTK/webkit-2.26/Source/WebCore/ChangeLog	2020-01-22 10:42:23 UTC (rev 254910)
+++ releases/WebKitGTK/webkit-2.26/Source/WebCore/ChangeLog	2020-01-22 10:42:29 UTC (rev 254911)
@@ -1,3 +1,36 @@
+2020-01-08  Fujii Hironori  <[email protected]>
+
+        [HarfBuzz][GTK] fast/text/complex-first-glyph-with-initial-advance.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=118221
+
+        Reviewed by Carlos Garcia Campos.
+
+        Arabic diacritics made glyphs vertically unaligned if the first
+        glyph had a vertical offset.
+
+        The initial advance should be same with the first glyph origin for
+        HarfBuzz. See the diagram in ComplexTextController.h for details.
+        <https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/platform/graphics/ComplexTextController.h?rev=224007#L109>
+
+        drawGlyphs of Cairo port was assuming upward y-axis for glyph
+        advances even though those of Mac and AppleWin port are assuming
+        downward y-axis. This is a problem for Windows ports because
+        AppleWin and WinCairo port are sharing the code calculating
+        advances.
+
+        Covered by existing tests.
+
+        * platform/graphics/cairo/FontCairo.cpp:
+        (WebCore::FontCascade::drawGlyphs):
+        * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
+        (WebCore::GraphicsContextImplCairo::drawGlyphs):
+        Sum up the height of advances into yOffset instead of subtraction.
+
+        * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
+        (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
+        Don't negate offsetY. Set m_initialAdvance as the first item of
+        m_glyphOrigins.
+
 2019-12-13  Carlos Garcia Campos  <[email protected]>
 
         [HarfBuzz] WebKitWebProcess crashes when displaying a KaTeX formula

Modified: releases/WebKitGTK/webkit-2.26/Source/WebCore/platform/graphics/cairo/FontCairo.cpp (254910 => 254911)


--- releases/WebKitGTK/webkit-2.26/Source/WebCore/platform/graphics/cairo/FontCairo.cpp	2020-01-22 10:42:23 UTC (rev 254910)
+++ releases/WebKitGTK/webkit-2.26/Source/WebCore/platform/graphics/cairo/FontCairo.cpp	2020-01-22 10:42:29 UTC (rev 254911)
@@ -65,7 +65,7 @@
         for (size_t i = 0; i < numGlyphs; ++i) {
             glyphs[i] = { glyphsData[i], xOffset, yOffset };
             xOffset += advances[i].width();
-            yOffset -= advances[i].height();
+            yOffset += advances[i].height();
         }
     }
 

Modified: releases/WebKitGTK/webkit-2.26/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.cpp (254910 => 254911)


--- releases/WebKitGTK/webkit-2.26/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.cpp	2020-01-22 10:42:23 UTC (rev 254910)
+++ releases/WebKitGTK/webkit-2.26/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.cpp	2020-01-22 10:42:29 UTC (rev 254911)
@@ -248,7 +248,7 @@
         for (size_t i = 0; i < numGlyphs; ++i) {
             glyphs[i] = { glyphsData[i], xOffset, yOffset };
             xOffset += advances[i].width();
-            yOffset -= advances[i].height();
+            yOffset += advances[i].height();
         }
     }
 

Modified: releases/WebKitGTK/webkit-2.26/Source/WebCore/platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp (254910 => 254911)


--- releases/WebKitGTK/webkit-2.26/Source/WebCore/platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp	2020-01-22 10:42:23 UTC (rev 254910)
+++ releases/WebKitGTK/webkit-2.26/Source/WebCore/platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp	2020-01-22 10:42:29 UTC (rev 254911)
@@ -164,17 +164,15 @@
         }
 
         float offsetX = harfBuzzPositionToFloat(glyphPositions[i].x_offset);
-        float offsetY = -harfBuzzPositionToFloat(glyphPositions[i].y_offset);
+        float offsetY = harfBuzzPositionToFloat(glyphPositions[i].y_offset);
         float advanceX = harfBuzzPositionToFloat(glyphPositions[i].x_advance);
         float advanceY = harfBuzzPositionToFloat(glyphPositions[i].y_advance);
 
-        if (!i)
-            m_initialAdvance = { offsetX, -offsetY };
-
         m_glyphs[i] = glyph;
         m_baseAdvances[i] = { advanceX, advanceY };
         m_glyphOrigins[i] = { offsetX, offsetY };
     }
+    m_initialAdvance = toFloatSize(m_glyphOrigins[0]);
 }
 
 static const hb_tag_t s_vertTag = HB_TAG('v', 'e', 'r', 't');
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to