- Revision
- 202083
- Author
- [email protected]
- Date
- 2016-06-14 21:44:01 -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 (202082 => 202083)
--- trunk/LayoutTests/ChangeLog 2016-06-15 02:52:35 UTC (rev 202082)
+++ trunk/LayoutTests/ChangeLog 2016-06-15 04:44:01 UTC (rev 202083)
@@ -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 Joseph Pecoraro <[email protected]>
Web Inspector: Rename Timeline.setAutoCaptureInstruments to Timeline.setInstruments
Added: trunk/LayoutTests/fast/text/isolate-ignore-expected.html (0 => 202083)
--- trunk/LayoutTests/fast/text/isolate-ignore-expected.html (rev 0)
+++ trunk/LayoutTests/fast/text/isolate-ignore-expected.html 2016-06-15 04:44:01 UTC (rev 202083)
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<body>
+This test makes sure that isolate codepoints are ignored.
+<div dir="ltr">עברית English עברית</div>
+<div dir="ltr">English עברית English</div>
+<div dir="rtl">עברית English עברית</div>
+<div dir="rtl">English עברית English</div>
+<div dir="ltr">עברית English עברית</div>
+<div dir="ltr">English עברית English</div>
+<div dir="rtl">עברית English עברית</div>
+<div dir="rtl">English עברית English</div>
+<div dir="ltr">עברית English עברית</div>
+<div dir="ltr">English עברית English</div>
+<div dir="rtl">עברית English עברית</div>
+<div dir="rtl">English עברית English</div>
+</body>
+</html>
Added: trunk/LayoutTests/fast/text/isolate-ignore.html (0 => 202083)
--- trunk/LayoutTests/fast/text/isolate-ignore.html (rev 0)
+++ trunk/LayoutTests/fast/text/isolate-ignore.html 2016-06-15 04:44:01 UTC (rev 202083)
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<body>
+This test makes sure that isolate codepoints are ignored.
+<div dir="ltr">עברית ⁨English⁩ עברית</div>
+<div dir="ltr">English ⁨עברית⁩ English</div>
+<div dir="rtl">עברית ⁨English⁩ עברית</div>
+<div dir="rtl">English ⁨עברית⁩ English</div>
+<div dir="ltr">עברית ⁦English⁩ עברית</div>
+<div dir="ltr">English ⁦עברית⁩ English</div>
+<div dir="rtl">עברית ⁦English⁩ עברית</div>
+<div dir="rtl">English ⁦עברית⁩ English</div>
+<div dir="ltr">עברית ⁧English⁩ עברית</div>
+<div dir="ltr">English ⁧עברית⁩ English</div>
+<div dir="rtl">עברית ⁧English⁩ עברית</div>
+<div dir="rtl">English ⁧עברית⁩ English</div>
+</body>
+</html>
Modified: trunk/Source/WTF/ChangeLog (202082 => 202083)
--- trunk/Source/WTF/ChangeLog 2016-06-15 02:52:35 UTC (rev 202082)
+++ trunk/Source/WTF/ChangeLog 2016-06-15 04:44:01 UTC (rev 202083)
@@ -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-14 Commit Queue <[email protected]>
Unreviewed, rolling out r202057.
Modified: trunk/Source/WTF/wtf/unicode/CharacterNames.h (202082 => 202083)
--- trunk/Source/WTF/wtf/unicode/CharacterNames.h 2016-06-15 02:52:35 UTC (rev 202082)
+++ trunk/Source/WTF/wtf/unicode/CharacterNames.h 2016-06-15 04:44:01 UTC (rev 202083)
@@ -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 (202082 => 202083)
--- trunk/Source/WebCore/ChangeLog 2016-06-15 02:52:35 UTC (rev 202082)
+++ trunk/Source/WebCore/ChangeLog 2016-06-15 04:44:01 UTC (rev 202083)
@@ -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 Antoine Quint <[email protected]>
[iOS] Play glyph is pixelated when the page zoom is large
Modified: trunk/Source/WebCore/platform/graphics/Font.cpp (202082 => 202083)
--- trunk/Source/WebCore/platform/graphics/Font.cpp 2016-06-15 02:52:35 UTC (rev 202082)
+++ trunk/Source/WebCore/platform/graphics/Font.cpp 2016-06-15 04:44:01 UTC (rev 202083)
@@ -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 (202082 => 202083)
--- trunk/Source/WebCore/platform/text/BidiResolver.h 2016-06-15 02:52:35 UTC (rev 202082)
+++ trunk/Source/WebCore/platform/text/BidiResolver.h 2016-06-15 04:44:01 UTC (rev 202083)
@@ -630,9 +630,16 @@
dirCurrent = m_status.last;
}
+#if PLATFORM(WIN)
+ // Our Windows build hasn't updated its headers from ICU 6.1, which doesn't have these symbols.
+ const UCharDirection U_FIRST_STRONG_ISOLATE = static_cast<UCharDirection>(19);
+ const UCharDirection U_LEFT_TO_RIGHT_ISOLATE = static_cast<UCharDirection>(20);
+ const UCharDirection U_RIGHT_TO_LEFT_ISOLATE = static_cast<UCharDirection>(21);
+ const UCharDirection U_POP_DIRECTIONAL_ISOLATE = static_cast<UCharDirection>(22);
+#endif
// 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());