Title: [216331] trunk
Revision
216331
Author
mmaxfi...@apple.com
Date
2017-05-06 10:54:16 -0700 (Sat, 06 May 2017)

Log Message

REGERSSION(r213499): Emoji with Fitzpatrick modifiers are drawn as two separate glyphs
https://bugs.webkit.org/show_bug.cgi?id=171750
<rdar://problem/31122612>

Reviewed by Zalan Bujtas.

Source/WebCore:

Emoji with Fitzpatrick modifiers need to take our complex text codepath. When looking through
the string to determine which code path to use, we ask if a particular codepoint is an emoji
group candidate. r213499 expanded the set of these candidates to include Fitzpatrick modifiers,
which means the next "if" statement would never be hit. Instead, we should check that "if"
statement first (because order is not important here). The next checks do not intersect with
any emoji group candidates.

Test: fast/text/fitzpatrick-combination.html

* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::characterRangeCodePath):

LayoutTests:

* fast/text/fitzpatrick-combination-expected.html: Added.
* fast/text/fitzpatrick-combination.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (216330 => 216331)


--- trunk/LayoutTests/ChangeLog	2017-05-06 17:31:10 UTC (rev 216330)
+++ trunk/LayoutTests/ChangeLog	2017-05-06 17:54:16 UTC (rev 216331)
@@ -1,3 +1,14 @@
+2017-05-06  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        REGERSSION(r213499): Emoji with Fitzpatrick modifiers are drawn as two separate glyphs
+        https://bugs.webkit.org/show_bug.cgi?id=171750
+        <rdar://problem/31122612>
+
+        Reviewed by Zalan Bujtas.
+
+        * fast/text/fitzpatrick-combination-expected.html: Added.
+        * fast/text/fitzpatrick-combination.html: Added.
+
 2017-05-05  Zalan Bujtas  <za...@apple.com>
 
         Renderers being destroyed should not be added to AX's deferred list.

Added: trunk/LayoutTests/fast/text/fitzpatrick-combination-expected.html (0 => 216331)


--- trunk/LayoutTests/fast/text/fitzpatrick-combination-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/fitzpatrick-combination-expected.html	2017-05-06 17:54:16 UTC (rev 216331)
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+</head>
+<body style="margin: 0px;">
+<div style="position: relative;">
+<span style="position: relative; left: -9999px;">👍</span>
+</div>
+This test makes sure that emoji with Fitzpatrick modifier are drawn as a single glyph. The test passes if this text you are reading right now is the only text on the page.
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/fitzpatrick-combination.html (0 => 216331)


--- trunk/LayoutTests/fast/text/fitzpatrick-combination.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/fitzpatrick-combination.html	2017-05-06 17:54:16 UTC (rev 216331)
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+</head>
+<body style="margin: 0px;">
+<div id="container" style="position: relative;">
+<span id="target" style="direction: rtl !important; unicode-bidi: embed;">👍🏾</span>
+</div>
+This test makes sure that emoji with Fitzpatrick modifier are drawn as a single glyph. The test passes if this text you are reading right now is the only text on the page.
+<script>
+var fudge = 6;
+var container = document.getElementById("container");
+var target = document.getElementById("target");
+var cover = document.createElement("div");
+cover.style.position = "absolute";
+cover.style.left = target.offsetLeft.toString() + "px";
+cover.style.top = (target.offsetTop - fudge).toString() + "px";
+cover.style.width = target.offsetWidth.toString() + "px";
+cover.style.height = (target.offsetHeight + fudge).toString() + "px";
+cover.style.backgroundColor = "white";
+container.appendChild(cover);
+</script>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (216330 => 216331)


--- trunk/Source/WebCore/ChangeLog	2017-05-06 17:31:10 UTC (rev 216330)
+++ trunk/Source/WebCore/ChangeLog	2017-05-06 17:54:16 UTC (rev 216331)
@@ -1,3 +1,23 @@
+2017-05-06  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        REGERSSION(r213499): Emoji with Fitzpatrick modifiers are drawn as two separate glyphs
+        https://bugs.webkit.org/show_bug.cgi?id=171750
+        <rdar://problem/31122612>
+
+        Reviewed by Zalan Bujtas.
+
+        Emoji with Fitzpatrick modifiers need to take our complex text codepath. When looking through
+        the string to determine which code path to use, we ask if a particular codepoint is an emoji
+        group candidate. r213499 expanded the set of these candidates to include Fitzpatrick modifiers,
+        which means the next "if" statement would never be hit. Instead, we should check that "if"
+        statement first (because order is not important here). The next checks do not intersect with
+        any emoji group candidates.
+
+        Test: fast/text/fitzpatrick-combination.html
+
+        * platform/graphics/FontCascade.cpp:
+        (WebCore::FontCascade::characterRangeCodePath):
+
 2017-05-06  Youenn Fablet  <you...@apple.com>
 
         RealtimeMediaSourceCenter callbacks should be passed as r-values

Modified: trunk/Source/WebCore/platform/graphics/FontCascade.cpp (216330 => 216331)


--- trunk/Source/WebCore/platform/graphics/FontCascade.cpp	2017-05-06 17:31:10 UTC (rev 216330)
+++ trunk/Source/WebCore/platform/graphics/FontCascade.cpp	2017-05-06 17:54:16 UTC (rev 216331)
@@ -846,12 +846,12 @@
             if (supplementaryCharacter <= 0x1F1FF)
                 return Complex;
 
+            if (isEmojiFitzpatrickModifier(supplementaryCharacter))
+                return Complex;
             if (isEmojiGroupCandidate(supplementaryCharacter)) {
                 previousCharacterIsEmojiGroupCandidate = true;
                 continue;
             }
-            if (isEmojiFitzpatrickModifier(supplementaryCharacter))
-                return Complex;
             if (supplementaryCharacter < 0xE0100) // U+E0100 through U+E01EF Unicode variation selectors.
                 continue;
             if (supplementaryCharacter <= 0xE01EF)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to