Reviewed by Adam Roben.
- ensure that Unicode bidi control characters are rendered as zero width
spaces
Test: fast/text/international/bidi-control-chars-treated-as-ZWS.html
* platform/graphics/Font.h:
(WebCore::Font::treatAsZeroWidthSpace):
* platform/graphics/GlyphPageTreeNode.cpp:
(WebCore::GlyphPageTreeNode::initializePage):
* platform/text/CharacterNames.h:
LayoutTests:
Reviewed by Adam Roben.
- test that Unicode bidi control characters are rendered as zero width
spaces
* fast/text/international/bidi-control-chars-treated-as-ZWS.html: Added.
* platform/mac-leopard/fast/text/international/bidi-control-chars-treated-as-ZWS-expected.checksum: Added.
* platform/mac-leopard/fast/text/international/bidi-control-chars-treated-as-ZWS-expected.png: Added.
* platform/mac-leopard/fast/text/international/bidi-control-chars-treated-as-ZWS-expected.txt: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28688
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-12-13 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Adam Roben.
+
+ - test that Unicode bidi control characters are rendered as zero width
+ spaces
+
+ * fast/text/international/bidi-control-chars-treated-as-ZWS.html: Added.
+ * platform/mac-leopard/fast/text/international/bidi-control-chars-treated-as-ZWS-expected.checksum: Added.
+ * platform/mac-leopard/fast/text/international/bidi-control-chars-treated-as-ZWS-expected.png: Added.
+ * platform/mac-leopard/fast/text/international/bidi-control-chars-treated-as-ZWS-expected.txt: Added.
+
2007-12-12 Dan Bernstein <mitz@apple.com>
Reviewed by Oliver Hunt.
--- /dev/null
+This tests that Unicode bidi control characters are not rendered and have zero width. The next two lines should look the same.
+<div style="font-family: 'Times New Roman';">
+ a‭è<br>
+ aè
+</div>
--- /dev/null
+47f03934faca7ba1b6a83f3e560c6bc7
\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock (anonymous) at (0,0) size 784x36
+ RenderText {#text} at (0,0) size 751x36
+ text run at (0,0) width 751: "This tests that Unicode bidi control characters are not rendered and have zero width. The next two lines should look the"
+ text run at (0,18) width 36: "same."
+ RenderBlock {DIV} at (0,36) size 784x36
+ RenderText {#text} at (0,0) size 14x17
+ text run at (0,0) width 7: "a"
+ text run at (7,0) width 7 LTR override: "e\x{300}"
+ RenderBR {BR} at (14,14) size 0x0
+ RenderText {#text} at (0,18) size 14x17
+ text run at (0,18) width 14: "ae\x{300}"
+2007-12-13 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Adam Roben.
+
+ - ensure that Unicode bidi control characters are rendered as zero width
+ spaces
+
+ Test: fast/text/international/bidi-control-chars-treated-as-ZWS.html
+
+ * platform/graphics/Font.h:
+ (WebCore::Font::treatAsZeroWidthSpace):
+ * platform/graphics/GlyphPageTreeNode.cpp:
+ (WebCore::GlyphPageTreeNode::initializePage):
+ * platform/text/CharacterNames.h:
+
2007-12-13 Brady Eidson <beidson@apple.com>
Build fix
}
#endif
static bool treatAsSpace(UChar c) { return c == ' ' || c == '\t' || c == '\n' || c == 0x00A0; }
- static bool treatAsZeroWidthSpace(UChar c) { return c < 0x20 || (c >= 0x7F && c < 0xA0) || c == 0x200e || c == 0x200f; }
+ static bool treatAsZeroWidthSpace(UChar c) { return c < 0x20 || (c >= 0x7F && c < 0xA0) || c == 0x200e || c == 0x200f || c >= 0x202a && c <= 0x202e; }
private:
FontDescription m_fontDescription;
#if !PLATFORM(QT)
buffer[(int)'\t'] = ' ';
buffer[noBreakSpace] = ' ';
} else if (start == (leftToRightMark & ~(GlyphPage::size - 1))) {
- // LRM/RLM must not render at all.
+ // LRM, RLM, LRE, RLE and PDF must not render at all.
buffer[leftToRightMark - start] = zeroWidthSpace;
buffer[rightToLeftMark - start] = zeroWidthSpace;
+ buffer[leftToRightEmbed - start] = zeroWidthSpace;
+ buffer[rightToLeftEmbed - start] = zeroWidthSpace;
+ buffer[popDirectionalFormatting - start] = zeroWidthSpace;
} else if (start == (objectReplacementCharacter & ~(GlyphPage::size - 1))) {
// Object replacement character must not render at all.
buffer[objectReplacementCharacter - start] = zeroWidthSpace;
const UChar horizontalEllipsis = 0x2026;
const UChar ideographicSpace = 0x3000;
const UChar leftToRightMark = 0x200E;
+ const UChar leftToRightEmbed = 0x202A;
const UChar leftToRightOverride = 0x202D;
const UChar newlineCharacter = 0x000A;
const UChar noBreakSpace = 0x00A0;
const UChar objectReplacementCharacter = 0xFFFC;
const UChar popDirectionalFormatting = 0x202C;
const UChar rightToLeftMark = 0x200F;
+ const UChar rightToLeftEmbed = 0x202B;
const UChar rightToLeftOverride = 0x202E;
const UChar softHyphen = 0x00AD;
const UChar whiteBullet = 0x25E6;