Title: [271425] trunk
Revision
271425
Author
[email protected]
Date
2021-01-12 16:55:07 -0800 (Tue, 12 Jan 2021)

Log Message

Multi-codepoint CJK grapheme clusters are not oriented correctly in vertical writing mode
https://bugs.webkit.org/show_bug.cgi?id=220536
<rdar://problem/70633887>

Reviewed by Zalan Bujtas.

Source/WebCore:

We have two codeblocks in this section that are meant to be used
for non-CJK text, but the compound "if" statement was causing us to hit
one of them even for CJK text.

Test: fast/text/cjk-multi-codepoint-cluster-vertical.html

* platform/graphics/coretext/FontCascadeCoreText.cpp:
(WebCore::FontCascade::fontForCombiningCharacterSequence const):

LayoutTests:

* fast/text/cjk-multi-codepoint-cluster-vertical-expected.html: Added.
* fast/text/cjk-multi-codepoint-cluster-vertical.html: Added.
* platform/win/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (271424 => 271425)


--- trunk/LayoutTests/ChangeLog	2021-01-13 00:19:38 UTC (rev 271424)
+++ trunk/LayoutTests/ChangeLog	2021-01-13 00:55:07 UTC (rev 271425)
@@ -1,5 +1,17 @@
 2021-01-12  Myles C. Maxfield  <[email protected]>
 
+        Multi-codepoint CJK grapheme clusters are not oriented correctly in vertical writing mode
+        https://bugs.webkit.org/show_bug.cgi?id=220536
+        <rdar://problem/70633887>
+
+        Reviewed by Zalan Bujtas.
+
+        * fast/text/cjk-multi-codepoint-cluster-vertical-expected.html: Added.
+        * fast/text/cjk-multi-codepoint-cluster-vertical.html: Added.
+        * platform/win/TestExpectations:
+
+2021-01-12  Myles C. Maxfield  <[email protected]>
+
         Make fast/text/international/complex-character-based-fallback.html more robust by migrating it to be a reftest instead of a DRT test
         https://bugs.webkit.org/show_bug.cgi?id=220488
         <rdar://problem/70556068>

Added: trunk/LayoutTests/fast/text/cjk-multi-codepoint-cluster-vertical-expected.html (0 => 271425)


--- trunk/LayoutTests/fast/text/cjk-multi-codepoint-cluster-vertical-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/cjk-multi-codepoint-cluster-vertical-expected.html	2021-01-13 00:55:07 UTC (rev 271425)
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+This test makes sure that a CJK multi-codepoint grapheme cluster is oriented correctly (upright) in vertical writing mode. The test passes if the character below looks like &#x30d5;&#x309a;.
+<div style="font: 100px 'HiraMinPro-W3'; line-height: 1;">&#x30d5;&#x309a;</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/cjk-multi-codepoint-cluster-vertical.html (0 => 271425)


--- trunk/LayoutTests/fast/text/cjk-multi-codepoint-cluster-vertical.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/cjk-multi-codepoint-cluster-vertical.html	2021-01-13 00:55:07 UTC (rev 271425)
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+This test makes sure that a CJK multi-codepoint grapheme cluster is oriented correctly (upright) in vertical writing mode. The test passes if the character below looks like &#x30d5;&#x309a;.
+<div style="font: 100px 'HiraMinPro-W3'; writing-mode: vertical-rl; line-height: 1;">&#x30d5;&#x309a;</div>
+</body>
+</html>

Modified: trunk/LayoutTests/platform/win/TestExpectations (271424 => 271425)


--- trunk/LayoutTests/platform/win/TestExpectations	2021-01-13 00:19:38 UTC (rev 271424)
+++ trunk/LayoutTests/platform/win/TestExpectations	2021-01-13 00:55:07 UTC (rev 271425)
@@ -4613,3 +4613,5 @@
 js/dom/webassembly-memory-normal-fail.html [ Skip ]
 js/dom/webassembly-memory-shared-fail.html [ Skip ]
 storage/indexeddb/shared-memory-structured-clone.html [ Skip ]
+
+webkit.org/b/220536 fast/text/cjk-multi-codepoint-cluster-vertical.html [ ImageOnlyFailure ]

Modified: trunk/Source/WebCore/ChangeLog (271424 => 271425)


--- trunk/Source/WebCore/ChangeLog	2021-01-13 00:19:38 UTC (rev 271424)
+++ trunk/Source/WebCore/ChangeLog	2021-01-13 00:55:07 UTC (rev 271425)
@@ -1,3 +1,20 @@
+2021-01-12  Myles C. Maxfield  <[email protected]>
+
+        Multi-codepoint CJK grapheme clusters are not oriented correctly in vertical writing mode
+        https://bugs.webkit.org/show_bug.cgi?id=220536
+        <rdar://problem/70633887>
+
+        Reviewed by Zalan Bujtas.
+
+        We have two codeblocks in this section that are meant to be used
+        for non-CJK text, but the compound "if" statement was causing us to hit
+        one of them even for CJK text.
+
+        Test: fast/text/cjk-multi-codepoint-cluster-vertical.html
+
+        * platform/graphics/coretext/FontCascadeCoreText.cpp:
+        (WebCore::FontCascade::fontForCombiningCharacterSequence const):
+
 2021-01-12  Eric Carlson  <[email protected]>
 
         [Mac] Add runtime logging to format reader and WebM parser

Modified: trunk/Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp (271424 => 271425)


--- trunk/Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp	2021-01-13 00:19:38 UTC (rev 271424)
+++ trunk/Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp	2021-01-13 00:55:07 UTC (rev 271425)
@@ -322,9 +322,10 @@
             continue;
 #endif
         if (font->platformData().orientation() == FontOrientation::Vertical) {
-            if (isCJKIdeographOrSymbol(baseCharacter) && !font->hasVerticalGlyphs())
-                font = &font->brokenIdeographFont();
-            else if (m_fontDescription.nonCJKGlyphOrientation() == NonCJKGlyphOrientation::Mixed) {
+            if (isCJKIdeographOrSymbol(baseCharacter)) {
+                if (!font->hasVerticalGlyphs())
+                    font = &font->brokenIdeographFont();
+            } else if (m_fontDescription.nonCJKGlyphOrientation() == NonCJKGlyphOrientation::Mixed) {
                 const Font& verticalRightFont = font->verticalRightOrientationFont();
                 Glyph verticalRightGlyph = verticalRightFont.glyphForCharacter(baseCharacter);
                 if (verticalRightGlyph == baseCharacterGlyphData.glyph)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to