Title: [253664] trunk
Revision
253664
Author
hironori.fu...@sony.com
Date
2019-12-17 18:17:22 -0800 (Tue, 17 Dec 2019)

Log Message

[cairo] text-align:justify wrongly expands CJK ideograph characters
https://bugs.webkit.org/show_bug.cgi?id=205321

Patch by Fujii Hironori <fujii.hiron...@gmail.com> on 2019-12-17
Reviewed by Carlos Garcia Campos.

Source/WebCore:

Even though canExpandAroundIdeographsInComplexText of
FontCairoHarfbuzzNG.cpp returns false, ComplexTextController
doesn't take it account. It ends up to expanding all ideographs
with a undesired expansion width.

WidthIterator properly checks canExpandAroundIdeographsInComplexText.
ComplexTextController also should do so.

* platform/graphics/ComplexTextController.cpp:
(WebCore::ComplexTextController::adjustGlyphsAndAdvances): Check canExpandAroundIdeographsInComplexText.
* platform/graphics/FontCascade.h: Friend with ComplexTextController to allow calling canExpandAroundIdeographsInComplexText.

LayoutTests:

* platform/gtk/TestExpectations:
* platform/gtk/fast/text/justify-ideograph-complex-expected.png:
* platform/gtk/fast/text/justify-ideograph-complex-expected.txt: Added.
* platform/gtk/fast/text/justify-ideograph-leading-expansion-expected.png:
* platform/gtk/fast/text/justify-ideograph-simple-expected.png:
* platform/gtk/fast/text/justify-ideograph-simple-expected.txt: Added.
* platform/gtk/fast/text/justify-ideograph-vertical-expected.png:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (253663 => 253664)


--- trunk/LayoutTests/ChangeLog	2019-12-18 01:54:54 UTC (rev 253663)
+++ trunk/LayoutTests/ChangeLog	2019-12-18 02:17:22 UTC (rev 253664)
@@ -1,3 +1,18 @@
+2019-12-17  Fujii Hironori  <fujii.hiron...@gmail.com>
+
+        [cairo] text-align:justify wrongly expands CJK ideograph characters
+        https://bugs.webkit.org/show_bug.cgi?id=205321
+
+        Reviewed by Carlos Garcia Campos.
+
+        * platform/gtk/TestExpectations:
+        * platform/gtk/fast/text/justify-ideograph-complex-expected.png:
+        * platform/gtk/fast/text/justify-ideograph-complex-expected.txt: Added.
+        * platform/gtk/fast/text/justify-ideograph-leading-expansion-expected.png:
+        * platform/gtk/fast/text/justify-ideograph-simple-expected.png:
+        * platform/gtk/fast/text/justify-ideograph-simple-expected.txt: Added.
+        * platform/gtk/fast/text/justify-ideograph-vertical-expected.png:
+
 2019-12-17  Truitt Savell  <tsav...@apple.com>
 
         REGRESSION: [ Mojave+ Debug ] fast/mediastream/captureStream/canvas2d-heavy-drawing.html is a flakey failure

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (253663 => 253664)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2019-12-18 01:54:54 UTC (rev 253663)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2019-12-18 02:17:22 UTC (rev 253664)
@@ -3119,8 +3119,6 @@
 webkit.org/b/140252 fast/text/emphasis-vertical.html [ Failure ]
 webkit.org/b/140252 fast/text/international/khmer-selection.html [ Failure ]
 webkit.org/b/140252 fast/text/international/plane2.html [ Failure ]
-webkit.org/b/140252 fast/text/justify-ideograph-complex.html [ Failure ]
-webkit.org/b/140252 fast/text/justify-ideograph-simple.html [ Failure ]
 webkit.org/b/140252 fast/text/khmer-lao-font.html [ Failure ]
 webkit.org/b/140252 fast/text/midword-break-before-surrogate-pair-2.html [ Failure ]
 webkit.org/b/140252 svg/custom/svg-fonts-fallback.xhtml [ Failure ]

Modified: trunk/LayoutTests/platform/gtk/fast/text/justify-ideograph-complex-expected.png


(Binary files differ)

Added: trunk/LayoutTests/platform/gtk/fast/text/justify-ideograph-complex-expected.txt (0 => 253664)


--- trunk/LayoutTests/platform/gtk/fast/text/justify-ideograph-complex-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/gtk/fast/text/justify-ideograph-complex-expected.txt	2019-12-18 02:17:22 UTC (rev 253664)
@@ -0,0 +1,39 @@
+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 784x580
+      RenderBlock {P} at (0,0) size 550x56
+        RenderText {#text} at (0,0) size 550x56
+          text run at (0,0) width 550: "\x{3010}2009 \x{5E74} 11 \x{6708} 4 \x{65E5}\x{7F8E}\x{570B}\x{52A0}\x{5DDE} Cupertino \x{8A0A}\x{3011}\x{860B}\x{679C}\x{4ECA}\x{5929}\x{5BA3}\x{4F48}\x{FF0C}\x{5168}\x{4E16}\x{754C}\x{6700}\x{5927}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{5546}\x{5E97} App Store\x{FF0C}"
+          text run at (0,14) width 550: "\x{76EE}\x{524D}\x{5DF2}\x{64C1}\x{6709} 100,000 \x{591A}\x{7A2E}\x{4F86}\x{81EA}\x{5168}\x{7403}\x{958B}\x{767C}\x{4EBA}\x{54E1}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{3002}\x{5168}\x{4E16}\x{754C} 77 \x{500B}\x{570B}\x{5BB6}\x{7684} iPhone\x{AE} \x{8207} iPod touch\x{AE}"
+          text run at (0,28) width 550: "\x{7528}\x{6236}\x{64C1}\x{6709} 20 \x{500B}\x{985E}\x{5225}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{53EF}\x{4F9B}\x{9078}\x{64C7}\x{FF0C}\x{5305}\x{62EC}\x{FF1A}\x{904A}\x{6232}\x{3001}\x{5546}\x{7528}\x{3001}\x{65B0}\x{805E}\x{3001}\x{904B}\x{52D5}\x{3001}\x{91AB}\x{7642}\x{3001}\x{53C3}\x{8003}\x{66F8}\x{7C4D}\x{3001}\x{65C5}\x{904A}\x{7B49}"
+          text run at (0,42) width 545: "\x{7B49}\x{3002}\x{622A}\x{81F3}\x{76EE}\x{524D}\x{70BA}\x{6B62}\x{FF0C}App Store \x{4F7F}\x{7528}\x{8005}\x{4E0B}\x{8F09}\x{6B21}\x{6578}\x{5DF2}\x{8D85}\x{904E} 20 \x{5104}\x{6B21}\x{FF0C}\x{662F}\x{76EE}\x{524D}\x{5168}\x{7403}\x{6700}\x{53D7}\x{6B61}\x{8FCE}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{5546}\x{5E97}\x{3002}"
+      RenderBlock {P} at (0,68) size 550x42
+        RenderText {#text} at (0,0) size 550x42
+          text run at (0,0) width 550: "\x{860B}\x{679C}\x{5168}\x{7403}\x{7522}\x{54C1}\x{884C}\x{92B7}\x{8CC7}\x{6DF1}\x{526F}\x{7E3D}\x{88C1} Philip Schiller \x{8868}\x{793A}\x{FF1A}\x{300C}\x{63D0}\x{4F9B} 100,000 \x{591A}\x{7A2E}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{53EF}\x{4F9B}\x{9078}\x{64C7}\x{7684} App"
+          text run at (0,14) width 550: "Store\x{FF0C}\x{662F}\x{5168}\x{4E16}\x{754C}\x{6578}\x{5343}\x{842C} iPhone \x{548C} iPod touch \x{4F7F}\x{7528}\x{8005}\x{4EE4}\x{4EBA}\x{7A31}\x{7FA8}\x{7684}\x{4E3B}\x{8981}\x{539F}\x{56E0}\x{3002}iPhone SDK \x{5275}\x{9020}\x{4E86}\x{7B2C}\x{4E00}\x{500B}"
+          text run at (0,28) width 393: "\x{512A}\x{7570}\x{7684}\x{884C}\x{52D5}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{5E73}\x{53F0}\x{FF0C}\x{5BA2}\x{6236}\x{4E5F}\x{975E}\x{5E38}\x{559C}\x{611B}\x{958B}\x{767C}\x{4EBA}\x{54E1}\x{6240}\x{5275}\x{4F5C}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{3002}\x{300D}"
+      RenderBlock {P} at (0,122) size 550x42
+        RenderText {#text} at (0,0) size 550x42
+          text run at (0,0) width 550: "EA Mobile \x{7684} Worldwide Studios \x{526F}\x{7E3D}\x{88C1} Travis Boatman \x{6307}\x{51FA}\x{FF1A}\x{300C}App Store \x{4E0D}\x{50C5}\x{5FB9}\x{5E95}\x{6539}\x{8B8A}\x{4E86}\x{884C}\x{52D5}\x{904A}\x{6232}"
+          text run at (0,14) width 550: "\x{7522}\x{696D}\x{7684}\x{751F}\x{614B}\x{FF0C}\x{800C}\x{4E14}\x{9084}\x{5728}\x{6301}\x{7E8C}\x{6F14}\x{9032}\x{3002}\x{6709}\x{4E86}\x{5168}\x{7403} 5 \x{5343}\x{591A}\x{842C}\x{7684} iPhone \x{548C} iPod touch \x{5BA2}\x{6236}\x{70BA}\x{57FA}\x{790E}\x{FF0C}App Store \x{8B93}"
+          text run at (0,28) width 292: "\x{6211}\x{5011}\x{80FD}\x{5920}\x{958B}\x{767C}\x{53D7}\x{5230}\x{5EE3}\x{5927}\x{7684}\x{5BA2}\x{6236}\x{559C}\x{611B}\x{7684}\x{9AD8}\x{54C1}\x{8CEA} EA \x{904A}\x{6232}\x{3002}\x{300D}"
+      RenderBlock {P} at (0,176) size 550x42
+        RenderText {#text} at (0,0) size 550x42
+          text run at (0,0) width 550: "Smule \x{7684}\x{57F7}\x{884C}\x{9577} Jeff Smith \x{8868}\x{793A}\x{FF1A}\x{300C}\x{6211}\x{5011}\x{7684} I Am T-Pain \x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{53D7}\x{5230}\x{5168}\x{7403}\x{5BA2}\x{6236}\x{7684}\x{71B1}\x{70C8}\x{8FF4}\x{97FF}\x{FF0C}\x{6BCF}\x{65E5}\x{8D85}\x{904E}"
+          text run at (0,14) width 550: "10,000 \x{6B21}\x{7684}\x{4E0B}\x{8F09}\x{9060}\x{9060}\x{8D85}\x{8D8A}\x{6211}\x{5011}\x{7684}\x{9810}\x{671F}\x{3002}App Store \x{7D66}\x{4E86}\x{6211}\x{5011}\x{4E00}\x{500B}\x{7368}\x{7279}\x{7684}\x{5546}\x{6A5F}\x{FF0C}\x{8B93}\x{6211}\x{5011}\x{958B}\x{5275}\x{4E00}\x{500B}\x{975E}\x{5E38}\x{6210}\x{529F}"
+          text run at (0,28) width 192: "\x{7684}\x{4E8B}\x{696D}\x{FF0C}\x{76F8}\x{4FE1}\x{672A}\x{4F86}\x{5C07}\x{66F4}\x{4EE4}\x{4EBA}\x{671F}\x{5F85}\x{3002}\x{300D}"
+      RenderBlock {P} at (0,230) size 550x42
+        RenderText {#text} at (0,0) size 550x42
+          text run at (0,0) width 550: "\x{860B}\x{679C}\x{4E5F}\x{6301}\x{7E8C}\x{958B}\x{767C}\x{65B0}\x{7684}\x{529F}\x{80FD}\x{4F86}\x{63D0}\x{5347}\x{641C}\x{5C0B}\x{8207}\x{63A2}\x{7D22}\x{7684}\x{4FBF}\x{5229}\x{6027}\x{FF0C}\x{5305}\x{62EC}\x{FF1A}Genius for Apps\x{3001}App Store Essentials\x{3001}"
+          text run at (0,14) width 550: "\x{5B50}\x{5206}\x{985E}\x{6E05}\x{55AE}\x{FF0C}\x{4EE5}\x{53CA}\x{66F4}\x{8C50}\x{5BCC}\x{800C}\x{5BF6}\x{8CB4}\x{7684}\x{5BA2}\x{6236}\x{8A55}\x{8AD6}\x{3002}\x{96A8}\x{8457}\x{65B0}\x{7248}\x{7684} iTunes\x{AE} 9 \x{63A8}\x{51FA}\x{FF0C}\x{73FE}\x{5728}\x{60A8}\x{53EF}\x{4EE5}\x{8F15}\x{8F15}\x{9B06}\x{9B06}\x{76F4}\x{63A5}\x{5728}"
+          text run at (0,28) width 539: "iTunes \x{7576}\x{4E2D}\x{6574}\x{7406}\x{60A8}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{FF0C}\x{4E00}\x{65E6}\x{540C}\x{6B65}\x{4E4B}\x{5F8C}\x{FF0C}iPhone \x{6216} iPod touch \x{5C31}\x{6703}\x{81EA}\x{52D5}\x{51FA}\x{73FE}\x{60A8}\x{6240}\x{5B89}\x{6392}\x{7684}\x{914D}\x{7F6E}\x{3002}"
+      RenderBlock {P} at (0,284) size 550x84
+        RenderText {#text} at (0,0) size 550x84
+          text run at (0,0) width 550: "\x{4ECA}\x{5E74}\x{590F}\x{5929}\x{63A8}\x{51FA}\x{7684} iPhone OS 3.0 \x{70BA} iPhone \x{548C} iPod touch \x{4F7F}\x{7528}\x{8005}\x{63D0}\x{4F9B}\x{4E86} 100 \x{591A}\x{7A2E}\x{5168}\x{65B0}\x{7684}\x{529F}\x{80FD}\x{FF0C}\x{5305}\x{62EC}\x{FF1A}\x{526A}"
+          text run at (0,14) width 550: "\x{8CBC}\x{8207}\x{62F7}\x{8C9D}\x{FF1B}MMS\x{FF1B}\x{65B0}\x{589E}\x{6A6B}\x{5411}\x{6AA2}\x{8996}\x{7684} Mail\x{3001}Text \x{548C} Notes\x{FF1B}\x{7ACB}\x{9AD4}\x{8072} Bluetooth\x{FF1B}\x{6416}\x{4E00}\x{6416}\x{5C31}\x{96A8}\x{6A5F}\x{64AD}\x{653E}\x{FF1B}\x{96FB}\x{8996}\x{7BC0}"
+          text run at (0,28) width 550: "\x{76EE}\x{5206}\x{7D1A}\x{4FDD}\x{8B77}\x{63A7}\x{5236}\x{FF1B}\x{81EA}\x{52D5}\x{767B}\x{5165} Wi-Fi \x{71B1}\x{9EDE}\x{FF1B}\x{4EE5}\x{53CA} Push Notification \x{670D}\x{52D9}\x{901A}\x{77E5}\x{7B49}\x{7B49}\x{3002}\x{9019}\x{4E9B}\x{65B0}\x{589E}\x{529F}\x{80FD}\x{53D7}\x{5230}\x{5BA2}\x{6236}\x{7684}"
+          text run at (0,42) width 550: "\x{5EE3}\x{5927}\x{6B61}\x{8FCE}\x{FF0C}\x{622A}\x{81F3}\x{76EE}\x{524D}\x{70BA}\x{6B62}\x{FF0C}\x{5DF2}\x{7D93}\x{6709}\x{8D85}\x{904E} 20 \x{5104}\x{6B21}\x{7684} Push Notification \x{670D}\x{52D9}\x{901A}\x{77E5}\x{767C}\x{9001}\x{81F3} App Store \x{61C9}\x{7528}\x{7A0B}"
+          text run at (0,56) width 550: "\x{5F0F}\x{3002}\x{6B64}\x{5916}\x{FF0C}\x{6700}\x{8FD1}\x{63A8}\x{51FA}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{5167}\x{8CFC}\x{8CB7}\x{6A5F}\x{5236} (In-App Purchase)\x{FF0C}\x{70BA}\x{9818}\x{5148}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{958B}\x{767C}\x{5EE0}\x{5546}\x{63D0}\x{4F9B}\x{4E86}\x{4E00}\x{7A2E}"
+          text run at (0,70) width 339: "\x{65B9}\x{5F0F}\x{8B93}\x{5BA2}\x{6236}\x{76F4}\x{63A5}\x{5F9E}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{7576}\x{4E2D}\x{8CFC}\x{8CB7}\x{5167}\x{5BB9}\x{3001}\x{8A02}\x{95B1}\x{9805}\x{76EE}\x{53CA}\x{6578}\x{4F4D}\x{670D}\x{52D9}\x{3002}"

Modified: trunk/LayoutTests/platform/gtk/fast/text/justify-ideograph-leading-expansion-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/gtk/fast/text/justify-ideograph-simple-expected.png


(Binary files differ)

Added: trunk/LayoutTests/platform/gtk/fast/text/justify-ideograph-simple-expected.txt (0 => 253664)


--- trunk/LayoutTests/platform/gtk/fast/text/justify-ideograph-simple-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/gtk/fast/text/justify-ideograph-simple-expected.txt	2019-12-18 02:17:22 UTC (rev 253664)
@@ -0,0 +1,39 @@
+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 784x580
+      RenderBlock {P} at (0,0) size 550x56
+        RenderText {#text} at (0,0) size 550x56
+          text run at (0,0) width 550: "\x{3010}2009 \x{5E74} 11 \x{6708} 4 \x{65E5}\x{7F8E}\x{570B}\x{52A0}\x{5DDE} Cupertino \x{8A0A}\x{3011}\x{860B}\x{679C}\x{4ECA}\x{5929}\x{5BA3}\x{4F48}\x{FF0C}\x{5168}\x{4E16}\x{754C}\x{6700}\x{5927}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{5546}\x{5E97} App Store\x{FF0C}"
+          text run at (0,14) width 550: "\x{76EE}\x{524D}\x{5DF2}\x{64C1}\x{6709} 100,000 \x{591A}\x{7A2E}\x{4F86}\x{81EA}\x{5168}\x{7403}\x{958B}\x{767C}\x{4EBA}\x{54E1}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{3002}\x{5168}\x{4E16}\x{754C} 77 \x{500B}\x{570B}\x{5BB6}\x{7684} iPhone\x{AE} \x{8207} iPod touch\x{AE}"
+          text run at (0,28) width 550: "\x{7528}\x{6236}\x{64C1}\x{6709} 20 \x{500B}\x{985E}\x{5225}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{53EF}\x{4F9B}\x{9078}\x{64C7}\x{FF0C}\x{5305}\x{62EC}\x{FF1A}\x{904A}\x{6232}\x{3001}\x{5546}\x{7528}\x{3001}\x{65B0}\x{805E}\x{3001}\x{904B}\x{52D5}\x{3001}\x{91AB}\x{7642}\x{3001}\x{53C3}\x{8003}\x{66F8}\x{7C4D}\x{3001}\x{65C5}\x{904A}\x{7B49}"
+          text run at (0,42) width 545: "\x{7B49}\x{3002}\x{622A}\x{81F3}\x{76EE}\x{524D}\x{70BA}\x{6B62}\x{FF0C}App Store \x{4F7F}\x{7528}\x{8005}\x{4E0B}\x{8F09}\x{6B21}\x{6578}\x{5DF2}\x{8D85}\x{904E} 20 \x{5104}\x{6B21}\x{FF0C}\x{662F}\x{76EE}\x{524D}\x{5168}\x{7403}\x{6700}\x{53D7}\x{6B61}\x{8FCE}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{5546}\x{5E97}\x{3002}"
+      RenderBlock {P} at (0,68) size 550x42
+        RenderText {#text} at (0,0) size 550x42
+          text run at (0,0) width 550: "\x{860B}\x{679C}\x{5168}\x{7403}\x{7522}\x{54C1}\x{884C}\x{92B7}\x{8CC7}\x{6DF1}\x{526F}\x{7E3D}\x{88C1} Philip Schiller \x{8868}\x{793A}\x{FF1A}\x{300C}\x{63D0}\x{4F9B} 100,000 \x{591A}\x{7A2E}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{53EF}\x{4F9B}\x{9078}\x{64C7}\x{7684} App"
+          text run at (0,14) width 550: "Store\x{FF0C}\x{662F}\x{5168}\x{4E16}\x{754C}\x{6578}\x{5343}\x{842C} iPhone \x{548C} iPod touch \x{4F7F}\x{7528}\x{8005}\x{4EE4}\x{4EBA}\x{7A31}\x{7FA8}\x{7684}\x{4E3B}\x{8981}\x{539F}\x{56E0}\x{3002}iPhone SDK \x{5275}\x{9020}\x{4E86}\x{7B2C}\x{4E00}\x{500B}"
+          text run at (0,28) width 393: "\x{512A}\x{7570}\x{7684}\x{884C}\x{52D5}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{5E73}\x{53F0}\x{FF0C}\x{5BA2}\x{6236}\x{4E5F}\x{975E}\x{5E38}\x{559C}\x{611B}\x{958B}\x{767C}\x{4EBA}\x{54E1}\x{6240}\x{5275}\x{4F5C}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{3002}\x{300D}"
+      RenderBlock {P} at (0,122) size 550x42
+        RenderText {#text} at (0,0) size 550x42
+          text run at (0,0) width 550: "EA Mobile \x{7684} Worldwide Studios \x{526F}\x{7E3D}\x{88C1} Travis Boatman \x{6307}\x{51FA}\x{FF1A}\x{300C}App Store \x{4E0D}\x{50C5}\x{5FB9}\x{5E95}\x{6539}\x{8B8A}\x{4E86}\x{884C}\x{52D5}\x{904A}\x{6232}"
+          text run at (0,14) width 550: "\x{7522}\x{696D}\x{7684}\x{751F}\x{614B}\x{FF0C}\x{800C}\x{4E14}\x{9084}\x{5728}\x{6301}\x{7E8C}\x{6F14}\x{9032}\x{3002}\x{6709}\x{4E86}\x{5168}\x{7403} 5 \x{5343}\x{591A}\x{842C}\x{7684} iPhone \x{548C} iPod touch \x{5BA2}\x{6236}\x{70BA}\x{57FA}\x{790E}\x{FF0C}App Store \x{8B93}"
+          text run at (0,28) width 292: "\x{6211}\x{5011}\x{80FD}\x{5920}\x{958B}\x{767C}\x{53D7}\x{5230}\x{5EE3}\x{5927}\x{7684}\x{5BA2}\x{6236}\x{559C}\x{611B}\x{7684}\x{9AD8}\x{54C1}\x{8CEA} EA \x{904A}\x{6232}\x{3002}\x{300D}"
+      RenderBlock {P} at (0,176) size 550x42
+        RenderText {#text} at (0,0) size 550x42
+          text run at (0,0) width 550: "Smule \x{7684}\x{57F7}\x{884C}\x{9577} Jeff Smith \x{8868}\x{793A}\x{FF1A}\x{300C}\x{6211}\x{5011}\x{7684} I Am T-Pain \x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{53D7}\x{5230}\x{5168}\x{7403}\x{5BA2}\x{6236}\x{7684}\x{71B1}\x{70C8}\x{8FF4}\x{97FF}\x{FF0C}\x{6BCF}\x{65E5}\x{8D85}\x{904E}"
+          text run at (0,14) width 550: "10,000 \x{6B21}\x{7684}\x{4E0B}\x{8F09}\x{9060}\x{9060}\x{8D85}\x{8D8A}\x{6211}\x{5011}\x{7684}\x{9810}\x{671F}\x{3002}App Store \x{7D66}\x{4E86}\x{6211}\x{5011}\x{4E00}\x{500B}\x{7368}\x{7279}\x{7684}\x{5546}\x{6A5F}\x{FF0C}\x{8B93}\x{6211}\x{5011}\x{958B}\x{5275}\x{4E00}\x{500B}\x{975E}\x{5E38}\x{6210}\x{529F}"
+          text run at (0,28) width 192: "\x{7684}\x{4E8B}\x{696D}\x{FF0C}\x{76F8}\x{4FE1}\x{672A}\x{4F86}\x{5C07}\x{66F4}\x{4EE4}\x{4EBA}\x{671F}\x{5F85}\x{3002}\x{300D}"
+      RenderBlock {P} at (0,230) size 550x42
+        RenderText {#text} at (0,0) size 550x42
+          text run at (0,0) width 550: "\x{860B}\x{679C}\x{4E5F}\x{6301}\x{7E8C}\x{958B}\x{767C}\x{65B0}\x{7684}\x{529F}\x{80FD}\x{4F86}\x{63D0}\x{5347}\x{641C}\x{5C0B}\x{8207}\x{63A2}\x{7D22}\x{7684}\x{4FBF}\x{5229}\x{6027}\x{FF0C}\x{5305}\x{62EC}\x{FF1A}Genius for Apps\x{3001}App Store Essentials\x{3001}"
+          text run at (0,14) width 550: "\x{5B50}\x{5206}\x{985E}\x{6E05}\x{55AE}\x{FF0C}\x{4EE5}\x{53CA}\x{66F4}\x{8C50}\x{5BCC}\x{800C}\x{5BF6}\x{8CB4}\x{7684}\x{5BA2}\x{6236}\x{8A55}\x{8AD6}\x{3002}\x{96A8}\x{8457}\x{65B0}\x{7248}\x{7684} iTunes\x{AE} 9 \x{63A8}\x{51FA}\x{FF0C}\x{73FE}\x{5728}\x{60A8}\x{53EF}\x{4EE5}\x{8F15}\x{8F15}\x{9B06}\x{9B06}\x{76F4}\x{63A5}\x{5728}"
+          text run at (0,28) width 539: "iTunes \x{7576}\x{4E2D}\x{6574}\x{7406}\x{60A8}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{FF0C}\x{4E00}\x{65E6}\x{540C}\x{6B65}\x{4E4B}\x{5F8C}\x{FF0C}iPhone \x{6216} iPod touch \x{5C31}\x{6703}\x{81EA}\x{52D5}\x{51FA}\x{73FE}\x{60A8}\x{6240}\x{5B89}\x{6392}\x{7684}\x{914D}\x{7F6E}\x{3002}"
+      RenderBlock {P} at (0,284) size 550x84
+        RenderText {#text} at (0,0) size 550x84
+          text run at (0,0) width 550: "\x{4ECA}\x{5E74}\x{590F}\x{5929}\x{63A8}\x{51FA}\x{7684} iPhone OS 3.0 \x{70BA} iPhone \x{548C} iPod touch \x{4F7F}\x{7528}\x{8005}\x{63D0}\x{4F9B}\x{4E86} 100 \x{591A}\x{7A2E}\x{5168}\x{65B0}\x{7684}\x{529F}\x{80FD}\x{FF0C}\x{5305}\x{62EC}\x{FF1A}\x{526A}"
+          text run at (0,14) width 550: "\x{8CBC}\x{8207}\x{62F7}\x{8C9D}\x{FF1B}MMS\x{FF1B}\x{65B0}\x{589E}\x{6A6B}\x{5411}\x{6AA2}\x{8996}\x{7684} Mail\x{3001}Text \x{548C} Notes\x{FF1B}\x{7ACB}\x{9AD4}\x{8072} Bluetooth\x{FF1B}\x{6416}\x{4E00}\x{6416}\x{5C31}\x{96A8}\x{6A5F}\x{64AD}\x{653E}\x{FF1B}\x{96FB}\x{8996}\x{7BC0}"
+          text run at (0,28) width 550: "\x{76EE}\x{5206}\x{7D1A}\x{4FDD}\x{8B77}\x{63A7}\x{5236}\x{FF1B}\x{81EA}\x{52D5}\x{767B}\x{5165} Wi-Fi \x{71B1}\x{9EDE}\x{FF1B}\x{4EE5}\x{53CA} Push Notification \x{670D}\x{52D9}\x{901A}\x{77E5}\x{7B49}\x{7B49}\x{3002}\x{9019}\x{4E9B}\x{65B0}\x{589E}\x{529F}\x{80FD}\x{53D7}\x{5230}\x{5BA2}\x{6236}\x{7684}"
+          text run at (0,42) width 550: "\x{5EE3}\x{5927}\x{6B61}\x{8FCE}\x{FF0C}\x{622A}\x{81F3}\x{76EE}\x{524D}\x{70BA}\x{6B62}\x{FF0C}\x{5DF2}\x{7D93}\x{6709}\x{8D85}\x{904E} 20 \x{5104}\x{6B21}\x{7684} Push Notification \x{670D}\x{52D9}\x{901A}\x{77E5}\x{767C}\x{9001}\x{81F3} App Store \x{61C9}\x{7528}\x{7A0B}"
+          text run at (0,56) width 550: "\x{5F0F}\x{3002}\x{6B64}\x{5916}\x{FF0C}\x{6700}\x{8FD1}\x{63A8}\x{51FA}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{5167}\x{8CFC}\x{8CB7}\x{6A5F}\x{5236} (In-App Purchase)\x{FF0C}\x{70BA}\x{9818}\x{5148}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{958B}\x{767C}\x{5EE0}\x{5546}\x{63D0}\x{4F9B}\x{4E86}\x{4E00}\x{7A2E}"
+          text run at (0,70) width 339: "\x{65B9}\x{5F0F}\x{8B93}\x{5BA2}\x{6236}\x{76F4}\x{63A5}\x{5F9E}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{7576}\x{4E2D}\x{8CFC}\x{8CB7}\x{5167}\x{5BB9}\x{3001}\x{8A02}\x{95B1}\x{9805}\x{76EE}\x{53CA}\x{6578}\x{4F4D}\x{670D}\x{52D9}\x{3002}"

Modified: trunk/LayoutTests/platform/gtk/fast/text/justify-ideograph-vertical-expected.png


(Binary files differ)

Modified: trunk/Source/WebCore/ChangeLog (253663 => 253664)


--- trunk/Source/WebCore/ChangeLog	2019-12-18 01:54:54 UTC (rev 253663)
+++ trunk/Source/WebCore/ChangeLog	2019-12-18 02:17:22 UTC (rev 253664)
@@ -1,3 +1,22 @@
+2019-12-17  Fujii Hironori  <fujii.hiron...@gmail.com>
+
+        [cairo] text-align:justify wrongly expands CJK ideograph characters
+        https://bugs.webkit.org/show_bug.cgi?id=205321
+
+        Reviewed by Carlos Garcia Campos.
+
+        Even though canExpandAroundIdeographsInComplexText of
+        FontCairoHarfbuzzNG.cpp returns false, ComplexTextController
+        doesn't take it account. It ends up to expanding all ideographs
+        with a undesired expansion width.
+
+        WidthIterator properly checks canExpandAroundIdeographsInComplexText.
+        ComplexTextController also should do so.
+
+        * platform/graphics/ComplexTextController.cpp:
+        (WebCore::ComplexTextController::adjustGlyphsAndAdvances): Check canExpandAroundIdeographsInComplexText.
+        * platform/graphics/FontCascade.h: Friend with ComplexTextController to allow calling canExpandAroundIdeographsInComplexText.
+
 2019-12-17  Brent Fulgham  <bfulg...@apple.com>
 
         Limit URL to reasonable size

Modified: trunk/Source/WebCore/platform/graphics/ComplexTextController.cpp (253663 => 253664)


--- trunk/Source/WebCore/platform/graphics/ComplexTextController.cpp	2019-12-18 01:54:54 UTC (rev 253663)
+++ trunk/Source/WebCore/platform/graphics/ComplexTextController.cpp	2019-12-18 02:17:22 UTC (rev 253664)
@@ -785,7 +785,8 @@
                 if (runForbidsTrailingExpansion)
                     forbidTrailingExpansion = m_run.ltr() ? isLastCharacter : isFirstCharacter;
                 // Handle justification and word-spacing.
-                bool ideograph = FontCascade::isCJKIdeographOrSymbol(ch);
+                static bool expandAroundIdeographs = FontCascade::canExpandAroundIdeographsInComplexText();
+                bool ideograph = expandAroundIdeographs && FontCascade::isCJKIdeographOrSymbol(ch);
                 if (treatAsSpace || ideograph || forceLeadingExpansion || forceTrailingExpansion) {
                     // Distribute the run's total expansion evenly over all expansion opportunities in the run.
                     if (m_expansion) {

Modified: trunk/Source/WebCore/platform/graphics/FontCascade.h (253663 => 253664)


--- trunk/Source/WebCore/platform/graphics/FontCascade.h	2019-12-18 01:54:54 UTC (rev 253663)
+++ trunk/Source/WebCore/platform/graphics/FontCascade.h	2019-12-18 02:17:22 UTC (rev 253664)
@@ -229,6 +229,7 @@
     static std::pair<unsigned, bool> expansionOpportunityCountInternal(const UChar*, unsigned length, TextDirection, ExpansionBehavior);
 
     friend struct WidthIterator;
+    friend class ComplexTextController;
 
 public:
 #if ENABLE(TEXT_AUTOSIZING)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to