Title: [247797] branches/safari-608.1-branch
Revision
247797
Author
[email protected]
Date
2019-07-24 16:07:44 -0700 (Wed, 24 Jul 2019)

Log Message

Cherry-pick r247674. rdar://problem/53483295

    [iOS] Fast and complex text codepaths disagree about how to lay out bopomofo with tone marks
    https://bugs.webkit.org/show_bug.cgi?id=199912
    <rdar://problem/52182454>

    Reviewed by Simon Fraser.

    Source/WebCore:

    This is because CoreText has special composition rules for CJK languages, which we don't have in our simple
    text codepath. Rather than implementing the composition rules in WebKit, we can simply disable them in
    CoreText.

    Test: fast/text/international/system-language/composition.html

    * platform/graphics/mac/SimpleFontDataCoreText.cpp:
    (WebCore::Font::getCFStringAttributes const):

    Source/WebCore/PAL:

    * pal/spi/cocoa/CoreTextSPI.h:

    LayoutTests:

    * css3/font-feature-font-face-local-expected.html:
    * css3/font-feature-font-face-local.html:
    * editing/mac/selection/word-thai-expected.txt:
    * editing/mac/selection/word-thai.html:
    * fast/text/international/system-language/composition-expected.txt: Added.
    * fast/text/international/system-language/composition.html: Added.
    * platform/ios/fast/text/crash-complex-text-surrogate-expected.txt:
    * svg/custom/glyph-selection-arabic-forms-expected.txt:

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

Modified Paths

Added Paths

Diff

Modified: branches/safari-608.1-branch/LayoutTests/ChangeLog (247796 => 247797)


--- branches/safari-608.1-branch/LayoutTests/ChangeLog	2019-07-24 23:07:39 UTC (rev 247796)
+++ branches/safari-608.1-branch/LayoutTests/ChangeLog	2019-07-24 23:07:44 UTC (rev 247797)
@@ -1,5 +1,61 @@
 2019-07-24  Alan Coon  <[email protected]>
 
+        Cherry-pick r247674. rdar://problem/53483295
+
+    [iOS] Fast and complex text codepaths disagree about how to lay out bopomofo with tone marks
+    https://bugs.webkit.org/show_bug.cgi?id=199912
+    <rdar://problem/52182454>
+    
+    Reviewed by Simon Fraser.
+    
+    Source/WebCore:
+    
+    This is because CoreText has special composition rules for CJK languages, which we don't have in our simple
+    text codepath. Rather than implementing the composition rules in WebKit, we can simply disable them in
+    CoreText.
+    
+    Test: fast/text/international/system-language/composition.html
+    
+    * platform/graphics/mac/SimpleFontDataCoreText.cpp:
+    (WebCore::Font::getCFStringAttributes const):
+    
+    Source/WebCore/PAL:
+    
+    * pal/spi/cocoa/CoreTextSPI.h:
+    
+    LayoutTests:
+    
+    * css3/font-feature-font-face-local-expected.html:
+    * css3/font-feature-font-face-local.html:
+    * editing/mac/selection/word-thai-expected.txt:
+    * editing/mac/selection/word-thai.html:
+    * fast/text/international/system-language/composition-expected.txt: Added.
+    * fast/text/international/system-language/composition.html: Added.
+    * platform/ios/fast/text/crash-complex-text-surrogate-expected.txt:
+    * svg/custom/glyph-selection-arabic-forms-expected.txt:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247674 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-07-21  Myles C. Maxfield  <[email protected]>
+
+            [iOS] Fast and complex text codepaths disagree about how to lay out bopomofo with tone marks
+            https://bugs.webkit.org/show_bug.cgi?id=199912
+            <rdar://problem/52182454>
+
+            Reviewed by Simon Fraser.
+
+            * css3/font-feature-font-face-local-expected.html:
+            * css3/font-feature-font-face-local.html:
+            * editing/mac/selection/word-thai-expected.txt:
+            * editing/mac/selection/word-thai.html:
+            * fast/text/international/system-language/composition-expected.txt: Added.
+            * fast/text/international/system-language/composition.html: Added.
+            * platform/ios/fast/text/crash-complex-text-surrogate-expected.txt:
+            * svg/custom/glyph-selection-arabic-forms-expected.txt:
+
+2019-07-24  Alan Coon  <[email protected]>
+
         Cherry-pick r247671. rdar://problem/53501841
 
     Add accessibilityInsertText for text insertion in edit fields.

Modified: branches/safari-608.1-branch/LayoutTests/css3/font-feature-font-face-local-expected.html (247796 => 247797)


--- branches/safari-608.1-branch/LayoutTests/css3/font-feature-font-face-local-expected.html	2019-07-24 23:07:39 UTC (rev 247796)
+++ branches/safari-608.1-branch/LayoutTests/css3/font-feature-font-face-local-expected.html	2019-07-24 23:07:44 UTC (rev 247797)
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <style>
 @font-face {
  font-family: HigaginoSans-fixed;
@@ -19,4 +20,4 @@
 WWWWWW</span>
 あいう</pre>
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: branches/safari-608.1-branch/LayoutTests/css3/font-feature-font-face-local.html (247796 => 247797)


--- branches/safari-608.1-branch/LayoutTests/css3/font-feature-font-face-local.html	2019-07-24 23:07:39 UTC (rev 247796)
+++ branches/safari-608.1-branch/LayoutTests/css3/font-feature-font-face-local.html	2019-07-24 23:07:44 UTC (rev 247797)
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <style>
 @font-face {
  font-family: HigaginoSans-fixed;
@@ -19,4 +20,4 @@
 WWWWWW
 あいう</pre>
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: branches/safari-608.1-branch/LayoutTests/editing/mac/selection/word-thai-expected.txt (247796 => 247797)


--- branches/safari-608.1-branch/LayoutTests/editing/mac/selection/word-thai-expected.txt	2019-07-24 23:07:39 UTC (rev 247796)
+++ branches/safari-608.1-branch/LayoutTests/editing/mac/selection/word-thai-expected.txt	2019-07-24 23:07:44 UTC (rev 247797)
@@ -1,4 +1,5 @@
-Double-clicking anywhere on this word: เพชรบุรี should select it in its entirety.
-
+Double-clicking anywhere on this word:
+เพชรบุรี
+should select it in its entirety.
 PASS
 

Modified: branches/safari-608.1-branch/LayoutTests/editing/mac/selection/word-thai.html


(Binary files differ)

Added: branches/safari-608.1-branch/LayoutTests/fast/text/international/system-language/composition-expected.txt (0 => 247797)


--- branches/safari-608.1-branch/LayoutTests/fast/text/international/system-language/composition-expected.txt	                        (rev 0)
+++ branches/safari-608.1-branch/LayoutTests/fast/text/international/system-language/composition-expected.txt	2019-07-24 23:07:44 UTC (rev 247797)
@@ -0,0 +1,6 @@
+PASS target1.offsetWidth is target2.offsetWidth
+PASS successfullyParsed is true
+
+TEST COMPLETE
+ㄔˉㄔˉㄔˉㄔˉㄔˉㄔˉ
+ㄔˉㄔˉㄔˉㄔˉㄔˉㄔˉ

Added: branches/safari-608.1-branch/LayoutTests/fast/text/international/system-language/composition.html (0 => 247797)


--- branches/safari-608.1-branch/LayoutTests/fast/text/international/system-language/composition.html	                        (rev 0)
+++ branches/safari-608.1-branch/LayoutTests/fast/text/international/system-language/composition.html	2019-07-24 23:07:44 UTC (rev 247797)
@@ -0,0 +1,16 @@
+<!DOCTYPE html><!-- webkit-test-runner [ language=zh-Hans ] -->
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<div style="font: 48px system-ui;"><span id="target1">&#x3114;&#x02c9;&#x3114;&#x02c9;&#x3114;&#x02c9;&#x3114;&#x02c9;&#x3114;&#x02c9;&#x3114;&#x02c9;</span></div>
+<div style="font: 48px system-ui; font-feature-settings: 'abcd';"><span id="target2">&#x3114;&#x02c9;&#x3114;&#x02c9;&#x3114;&#x02c9;&#x3114;&#x02c9;&#x3114;&#x02c9;&#x3114;&#x02c9;</span></div>
+<script>
+const target1 = document.getElementById("target1");
+const target2 = document.getElementById("target2");
+shouldBe("target1.offsetWidth", "target2.offsetWidth");
+</script>
+<script src=""
+</body>
+</html>

Modified: branches/safari-608.1-branch/LayoutTests/platform/ios/fast/text/crash-complex-text-surrogate-expected.txt (247796 => 247797)


--- branches/safari-608.1-branch/LayoutTests/platform/ios/fast/text/crash-complex-text-surrogate-expected.txt	2019-07-24 23:07:39 UTC (rev 247796)
+++ branches/safari-608.1-branch/LayoutTests/platform/ios/fast/text/crash-complex-text-surrogate-expected.txt	2019-07-24 23:07:44 UTC (rev 247797)
@@ -35,10 +35,10 @@
       RenderBR {BR} at (0,0) size 0x0
       RenderInline {ACRONYM} at (0,0) size 0x0
       RenderText {#text} at (0,0) size 0x0
-      RenderText {#text} at (0,406) size 118x46
+      RenderText {#text} at (0,406) size 137x46
         text run at (0,406) width 45: "s is:"
         text run at (0,420) width 27: "{,}"
-        text run at (0,438) width 118: "\x{A888}{0}P{P}\\7H\\8"
+        text run at (0,438) width 137: "\x{A888}{0}P{P}\\7H\\8"
       RenderBR {BR} at (0,0) size 0x0
       RenderText {#text} at (0,452) size 71x14
         text run at (0,452) width 71: "f is: gi"

Modified: branches/safari-608.1-branch/LayoutTests/platform/ios/legacy-animation-engine/fast/text/crash-complex-text-surrogate-expected.txt (247796 => 247797)


--- branches/safari-608.1-branch/LayoutTests/platform/ios/legacy-animation-engine/fast/text/crash-complex-text-surrogate-expected.txt	2019-07-24 23:07:39 UTC (rev 247796)
+++ branches/safari-608.1-branch/LayoutTests/platform/ios/legacy-animation-engine/fast/text/crash-complex-text-surrogate-expected.txt	2019-07-24 23:07:44 UTC (rev 247797)
@@ -35,10 +35,10 @@
       RenderBR {BR} at (0,0) size 0x0
       RenderInline {ACRONYM} at (0,0) size 0x0
       RenderText {#text} at (0,0) size 0x0
-      RenderText {#text} at (0,406) size 118x46
+      RenderText {#text} at (0,406) size 137x46
         text run at (0,406) width 45: "s is:"
         text run at (0,420) width 27: "{,}"
-        text run at (0,438) width 118: "\x{A888}{0}P{P}\\7H\\8"
+        text run at (0,438) width 137: "\x{A888}{0}P{P}\\7H\\8"
       RenderBR {BR} at (0,0) size 0x0
       RenderText {#text} at (0,452) size 71x14
         text run at (0,452) width 71: "f is: gi"

Modified: branches/safari-608.1-branch/LayoutTests/svg/custom/glyph-selection-arabic-forms-expected.txt (247796 => 247797)


--- branches/safari-608.1-branch/LayoutTests/svg/custom/glyph-selection-arabic-forms-expected.txt	2019-07-24 23:07:39 UTC (rev 247796)
+++ branches/safari-608.1-branch/LayoutTests/svg/custom/glyph-selection-arabic-forms-expected.txt	2019-07-24 23:07:44 UTC (rev 247797)
@@ -1,10 +1,10 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 400x50
-  RenderSVGRoot {svg} at (10,7) size 348x18
+  RenderSVGRoot {svg} at (10,7) size 366x18
     RenderSVGHiddenContainer {defs} at (0,0) size 0x0
-    RenderSVGContainer {g} at (10,7) size 348x18
-      RenderSVGText {text} at (10,7) size 348x18 contains 1 chunk(s)
-        RenderSVGInlineText {#text} at (0,0) size 348x18
-          chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 56 width 340.79 RTL: "\x{62E}] [\x{62E}][\x{62E}][\x{62E}] | [\x{62E}] [\x{62E}\x{62E}][\x{62E}] | [\x{62E}] [\x{62E}\x{62E}\x{62E}] | [\x{62E} \x{62E}\x{62E}\x{62E}] | \x{62E} \x{62E}\x{62E}\x{62E}"
-          chunk 1 text run 1 at (350.79,20.00) startOffset 0 endOffset 1 width 6.88: "]"
+    RenderSVGContainer {g} at (10,7) size 366x18
+      RenderSVGText {text} at (10,7) size 366x18 contains 1 chunk(s)
+        RenderSVGInlineText {#text} at (0,0) size 366x18
+          chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 56 width 358.79 RTL: "\x{62E}] [\x{62E}][\x{62E}][\x{62E}] | [\x{62E}] [\x{62E}\x{62E}][\x{62E}] | [\x{62E}] [\x{62E}\x{62E}\x{62E}] | [\x{62E} \x{62E}\x{62E}\x{62E}] | \x{62E} \x{62E}\x{62E}\x{62E}"
+          chunk 1 text run 1 at (368.79,20.00) startOffset 0 endOffset 1 width 6.88: "]"

Modified: branches/safari-608.1-branch/Source/WebCore/ChangeLog (247796 => 247797)


--- branches/safari-608.1-branch/Source/WebCore/ChangeLog	2019-07-24 23:07:39 UTC (rev 247796)
+++ branches/safari-608.1-branch/Source/WebCore/ChangeLog	2019-07-24 23:07:44 UTC (rev 247797)
@@ -1,5 +1,61 @@
 2019-07-24  Alan Coon  <[email protected]>
 
+        Cherry-pick r247674. rdar://problem/53483295
+
+    [iOS] Fast and complex text codepaths disagree about how to lay out bopomofo with tone marks
+    https://bugs.webkit.org/show_bug.cgi?id=199912
+    <rdar://problem/52182454>
+    
+    Reviewed by Simon Fraser.
+    
+    Source/WebCore:
+    
+    This is because CoreText has special composition rules for CJK languages, which we don't have in our simple
+    text codepath. Rather than implementing the composition rules in WebKit, we can simply disable them in
+    CoreText.
+    
+    Test: fast/text/international/system-language/composition.html
+    
+    * platform/graphics/mac/SimpleFontDataCoreText.cpp:
+    (WebCore::Font::getCFStringAttributes const):
+    
+    Source/WebCore/PAL:
+    
+    * pal/spi/cocoa/CoreTextSPI.h:
+    
+    LayoutTests:
+    
+    * css3/font-feature-font-face-local-expected.html:
+    * css3/font-feature-font-face-local.html:
+    * editing/mac/selection/word-thai-expected.txt:
+    * editing/mac/selection/word-thai.html:
+    * fast/text/international/system-language/composition-expected.txt: Added.
+    * fast/text/international/system-language/composition.html: Added.
+    * platform/ios/fast/text/crash-complex-text-surrogate-expected.txt:
+    * svg/custom/glyph-selection-arabic-forms-expected.txt:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247674 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-07-21  Myles C. Maxfield  <[email protected]>
+
+            [iOS] Fast and complex text codepaths disagree about how to lay out bopomofo with tone marks
+            https://bugs.webkit.org/show_bug.cgi?id=199912
+            <rdar://problem/52182454>
+
+            Reviewed by Simon Fraser.
+
+            This is because CoreText has special composition rules for CJK languages, which we don't have in our simple
+            text codepath. Rather than implementing the composition rules in WebKit, we can simply disable them in
+            CoreText.
+
+            Test: fast/text/international/system-language/composition.html
+
+            * platform/graphics/mac/SimpleFontDataCoreText.cpp:
+            (WebCore::Font::getCFStringAttributes const):
+
+2019-07-24  Alan Coon  <[email protected]>
+
         Cherry-pick r247671. rdar://problem/53501841
 
     Add accessibilityInsertText for text insertion in edit fields.

Modified: branches/safari-608.1-branch/Source/WebCore/PAL/ChangeLog (247796 => 247797)


--- branches/safari-608.1-branch/Source/WebCore/PAL/ChangeLog	2019-07-24 23:07:39 UTC (rev 247796)
+++ branches/safari-608.1-branch/Source/WebCore/PAL/ChangeLog	2019-07-24 23:07:44 UTC (rev 247797)
@@ -1,5 +1,54 @@
 2019-07-24  Alan Coon  <[email protected]>
 
+        Cherry-pick r247674. rdar://problem/53483295
+
+    [iOS] Fast and complex text codepaths disagree about how to lay out bopomofo with tone marks
+    https://bugs.webkit.org/show_bug.cgi?id=199912
+    <rdar://problem/52182454>
+    
+    Reviewed by Simon Fraser.
+    
+    Source/WebCore:
+    
+    This is because CoreText has special composition rules for CJK languages, which we don't have in our simple
+    text codepath. Rather than implementing the composition rules in WebKit, we can simply disable them in
+    CoreText.
+    
+    Test: fast/text/international/system-language/composition.html
+    
+    * platform/graphics/mac/SimpleFontDataCoreText.cpp:
+    (WebCore::Font::getCFStringAttributes const):
+    
+    Source/WebCore/PAL:
+    
+    * pal/spi/cocoa/CoreTextSPI.h:
+    
+    LayoutTests:
+    
+    * css3/font-feature-font-face-local-expected.html:
+    * css3/font-feature-font-face-local.html:
+    * editing/mac/selection/word-thai-expected.txt:
+    * editing/mac/selection/word-thai.html:
+    * fast/text/international/system-language/composition-expected.txt: Added.
+    * fast/text/international/system-language/composition.html: Added.
+    * platform/ios/fast/text/crash-complex-text-surrogate-expected.txt:
+    * svg/custom/glyph-selection-arabic-forms-expected.txt:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247674 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-07-21  Myles C. Maxfield  <[email protected]>
+
+            [iOS] Fast and complex text codepaths disagree about how to lay out bopomofo with tone marks
+            https://bugs.webkit.org/show_bug.cgi?id=199912
+            <rdar://problem/52182454>
+
+            Reviewed by Simon Fraser.
+
+            * pal/spi/cocoa/CoreTextSPI.h:
+
+2019-07-24  Alan Coon  <[email protected]>
+
         Apply patch. rdar://problem/53457282
 
     Disable ENABLE_LAYOUT_FORMATTING_CONTEXT https://bugs.webkit.org/show_bug.cgi?id=200038 <rdar://problem/53457282>

Modified: branches/safari-608.1-branch/Source/WebCore/PAL/pal/spi/cocoa/CoreTextSPI.h (247796 => 247797)


--- branches/safari-608.1-branch/Source/WebCore/PAL/pal/spi/cocoa/CoreTextSPI.h	2019-07-24 23:07:39 UTC (rev 247796)
+++ branches/safari-608.1-branch/Source/WebCore/PAL/pal/spi/cocoa/CoreTextSPI.h	2019-07-24 23:07:44 UTC (rev 247797)
@@ -62,6 +62,15 @@
     kCTFontFallbackOptionDefault = kCTFontFallbackOptionSystem | kCTFontFallbackOptionUserInstalled,
 };
 
+typedef CF_ENUM(uint8_t, CTCompositionLanguage)
+{
+    kCTCompositionLanguageUnset,
+    kCTCompositionLanguageNone,
+    kCTCompositionLanguageJapanese,
+    kCTCompositionLanguageSimplifiedChinese,
+    kCTCompositionLanguageTraditionalChinese,
+};
+
 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED == 101400) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED == 120000)
 extern const CFStringRef kCTTypesetterOptionAllowUnboundedLayout;
 #endif
@@ -106,6 +115,8 @@
 
 CFArrayRef CTFontManagerCreateFontDescriptorsFromData(CFDataRef);
 
+void CTParagraphStyleSetCompositionLanguage(CTParagraphStyleRef, CTCompositionLanguage);
+
 extern const CFStringRef kCTFontCSSWeightAttribute;
 extern const CFStringRef kCTFontCSSWidthAttribute;
 extern const CFStringRef kCTFontDescriptorTextStyleAttribute;

Modified: branches/safari-608.1-branch/Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp (247796 => 247797)


--- branches/safari-608.1-branch/Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp	2019-07-24 23:07:39 UTC (rev 247796)
+++ branches/safari-608.1-branch/Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp	2019-07-24 23:07:44 UTC (rev 247797)
@@ -41,6 +41,9 @@
     attributesDictionary = adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 4, &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
 
     CFDictionarySetValue(attributesDictionary.get(), kCTFontAttributeName, platformData().ctFont());
+    auto paragraphStyle = adoptCF(CTParagraphStyleCreate(nullptr, 0));
+    CTParagraphStyleSetCompositionLanguage(paragraphStyle.get(), kCTCompositionLanguageNone);
+    CFDictionarySetValue(attributesDictionary.get(), kCTParagraphStyleAttributeName, paragraphStyle.get());
 
     if (!enableKerning) {
         const float zero = 0;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to