Title: [248815] trunk
Revision
248815
Author
mmaxfi...@apple.com
Date
2019-08-16 21:38:44 -0700 (Fri, 16 Aug 2019)

Log Message

[macOS] Emoji with variation selectors are rendered in text style, not emoji style
https://bugs.webkit.org/show_bug.cgi?id=200830
<rdar://problem/53076002>

Reviewed by Simon Fraser.

Source/WebCore:

When mapping characters to glyphs, Core Text is giving us the deleted glyph ID, which is unexpected.
We were treating it as a valid glyph ID, but it rather should be treated as an invalid glyph ID.

Test: fast/text/emoji-variation-selector.html

* platform/graphics/mac/GlyphPageMac.cpp:
(WebCore::GlyphPage::fill):

LayoutTests:

* fast/text/emoji-variation-selector-expected-mismatch.html: Added.
* fast/text/emoji-variation-selector.html: Added.
* platform/win/TestExpectations: Mark as failing on Windows, because it doesn't support variation selectors.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (248814 => 248815)


--- trunk/LayoutTests/ChangeLog	2019-08-17 04:13:06 UTC (rev 248814)
+++ trunk/LayoutTests/ChangeLog	2019-08-17 04:38:44 UTC (rev 248815)
@@ -1,3 +1,15 @@
+2019-08-16  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        [macOS] Emoji with variation selectors are rendered in text style, not emoji style
+        https://bugs.webkit.org/show_bug.cgi?id=200830
+        <rdar://problem/53076002>
+
+        Reviewed by Simon Fraser.
+
+        * fast/text/emoji-variation-selector-expected-mismatch.html: Added.
+        * fast/text/emoji-variation-selector.html: Added.
+        * platform/win/TestExpectations: Mark as failing on Windows, because it doesn't support variation selectors.
+
 2019-08-16  Saam Barati  <sbar...@apple.com>
 
         [WHLSL] Make "operator cast" constructors native

Added: trunk/LayoutTests/fast/text/emoji-variation-selector-expected-mismatch.html (0 => 248815)


--- trunk/LayoutTests/fast/text/emoji-variation-selector-expected-mismatch.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/emoji-variation-selector-expected-mismatch.html	2019-08-17 04:38:44 UTC (rev 248815)
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+</head>
+<body>
+<div style="font-size: 48px;">&#x26a0;&#xfe0e;</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/emoji-variation-selector.html (0 => 248815)


--- trunk/LayoutTests/fast/text/emoji-variation-selector.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/emoji-variation-selector.html	2019-08-17 04:38:44 UTC (rev 248815)
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+</head>
+<body>
+<div style="font-size: 48px;">&#x26a0;&#xfe0f;</div>
+</body>
+</html>

Modified: trunk/LayoutTests/platform/win/TestExpectations (248814 => 248815)


--- trunk/LayoutTests/platform/win/TestExpectations	2019-08-17 04:13:06 UTC (rev 248814)
+++ trunk/LayoutTests/platform/win/TestExpectations	2019-08-17 04:38:44 UTC (rev 248815)
@@ -4433,3 +4433,6 @@
 webkit.org/b/198679 fast/events/fire-mousedown-while-pressing-mouse-button.html [ Failure ]
 
 imported/w3c/web-platform-tests/wasm [ Skip ]
+
+# Variation selectors are not implemented on Windows.
+webkit.org/b/220830 fast/text/emoji-variation-selector.html [ ImageOnlyFailure ]

Modified: trunk/Source/WebCore/ChangeLog (248814 => 248815)


--- trunk/Source/WebCore/ChangeLog	2019-08-17 04:13:06 UTC (rev 248814)
+++ trunk/Source/WebCore/ChangeLog	2019-08-17 04:38:44 UTC (rev 248815)
@@ -1,3 +1,19 @@
+2019-08-16  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        [macOS] Emoji with variation selectors are rendered in text style, not emoji style
+        https://bugs.webkit.org/show_bug.cgi?id=200830
+        <rdar://problem/53076002>
+
+        Reviewed by Simon Fraser.
+
+        When mapping characters to glyphs, Core Text is giving us the deleted glyph ID, which is unexpected.
+        We were treating it as a valid glyph ID, but it rather should be treated as an invalid glyph ID.
+
+        Test: fast/text/emoji-variation-selector.html
+
+        * platform/graphics/mac/GlyphPageMac.cpp:
+        (WebCore::GlyphPage::fill):
+
 2019-08-16  Saam Barati  <sbar...@apple.com>
 
         [WHLSL] Make "operator cast" constructors native

Modified: trunk/Source/WebCore/platform/graphics/mac/GlyphPageMac.cpp (248814 => 248815)


--- trunk/Source/WebCore/platform/graphics/mac/GlyphPageMac.cpp	2019-08-17 04:13:06 UTC (rev 248814)
+++ trunk/Source/WebCore/platform/graphics/mac/GlyphPageMac.cpp	2019-08-17 04:38:44 UTC (rev 248815)
@@ -47,6 +47,8 @@
     return false;
 }
 
+static const constexpr CGGlyph deletedGlyph = 0xFFFF;
+
 bool GlyphPage::fill(UChar* buffer, unsigned bufferLength)
 {
     ASSERT(bufferLength == GlyphPage::size || bufferLength == 2 * GlyphPage::size);
@@ -62,8 +64,9 @@
 
     bool haveGlyphs = false;
     for (unsigned i = 0; i < GlyphPage::size; ++i) {
-        if (glyphs[i * glyphStep]) {
-            setGlyphForIndex(i, glyphs[i * glyphStep]);
+        auto theGlyph = glyphs[i * glyphStep];
+        if (theGlyph && theGlyph != deletedGlyph) {
+            setGlyphForIndex(i, theGlyph);
             haveGlyphs = true;
         }
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to