Title: [104852] branches/safari-534.54-branch

Diff

Modified: branches/safari-534.54-branch/LayoutTests/ChangeLog (104851 => 104852)


--- branches/safari-534.54-branch/LayoutTests/ChangeLog	2012-01-12 21:25:39 UTC (rev 104851)
+++ branches/safari-534.54-branch/LayoutTests/ChangeLog	2012-01-12 21:26:58 UTC (rev 104852)
@@ -1,5 +1,19 @@
 2011-1-11  Lucas Forschler  <[email protected]>
 
+    Merge 92005
+
+    2011-07-29  Dan Bernstein  <[email protected]>
+
+            Test for <rdar://problem/9864578> Regional indicator symbols do not combine into national flags
+            https://bugs.webkit.org/show_bug.cgi?id=65380
+
+            Reviewed by Anders Carlsson.
+
+            * fast/text/regional-indicator-symobls-expected.txt: Added.
+            * fast/text/regional-indicator-symobls.html: Added.
+
+2011-1-11  Lucas Forschler  <[email protected]>
+
     Merge 88479
 
     2011-06-09  Julien Chaffraix  <[email protected]>

Copied: branches/safari-534.54-branch/LayoutTests/fast/text/regional-indicator-symobls-expected.txt (from rev 92005, trunk/LayoutTests/fast/text/regional-indicator-symobls-expected.txt) (0 => 104852)


--- branches/safari-534.54-branch/LayoutTests/fast/text/regional-indicator-symobls-expected.txt	                        (rev 0)
+++ branches/safari-534.54-branch/LayoutTests/fast/text/regional-indicator-symobls-expected.txt	2012-01-12 21:26:58 UTC (rev 104852)
@@ -0,0 +1,7 @@
+Test that regional indicator symobol letters can combine into national flags.
+
+The two boxes below should look the same.
+
+PASS
+
+πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

Copied: branches/safari-534.54-branch/LayoutTests/fast/text/regional-indicator-symobls.html (from rev 92005, trunk/LayoutTests/fast/text/regional-indicator-symobls.html) (0 => 104852)


--- branches/safari-534.54-branch/LayoutTests/fast/text/regional-indicator-symobls.html	                        (rev 0)
+++ branches/safari-534.54-branch/LayoutTests/fast/text/regional-indicator-symobls.html	2012-01-12 21:26:58 UTC (rev 104852)
@@ -0,0 +1,25 @@
+<style>
+    span { border: solid; }
+    span#reference { text-rendering: optimizelegibility; }
+</style>
+<p>
+    Test that regional indicator symobol letters can combine into national flags.
+</p>
+<p>
+    The two boxes below should look the same.
+</p>
+<p id="result">
+    FAIL: Test did not finish.
+</p>
+<p style="font-size: 48px;">
+    <span id="test">&#x1f1ec;&#x1f1e7; &#x1f1fa;&#x1f1f8;</span>
+    <span id="reference">&#x1f1ec;&#x1f1e7; &#x1f1fa;&#x1f1f8;</span>
+</p>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    var test = document.getElementById("test");
+    var reference = document.getElementById("reference");
+    document.getElementById("result").innerText = test.offsetWidth === reference.offsetWidth ? "PASS" : "FAIL";
+</script>

Modified: branches/safari-534.54-branch/Source/WebCore/ChangeLog (104851 => 104852)


--- branches/safari-534.54-branch/Source/WebCore/ChangeLog	2012-01-12 21:25:39 UTC (rev 104851)
+++ branches/safari-534.54-branch/Source/WebCore/ChangeLog	2012-01-12 21:26:58 UTC (rev 104852)
@@ -1,5 +1,24 @@
 2011-1-11  Lucas Forschler  <[email protected]>
 
+    Merge 92005
+
+    2011-07-29  Dan Bernstein  <[email protected]>
+
+            Added the regional indicator symbols to the set of codepoints that force use of the complex text code path.
+
+            Fixes <rdar://problem/9864578> Regional indicator symbols do not combine into national flags
+            https://bugs.webkit.org/show_bug.cgi?id=65380
+
+            Reviewed by Anders Carlsson.
+
+            Test: fast/text/regional-indicator-symobls.html
+
+            * platform/graphics/Font.cpp:
+            (WebCore::Font::codePath): Added handling of surrogate pairs, which returns Complex for characters in
+            the range U+1F1E6..U+1F1FF.
+
+2011-1-11  Lucas Forschler  <[email protected]>
+
     Merge 88479
 
     2011-06-09  Julien Chaffraix  <[email protected]>

Modified: branches/safari-534.54-branch/Source/WebCore/platform/graphics/Font.cpp (104851 => 104852)


--- branches/safari-534.54-branch/Source/WebCore/platform/graphics/Font.cpp	2012-01-12 21:25:39 UTC (rev 104851)
+++ branches/safari-534.54-branch/Source/WebCore/platform/graphics/Font.cpp	2012-01-12 21:26:58 UTC (rev 104852)
@@ -403,13 +403,33 @@
         if (c <= 0xD7FF)
             return Complex;
 
+        if (c <= 0xDBFF) {
+            // High surrogate
+
+            if (i == run.length() - 1)
+                continue;
+
+            UChar next = run[++i];
+            if (!U16_IS_TRAIL(next))
+                continue;
+
+            UChar32 supplementaryCharacter = U16_GET_SUPPLEMENTARY(c, next);
+
+            if (supplementaryCharacter < 0x1F1E6) // U+1F1E6 through U+1F1FF Regional Indicator Symbols
+                continue;
+            if (supplementaryCharacter <= 0x1F1FF)
+                return Complex;
+
+            // FIXME: Check for Brahmi (U+11000 block), Kaithi (U+11080 block) and other complex scripts
+            // in plane 1 or higher.
+
+            continue;
+        }
+
         if (c < 0xFE20) // U+FE20 through U+FE2F Combining half marks
             continue;
         if (c <= 0xFE2F)
             return Complex;
-
-        // FIXME: Make this loop UTF-16-aware and check for Brahmi (U+11000 block)
-        // Kaithi (U+11080 block) and other complex scripts in plane 1 or higher.
     }
 
     if (typesettingFeatures())
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to