Title: [202057] trunk
Revision
202057
Author
[email protected]
Date
2016-06-14 11:59:48 -0700 (Tue, 14 Jun 2016)

Log Message

Honor bidi unicode codepoints
https://bugs.webkit.org/show_bug.cgi?id=149170
<rdar://problem/26527378>

Reviewed by Simon Fraser.

Source/WebCore:

BidiResolver doesn't have any concept of isolate Unicode code points, so produces
unexpected output when they are present. Fix by considering such code points as
whitespace in the bidi algorithm. This is a stop-gap measure until we can support
the codepoints fully in our Bidi algorithm.

Test: fast/text/isolate-ignore.html

* platform/graphics/Font.cpp:
(WebCore::createAndFillGlyphPage):
* platform/text/BidiResolver.h:
(WebCore::Subclass>::createBidiRunsForLine):

Source/WTF:

* wtf/unicode/CharacterNames.h:

LayoutTests:

* fast/text/isolate-ignore-expected.html: Added.
* fast/text/isolate-ignore.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (202056 => 202057)


--- trunk/LayoutTests/ChangeLog	2016-06-14 18:51:44 UTC (rev 202056)
+++ trunk/LayoutTests/ChangeLog	2016-06-14 18:59:48 UTC (rev 202057)
@@ -1,3 +1,14 @@
+2016-06-14  Myles C. Maxfield  <[email protected]>
+
+        Honor bidi unicode codepoints
+        https://bugs.webkit.org/show_bug.cgi?id=149170
+        <rdar://problem/26527378>
+
+        Reviewed by Simon Fraser.
+
+        * fast/text/isolate-ignore-expected.html: Added.
+        * fast/text/isolate-ignore.html: Added.
+
 2016-06-14  Ryan Haddad  <[email protected]>
 
         Removing duplicated TestExpectation and sorting others alphabetically

Added: trunk/LayoutTests/fast/text/isolate-ignore-expected.html (0 => 202057)


--- trunk/LayoutTests/fast/text/isolate-ignore-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/isolate-ignore-expected.html	2016-06-14 18:59:48 UTC (rev 202057)
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<body>
+This test makes sure that isolate codepoints are ignored.
+<div dir="ltr">&#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea; English &#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea;</div>
+<div dir="ltr">English &#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea; English</div>
+<div dir="rtl">&#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea; English &#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea;</div>
+<div dir="rtl">English &#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea; English</div>
+<div dir="ltr">&#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea; English &#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea;</div>
+<div dir="ltr">English &#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea; English</div>
+<div dir="rtl">&#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea; English &#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea;</div>
+<div dir="rtl">English &#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea; English</div>
+<div dir="ltr">&#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea; English &#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea;</div>
+<div dir="ltr">English &#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea; English</div>
+<div dir="rtl">&#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea; English &#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea;</div>
+<div dir="rtl">English &#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea; English</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/isolate-ignore.html (0 => 202057)


--- trunk/LayoutTests/fast/text/isolate-ignore.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/isolate-ignore.html	2016-06-14 18:59:48 UTC (rev 202057)
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<body>
+This test makes sure that isolate codepoints are ignored.
+<div dir="ltr">&#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea; &#x2068;English&#x2069; &#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea;</div>
+<div dir="ltr">English &#x2068;&#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea;&#x2069; English</div>
+<div dir="rtl">&#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea; &#x2068;English&#x2069; &#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea;</div>
+<div dir="rtl">English &#x2068;&#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea;&#x2069; English</div>
+<div dir="ltr">&#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea; &#x2066;English&#x2069; &#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea;</div>
+<div dir="ltr">English &#x2066;&#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea;&#x2069; English</div>
+<div dir="rtl">&#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea; &#x2066;English&#x2069; &#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea;</div>
+<div dir="rtl">English &#x2066;&#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea;&#x2069; English</div>
+<div dir="ltr">&#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea; &#x2067;English&#x2069; &#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea;</div>
+<div dir="ltr">English &#x2067;&#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea;&#x2069; English</div>
+<div dir="rtl">&#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea; &#x2067;English&#x2069; &#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea;</div>
+<div dir="rtl">English &#x2067;&#x05e2;&#x05d1;&#x05e8;&#x05d9;&#x05ea;&#x2069; English</div>
+</body>
+</html>

Modified: trunk/Source/WTF/ChangeLog (202056 => 202057)


--- trunk/Source/WTF/ChangeLog	2016-06-14 18:51:44 UTC (rev 202056)
+++ trunk/Source/WTF/ChangeLog	2016-06-14 18:59:48 UTC (rev 202057)
@@ -1,3 +1,13 @@
+2016-06-14  Myles C. Maxfield  <[email protected]>
+
+        Honor bidi unicode codepoints
+        https://bugs.webkit.org/show_bug.cgi?id=149170
+        <rdar://problem/26527378>
+
+        Reviewed by Simon Fraser.
+
+        * wtf/unicode/CharacterNames.h:
+
 2016-06-13  Alex Christensen  <[email protected]>
 
         Add WebSocketProvider stub

Modified: trunk/Source/WTF/wtf/unicode/CharacterNames.h (202056 => 202057)


--- trunk/Source/WTF/wtf/unicode/CharacterNames.h	2016-06-14 18:51:44 UTC (rev 202056)
+++ trunk/Source/WTF/wtf/unicode/CharacterNames.h	2016-06-14 18:59:48 UTC (rev 202057)
@@ -48,6 +48,7 @@
 const UChar carriageReturn = 0x000D;
 const UChar ethiopicPrefaceColon = 0x1366;
 const UChar ethiopicWordspace = 0x1361;
+const UChar firstStrongIsolate = 0x2068;
 const UChar fisheye = 0x25C9;
 const UChar quotationMark = 0x0022;
 const UChar hebrewPunctuationGeresh = 0x05F3;
@@ -62,6 +63,7 @@
 const UChar leftDoubleQuotationMark = 0x201C;
 const UChar leftSingleQuotationMark = 0x2018;
 const UChar leftToRightEmbed = 0x202A;
+const UChar leftToRightIsolate = 0x2066;
 const UChar leftToRightMark = 0x200E;
 const UChar leftToRightOverride = 0x202D;
 const UChar minusSign = 0x2212;
@@ -70,10 +72,12 @@
 const UChar noBreakSpace = 0x00A0;
 const UChar objectReplacementCharacter = 0xFFFC;
 const UChar popDirectionalFormatting = 0x202C;
+const UChar popDirectionalIsolate = 0x2069;
 const UChar replacementCharacter = 0xFFFD;
 const UChar rightDoubleQuotationMark = 0x201D;
 const UChar rightSingleQuotationMark = 0x2019;
 const UChar rightToLeftEmbed = 0x202B;
+const UChar rightToLeftIsolate = 0x2067;
 const UChar rightToLeftMark = 0x200F;
 const UChar rightToLeftOverride = 0x202E;
 const UChar sesameDot = 0xFE45;
@@ -107,6 +111,7 @@
 using WTF::Unicode::carriageReturn;
 using WTF::Unicode::ethiopicPrefaceColon;
 using WTF::Unicode::ethiopicWordspace;
+using WTF::Unicode::firstStrongIsolate;
 using WTF::Unicode::fisheye;
 using WTF::Unicode::hebrewPunctuationGeresh;
 using WTF::Unicode::hebrewPunctuationGershayim;
@@ -120,6 +125,7 @@
 using WTF::Unicode::leftDoubleQuotationMark;
 using WTF::Unicode::leftSingleQuotationMark;
 using WTF::Unicode::leftToRightEmbed;
+using WTF::Unicode::leftToRightIsolate;
 using WTF::Unicode::leftToRightMark;
 using WTF::Unicode::leftToRightOverride;
 using WTF::Unicode::minusSign;
@@ -128,10 +134,12 @@
 using WTF::Unicode::noBreakSpace;
 using WTF::Unicode::objectReplacementCharacter;
 using WTF::Unicode::popDirectionalFormatting;
+using WTF::Unicode::popDirectionalIsolate;
 using WTF::Unicode::replacementCharacter;
 using WTF::Unicode::rightDoubleQuotationMark;
 using WTF::Unicode::rightSingleQuotationMark;
 using WTF::Unicode::rightToLeftEmbed;
+using WTF::Unicode::rightToLeftIsolate;
 using WTF::Unicode::rightToLeftMark;
 using WTF::Unicode::rightToLeftOverride;
 using WTF::Unicode::sesameDot;

Modified: trunk/Source/WebCore/ChangeLog (202056 => 202057)


--- trunk/Source/WebCore/ChangeLog	2016-06-14 18:51:44 UTC (rev 202056)
+++ trunk/Source/WebCore/ChangeLog	2016-06-14 18:59:48 UTC (rev 202057)
@@ -1,3 +1,23 @@
+2016-06-14  Myles C. Maxfield  <[email protected]>
+
+        Honor bidi unicode codepoints
+        https://bugs.webkit.org/show_bug.cgi?id=149170
+        <rdar://problem/26527378>
+
+        Reviewed by Simon Fraser.
+
+        BidiResolver doesn't have any concept of isolate Unicode code points, so produces
+        unexpected output when they are present. Fix by considering such code points as
+        whitespace in the bidi algorithm. This is a stop-gap measure until we can support
+        the codepoints fully in our Bidi algorithm.
+
+        Test: fast/text/isolate-ignore.html
+
+        * platform/graphics/Font.cpp:
+        (WebCore::createAndFillGlyphPage):
+        * platform/text/BidiResolver.h:
+        (WebCore::Subclass>::createBidiRunsForLine):
+
 2016-06-14  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r200455.

Modified: trunk/Source/WebCore/platform/graphics/Font.cpp (202056 => 202057)


--- trunk/Source/WebCore/platform/graphics/Font.cpp	2016-06-14 18:51:44 UTC (rev 202056)
+++ trunk/Source/WebCore/platform/graphics/Font.cpp	2016-06-14 18:59:48 UTC (rev 202057)
@@ -185,9 +185,13 @@
             buffer[rightToLeftEmbed - start] = zeroWidthSpace;
             buffer[leftToRightOverride - start] = zeroWidthSpace;
             buffer[rightToLeftOverride - start] = zeroWidthSpace;
+            buffer[leftToRightIsolate - start] = zeroWidthSpace;
+            buffer[rightToLeftIsolate - start] = zeroWidthSpace;
             buffer[zeroWidthNonJoiner - start] = zeroWidthSpace;
             buffer[zeroWidthJoiner - start] = zeroWidthSpace;
             buffer[popDirectionalFormatting - start] = zeroWidthSpace;
+            buffer[popDirectionalIsolate - start] = zeroWidthSpace;
+            buffer[firstStrongIsolate - start] = zeroWidthSpace;
         } else if (start == (objectReplacementCharacter & ~(GlyphPage::size - 1))) {
             // Object replacement character must not render at all.
             buffer[objectReplacementCharacter - start] = zeroWidthSpace;

Modified: trunk/Source/WebCore/platform/text/BidiResolver.h (202056 => 202057)


--- trunk/Source/WebCore/platform/text/BidiResolver.h	2016-06-14 18:51:44 UTC (rev 202056)
+++ trunk/Source/WebCore/platform/text/BidiResolver.h	2016-06-14 18:59:48 UTC (rev 202057)
@@ -632,7 +632,7 @@
 
         // We ignore all character directionality while in unicode-bidi: isolate spans.
         // We'll handle ordering the isolated characters in a second pass.
-        if (inIsolate())
+        if (inIsolate() || dirCurrent == U_FIRST_STRONG_ISOLATE || dirCurrent == U_LEFT_TO_RIGHT_ISOLATE || dirCurrent == U_RIGHT_TO_LEFT_ISOLATE || dirCurrent == U_POP_DIRECTIONAL_ISOLATE)
             dirCurrent = U_OTHER_NEUTRAL;
 
         ASSERT(m_status.eor != U_OTHER_NEUTRAL || m_eor.atEnd());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to